--- wine1.2-1.1.43.orig/config.sub +++ wine1.2-1.1.43/config.sub @@ -0,0 +1,1693 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-06-11' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -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*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | 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 \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[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 | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | 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-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[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-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | 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 + ;; + 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) + 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'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + 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. + -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* | -solaris* | -sym* \ + | -kopensolaris* \ + | -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* \ + | -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* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -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: --- wine1.2-1.1.43.orig/config.guess +++ wine1.2-1.1.43/config.guess @@ -0,0 +1,1533 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-06-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -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 ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + 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: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:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -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:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd | genuineintel) + 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-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | 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 | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[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 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: --- wine1.2-1.1.43.orig/debian/compat +++ wine1.2-1.1.43/debian/compat @@ -0,0 +1 @@ +5 --- wine1.2-1.1.43.orig/debian/wine1.2-dev.install.amd64 +++ wine1.2-1.1.43/debian/wine1.2-dev.install.amd64 @@ -0,0 +1,2 @@ +usr/lib32/*.so +usr/include --- wine1.2-1.1.43.orig/debian/wine1.2.postrm +++ wine1.2-1.1.43/debian/wine1.2.postrm @@ -0,0 +1,80 @@ +#!/bin/sh +# postrm script for wine +# +# see: dh_installdeb(1) +set -e + +. /usr/share/debconf/confmodule + +# Undo removal of a no-longer used conffile +undo_rm_conffile() +{ + CONFFILE="$1" + + if [ ! -e "$CONFFILE" ]; then + if [ -e "$CONFFILE".dpkg-bak ]; then + echo "Restoring modified conffile $CONFFILE" + mv -f "$CONFFILE".dpkg-bak "$CONFFILE" + elif [ -e "$CONFFILE".dpkg-obsolete ]; then + mv -f "$CONFFILE".dpkg-obsolete "$CONFFILE" + fi + fi +} + +# Finish removal of a no-longer used conffile +finish_rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE".dpkg-bak ]; then + rm -f "$CONFFILE".dpkg-bak + fi +} + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + abort-install|abort-upgrade) + if dpkg --compare-versions "$2" lt 1.1.36-0ubuntu3; then + undo_rm_conffile /etc/sysctl.d/wine.sysctl.conf + undo_rm_conffile /etc/sysctl.d/30-wine.conf + fi + ;; + + purge) + if dpkg --compare-versions "$2" lt 1.1.36-0ubuntu3; then + finish_rm_conffile /etc/sysctl.d/wine.sysctl.conf + finish_rm_conffile /etc/sysctl.d/30-wine.conf + fi + rm -f /etc/sysctl.d/31-wine.conf + # Reload the sysctl file + start procps || true + ;; + + remove|upgrade|failed-upgrade|disappear) + # Do nothing + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- wine1.2-1.1.43.orig/debian/ttf-symbol-replacement.install +++ wine1.2-1.1.43/debian/ttf-symbol-replacement.install @@ -0,0 +1,2 @@ +usr/share/wine/fonts/symbol.ttf /usr/share/fonts/truetype/ttf-symbol-replacement/symbol-replacement.ttf + --- wine1.2-1.1.43.orig/debian/wine1.2.templates +++ wine1.2-1.1.43/debian/wine1.2.templates @@ -0,0 +1,18 @@ +Template: wine/memory +Type: select +Choices: normal, zeropage +Default: normal +Description: What memory range should be used? + When Wine runs most applications (Win32), it only needs access to normal + application memory ranges. Some applications (Win16) require access to + the zero-page of memory, which is reserved for administrative purposes. + . + Allowing access to the zero-page of memory weakens system security by + allowing for a class of kernel security exploits that can elevate a + normal user process to root privileges by using the zero-page of memory. + Because of this, the "zeropage" option is not recommended. However, + there are some Wine applications that require this setting. + . + For more information, see http://wiki.debian.org/mmap_min_addr + . + If unsure, choose "normal". --- wine1.2-1.1.43.orig/debian/wine-Programs.directory +++ wine1.2-1.1.43/debian/wine-Programs.directory @@ -0,0 +1,19 @@ +[Desktop Entry] +Type=Directory +Name=Programs +Name[cs]=Aplikace +Name[sv]=Program +Name[da]=Programmer +Name[de]=Programme +Name[es]=Programas +Name[eu]=Programak +Name[el]=ΠÏογÏάμματα +Name[fr]=Programmes +Name[he]=תכניות +Name[hu]=Programok +Name[it]=Programmi +Name[lt]=Programos +Name[nl]=Programma's +Name[pt]=Programas +Name[pt_br]=Programas +Icon=folder --- wine1.2-1.1.43.orig/debian/wine1.2.install.amd64 +++ wine1.2-1.1.43/debian/wine1.2.install.amd64 @@ -0,0 +1,5 @@ +usr/bin +usr/share +usr/lib32/wine +usr/lib32/*.so.* +etc/xdg --- wine1.2-1.1.43.orig/debian/watch +++ wine1.2-1.1.43/debian/watch @@ -0,0 +1,3 @@ +version=3 + +http://sf.net/wine/wine-(.*)\.tar\.bz2 --- wine1.2-1.1.43.orig/debian/changelog +++ wine1.2-1.1.43/debian/changelog @@ -0,0 +1,3890 @@ +wine1.2 (1.1.43-0ubuntu1~lucidppa3+winehacks1.1) lucid; urgency=low + + * Fix configure problem due to accidental binfmt renaming + + -- Jasmine Iwanek Tue, 27 Apr 2010 17:20:00 +0100 + +wine1.2 (1.1.43-0ubuntu1~lucidppa3+winehacks1) lucid; urgency=low + + * Wine Hacks Release + - DIB Engine as of 2010-03-24 07:24 (Patches 1-15) + - WinePulse 0.36 + - DDraw Desktop Hack from http://repo.or.cz/w/wine/hacks.git + - Fixed so it still uses the new code in wine + * Use invoke-rc.d procps start (LP: #447197) + * Cleanups to the debian/ directory + - add README.source + - add source/format + - Remove Wine Team PPA Specific Changes to control + * Add Extra Icons from 1.0 PPA Release + - This is in preperation for putting Regedit and winmine + Back on the menu (Amongst Others) + + -- Jasmine Iwanek Tue, 27 Apr 2010 07:07:00 +0100 + +wine1.2 (1.1.43-0ubuntu1~lucidppa3) lucid; urgency=low + + * Don't use cautious-launcher so right click -> Open with Wine works + * debian/control: + - Conflict with wine1.0 packages on Lucid + - Recommend new winetricks package + * Merge in Lucid menu item translations + - pt (João Santos), he (Yaron) + + -- Scott Ritchie Mon, 26 Apr 2010 14:04:08 -0700 + +wine1.2 (1.1.43-0ubuntu1~lucidppa2) lucid; urgency=low + + * Re-add dummy packages to smooth upgrades (for ppa only) + + -- Scott Ritchie Wed, 21 Apr 2010 14:54:17 -0700 + +wine1.2 (1.1.43-0ubuntu1~lucidppa1) lucid; urgency=low + + * New upstream release + - A number of new icons. + - Improved support for alpha channel in bitmaps. + - Many Direct3D fixes and optimizations. + - More complete msvcr80/90 implementations. + - A wide range of 64-bit fixes. + - Various bug fixes. + + -- Scott Ritchie Wed, 21 Apr 2010 14:11:14 -0700 + +wine1.2 (1.1.42-0ubuntu3) lucid; urgency=low + + * Rebuild with png support now that ia32-libs updated (LP: #554293) + * debian/control: use lib32v4l on amd64 + * debian/control: no longer provide dummy "wine" package (LP: #527732) + - includes wine, wine-dev, and wine-gecko + - will require a rebuild of wine and wine-gecko packages + * Translations for menu items: (LP: #386125) + - hu (Gabor Kelemen), ru (Vladimir Makhnychev), nl (Paul van Genderen), + el (Jennie Petoumenou), es (David Rando), pt_BR (André Desgualdo Pereira), + fr (Francois Gouget), da (zenith), lt (Marius Gedminas), + cs (Jan Nekvasil), eu (Ibai Oihanguren) + - Also change C:\ to C: for all translations + + -- Scott Ritchie Wed, 14 Apr 2010 19:50:52 -0700 + +wine1.2 (1.1.42-0ubuntu2) lucid; urgency=low + + * Make embedded tahoma font wine-specifc again [LP: #514493, #412195] + * Rebuild with new libpng (LP: #554293) + * Include IT translation for menu items (Sergio Zanchetta) + * Higher version number to surpass PPA version (LP: #530493) + + -- Scott Ritchie Sat, 10 Apr 2010 14:08:44 -0700 + +wine1.2 (1.1.42-0ubuntu1) lucid; urgency=low + + * New upstream release + - Support for shared 32/64-bit setups. + - Dwarf debug info support for better backtraces. + - More standard actions supported in MSI. + - Support for TIFF image format in WinCodecs. + - A number of Direct3D improvements. + - Shell fixes for better Internet Explorer support. + - Various bug fixes. + * Should build with new mpg123 (LP: #456132) + + -- Scott Ritchie Wed, 07 Apr 2010 01:39:47 -0700 + +wine1.2 (1.1.41-0ubuntu2) lucid; urgency=low + + * debian/control: build depend on libv4l-dev + + -- Scott Ritchie Sun, 21 Mar 2010 18:30:45 -0700 + +wine1.2 (1.1.41-0ubuntu1) lucid; urgency=low + + * New upstream release + - A wide range of Direct3D improvements. + - Support for SHA-256, SHA-384, and SHA-512 algorithms. + - A number of MSHTML fixes. + - Support for mp3 decoding on Mac OS X. + - Various widl improvements. + - More typelib fixes. + - OLE storage improvements. + - Various bug fixes. + + -- Scott Ritchie Fri, 19 Mar 2010 17:56:00 -0700 + +wine1.2 (1.1.40-0ubuntu2) lucid; urgency=low + + * New upstream release + - Support for Wow64 registry redirection. + - Increased coverage of MSI standard actions. + - Various Wordpad improvements. + - Many shell fixes for better IE support. + - Improved support for typelibs. + - Better GL card detection. + - Various bug fixes. + + -- Scott Ritchie Sun, 07 Mar 2010 12:11:37 -0800 + +wine1.2 (1.1.39-0ubuntu1) lucid; urgency=low + + * New upstream release + - Support for registry symbolic links. + - Many MSI fixes. + - Build process improvements. + - MSXML cleanups and fixes. + - A number of MSHTML improvements. + - Various bug fixes. + * debian/control: build with mpg123 on amd64 + - The 1.10.1 prerelease should fix the previous build failure. (LP: #522916) + + -- Scott Ritchie Fri, 19 Feb 2010 15:26:37 -0800 + +wine1.2 (1.1.38-0ubuntu1) lucid; urgency=low + + * New upstream release + - Better support for memory allocations debugging. + - Improved MIDI support. + - A wide range of Direct3D fixes. + - OLEDB fixes (should fix Clipart in Office). + - Improved debugger support on x86-64. + - Many MSI fixes. + - Various bug fixes. + * Also rebuild (LP: #506320) + + -- Scott Ritchie Sun, 07 Feb 2010 14:53:05 -0800 + +wine1.2 (1.1.37-0ubuntu2) lucid; urgency=low + + * No changes rebuild to force building with new ia32-libs + + -- Scott Ritchie Tue, 02 Feb 2010 15:25:14 -0800 + +wine1.2 (1.1.37-0ubuntu1) lucid; urgency=low + + * New upstream release + - A number of fixes in AVI file support. + - Several MSXML improvements. + - A few MSI fixes. + - Various bug fixes. + + -- Scott Ritchie Tue, 02 Feb 2010 11:15:03 -0800 + +wine1.2 (1.1.36-0ubuntu3) lucid; urgency=low + + * debian/{rules,wine.sysctl.conf}: actually drop the static sysctl files. + * debian/wine.{dirs,install}.*: remove the no longer shipped /etc/sysctl.d. + * debian/rules: add missing dh_installdebconf for debconf (LP: #511014). + * debian/control: fix Conflict/Replace versions of wine (LP: #511052). + * debian/wine1.2.postrm: include confmodule sooner (Debian bug 133029). + * debian/wine1.2.{postinst,preinst,postrm}: + - clean up sysctl files using wine1.2 package and version. + - use "lt" instead of "lt-nl" to handle the case of a newly installed + wine1.2 package replacing an older wine package. + - include the wine package's 30-wine.conf md5sum for comparison. + + -- Kees Cook Fri, 22 Jan 2010 02:03:07 -0800 + +wine1.2 (1.1.36-0ubuntu2) lucid; urgency=low + + * Port to Lucid + * Port Kees' changes from wine package: + * debian/{control,*.lpia}: removed lpia arch since it is not supported. + * debian/rules: support "parallel=N" in DEB_BUILD_OPTIONS. + * implement an execute bit checker for the Ubuntu Non-Exec Policy + (LP: #506702): + - debian/wine1.2.mime: update mime handlers to use new launcher. + - fix a typo in kees patch that removed x-winexe mimetype. + - debian/patches/nonexec-launcher.diff: use new launcher for desktop file. + * debian/wine1.2.{postinst,preinst,postrm}: clean up old static sysctl + files (LP: #352119). + * debian/control, debian/wine1.2.{templates,config,postinst,postrm}: add + debconf question for selecting a sensible mmap_min_addr system setting + (LP: #475540). + * debian/wine1.2.{postinst,postrm}: + - use "start procps || true" instead of invoke-rc.d (LP: #447197) + * debian/control: update text in wine, wine-dev, and wine-gecko to say that + its for easing wine upgrades and not just for PPA users now. + + -- Scott Ritchie Sat, 16 Jan 2010 17:12:15 -0800 + +wine1.2 (1.1.36-0ubuntu1) karmic; urgency=low + + * New upstream release + - Completion of the 16-bit separation. + - Improved Shader Model 4 support. + - A ton of memory leak fixes. + - Improved debugging support for MinGW. + - A number of MSHTML fixes. + - Various bug fixes. + + -- Scott Ritchie Fri, 08 Jan 2010 15:22:46 -0800 + +wine1.2 (1.1.35-0ubuntu1) karmic; urgency=low + + * New upstream release + - Support for OLE transacted storage. + - Better certificate checking on secure connections. + - More progress on the 16-bit separation. + - Left 4 Dead 2 DRM really supported now. + - MSI performance improvements. + - 64-bit fixes in debugger support. + - Various bug fixes. + + -- Scott Ritchie Fri, 18 Dec 2009 18:01:30 -0800 + +wine1.2 (1.1.34-0ubuntu1) karmic; urgency=low + + * New upstream release + - Many fixes for crypto certificates support. + - A lot of MSHTML improvements. + - Various fixes to support the Left 4 Dead 2 DRM. + - A number of OLE marshalling fixes. + - More Listview improvements. + - Various bug fixes. + + -- Scott Ritchie Sun, 06 Dec 2009 15:59:38 -0800 + +wine1.2 (1.1.33-0ubuntu1~ppa1) karmic; urgency=low + + * New upstream release + - Gecko now installed at wineprefix creation time. + - Better support for certificates in crypt32. + - Improved sound support in mciwave. + - Some more Direct3D 10 functions. + - Many cleanups for issues spotted by Valgrind. + - Various bug fixes. + + -- Scott Ritchie Fri, 13 Nov 2009 17:43:31 -0800 + +wine1.2 (1.1.32-0ubuntu1~ppa2) karmic; urgency=low + + * Remove photoshop patch to fix FTBFS + + -- Scott Ritchie Tue, 27 Oct 2009 00:40:11 -0700 + +wine1.2 (1.1.32-0ubuntu1~ppa1) karmic; urgency=low + + * New upstream release + - Many crypto fixes, particularly on 64-bit. + - Improved DVD access on Mac OS. + - Several common controls improvements. + - Various HTML support improvements. + - More DIB optimizations. + - Various bug fixes. + * debian/control: add dummy wine, wine-dev, and wine-gecko packages to point + to their wine1.2 equivalents for upgrading users + + -- Scott Ritchie Sun, 25 Oct 2009 02:38:47 -0700 + +wine1.2 (1.1.31-0ubuntu2) karmic; urgency=low + + * Use Quilt patch system + * Apply small installer workaround patch that may help Photoshop installs + * debian/control: + - ttf-tahoma-replacement and ttf-symbol-replacement are Recommends + * Symbol should no longer install an empty tahoma dir (LP: #397254) + * debian/wine1.2.postinst: replace invoke-rc.d with service (LP: #447197) + + -- Scott Ritchie Sun, 11 Oct 2009 21:29:59 -0700 + +wine1.2 (1.1.31-0ubuntu1) karmic; urgency=low + + * New upstream release + - Vastly improved monthcal control. + - Performance improvements for DIB sections. + - Several sound driver fixes. + - Beginning of ActiveX support in JScript. + - More Direct3D 10 work. + - More 16-bit dlls split off to separate modules. + - Support for attachments in MAPI. + - Various bug fixes. + + -- Scott Ritchie Fri, 09 Oct 2009 14:03:59 -0700 + +wine1.2 (1.1.30-0ubuntu4) karmic; urgency=low + + * debian/control: + - update package description to show beta release (LP: #443965) + - move homepage into actual homepage field + - bump standards version to 3.8.3 + - put fonts in section fonts instead of x11 + - put wine1.2-dbg in debug section + - explicit wine1.2 in otherosfs section + - bump debhelper build-depends version to clear lintian warning + + -- Scott Ritchie Mon, 05 Oct 2009 12:17:08 -0700 + +wine1.2 (1.1.30-0ubuntu3) karmic; urgency=low + + * Add all of Joel Hodsworths icons using uuencode + * debian/control: build-depend on sharutils + * debian/rules: use proper name for wine.sysctl.conf + * debian/copyright: + - remove reference to unused ubuntustudio icons + - bump year from 2004 to 2009 + * debian/wine-browsedrive.desktop: use folder-wine icon + + -- Scott Ritchie Tue, 29 Sep 2009 02:06:59 -0700 + +wine1.2 (1.1.30-0ubuntu2) karmic; urgency=low + + * Build-depend on libopenal-dev + * Delete unused debian/patches + + -- Scott Ritchie Mon, 28 Sep 2009 10:02:44 -0700 + +wine1.2 (1.1.30-0ubuntu1) karmic; urgency=low + + * New upstream release + - Support for OpenAL. + - Many improvements in HTML and JavaScript support. + - Many common controls fixes and improvements. + - More Direct3D 10 work. + - Better MAPI support. + - Various bug fixes. + * Drop Roderick's patch as it's integrated upstream. + * Add new wine icon at different sizes + - icons by Joel Holdsworth + - replacements for the other icons coming soon + - debian/rules: install as a subfolder + - only the 32x32 one is used and installed to /usr/share/pixmaps + * debian/rules: remove deprecated dh_desktop + + -- Scott Ritchie Sat, 26 Sep 2009 07:56:57 -0700 + +wine1.2 (1.1.29-0ubuntu3) karmic; urgency=low + + * debian/rules: fix debug package misspelling so it actually builds + + -- Scott Ritchie Wed, 23 Sep 2009 04:26:39 -0700 + +wine1.2 (1.1.29-0ubuntu2) karmic; urgency=low + + * debian/rules: create separate wine1.2-debug package + * debian/control: only build libmpg123 on i386 (seems amd64 is broken) + * fontconfig file for tahoma to disable embedded bitmaps (LP: #412195) + + -- Scott Ritchie Wed, 16 Sep 2009 18:06:42 -0700 + +wine1.2 (1.1.29-0ubuntu1) karmic; urgency=low + + * New upstream release + - Improved Gecko integration by using Wine's network layers. + - Use of external libmpg123 for mp3 decoding. + - Support for JPEG and PNG formats in WindowsCodecs. + - Many regression test fixes for Win64 and Windows 7. + - Various bug fixes. + * Debian/control: build-depend on libmpg123-dev + * Include Roderick Colenbranders steam regression fix patch + + -- Scott Ritchie Mon, 07 Sep 2009 11:36:25 -0700 + +wine1.2 (1.1.28-0ubuntu1) karmic; urgency=low + + * New upstream release + - Support for IRDA protocol. + - Faster initial wineprefix creation. + - Axis remapping with evdev joysticks. + - More image formats in WindowsCodecs. + - Various bug fixes. + + -- Scott Ritchie Tue, 25 Aug 2009 19:07:47 -0700 + +wine1.2 (1.1.27-0ubuntu2) karmic; urgency=low + + * debian/control: build-depend on libgsm1-dev + + -- Scott Ritchie Wed, 19 Aug 2009 05:49:48 -0700 + +wine1.2 (1.1.27-0ubuntu1) karmic; urgency=low + + * New upstream release + - New version of the Gecko engine. + - New GSM 06.10 codec support. + - Improved support for the disk volume APIs. + - Support for XShm pixmaps for better performance. + - Various bug fixes. + * debian/control: wine-dev depends on wine1.2 (LP: #410911) + + -- Scott Ritchie Mon, 10 Aug 2009 03:43:41 -0700 + +wine1.2 (1.1.26-0ubuntu1) karmic; urgency=low + + * New upstream release + - Still more translation updates. + - Faster bitmap stretching using XRender. + - Proxy support in WinHTTP. + - Many more JScript functions. + - Various bug fixes. + + -- Scott Ritchie Fri, 17 Jul 2009 23:15:37 -0700 + +wine1.2 (1.1.25-0ubuntu1) karmic; urgency=low + + * New upstream release + - A ton of translation updates. + - Support for various Unicode file encodings in Notepad. + - Improved memory management, especially for OpenGL. + - Desktop menus now cleaned up automatically. + - Beginnings of a windowscodecs DLL implementation. + - Various bug fixes. + + -- Scott Ritchie Wed, 08 Jul 2009 14:32:46 -0700 + +wine1.2 (1.1.24-0ubuntu2) karmic; urgency=low + + * Split ttf-symbol-replacement into separate package + * Have Wine depend on ttf-tahoma-replacement and ttf-symbol-replacement + * Change defoma hints for tahoma-replacement to not say just "tahoma" + * ttf-tahoma-replacement.install: install as tahoma-replacement not "tahoma" + * Recommend wine1.2-gecko instead of wine-gecko + + -- Scott Ritchie Sun, 28 Jun 2009 23:34:52 -0700 + +wine1.2 (1.1.24-0ubuntu1) karmic; urgency=low + + * Port to Karmic, create 1.2 branch, basing off Jaunty PPA version + * debian/control: conflict/replace/provide old Wine + * Split Tahoma replacement font into separate package, ttf-tahoma-replacement + * debian: rename all files to wine1.2.foo + + -- Scott Ritchie Sun, 28 Jun 2009 12:22:31 -0700 + +wine (1.1.24~winehq0~ubuntu~9.04-0ubuntu1) jaunty; urgency=low + + * New upstream release + - Support for freedesktop file associations. + - Support for exception handling on 64-bit. + - Improved ARB shaders. + - Fixes for the FBO mode. + - Many listview improvements. + - Various bug fixes. + * Change suggests: msttcorefonts to recommends: ttf-mscorefonts-installer + + -- Scott Ritchie Sat, 20 Jun 2009 21:52:45 -0700 + +wine (1.1.23~winehq0~ubuntu~9.04-0ubuntu1) jaunty; urgency=low + + * New upstream release + - Support for registering MIME types with the Linux desktop. + - FBO mode is now the default for Direct3D. + - Support for COM proxy delegation. + - Improved support for the Mingw cross-compile. + - Proper fullscreen mode for the virtual desktop. + - Various bug fixes. + + -- Scott Ritchie Fri, 05 Jun 2009 12:30:12 -0700 + +wine (1.1.22~winehq0~ubuntu~9.04-0ubuntu1) jaunty; urgency=low + + * New upstream release + - More improvements to OLE copy/paste. + - Beginnings of x86_64 exception handling. + - Direct3D locking fixes. + - ARB shaders improvements. + - Better OpenGL pixel format support. + - Various bug fixes. + + -- Scott Ritchie Fri, 22 May 2009 15:18:18 -0700 + +wine (1.1.21~winehq0~ubuntu~9.04-0ubuntu1) jaunty; urgency=low + + * New upstream release + - Beginnings of shader model 4 support. + - Support for copying/pasting images from X11 applications. + - A number of GDIPlus improvements. + - Various listview fixes. + - 64-bit support in winemaker. + - Support for building on Mac OS X Snow Leopard. + - Various bug fixes. + * New icons for wine, winecfg, winefile, and notepad + - Thanks to Christian Dannie Storgaard + - No small sized icons yet; they will be pushed upstream + - No icon for uninstall (will be phased out) + + -- Scott Ritchie Fri, 08 May 2009 13:09:33 -0700 + +wine (1.1.20~winehq0~ubuntu~9.04-0ubuntu1) jaunty; urgency=low + + * New upstream release + - Show a dialog on application crashes. + - Much improved OLE copy/paste support. + - Various listview improvements. + - More Direct3D code cleanups. + - Various bug fixes. + * New icons taken from the ubuntustudio-icon-theme package + * Remove unused wine-regedit, wine-winehelp, and wine-winemine icons + * debian/copyright: mention ubuntustudio icons CC-by-SA license + + -- Scott Ritchie Fri, 24 Apr 2009 15:48:22 -0700 + +wine (1.1.19~winehq0~ubuntu~9.04-0ubuntu1) jaunty; urgency=low + + * New upstream release + - Support for Visual C++ project files in winemaker. + - Improvements to the Esound driver. + - Many Direct3D code cleanups. + - Fixes to OLE clipboard handling. + - OpenBSD compilation fixed. + - Various bug fixes. + + -- Scott Ritchie Fri, 10 Apr 2009 15:27:45 -0700 + +wine (1.1.18~winehq0~ubuntu~9.04-0ubuntu2) jaunty; urgency=low + + * debian/rules: remove cleanup of temporary library directory + on amd64 (should have gone with the rest of it last update) + + -- Scott Ritchie Mon, 30 Mar 2009 02:35:06 -0700 + +wine (1.1.18~winehq0~ubuntu~9.04-0ubuntu1) jaunty; urgency=low + + * Port to Jaunty + * New upstream release + - RPC over HTTP support. + - Improved support for upgrades in MSI. + - Debug symbols in WineDbg on Mac OS X. + - Many Direct3D code cleanups. + - Various bug fixes. + * debian/rules: + Remove all the manual links to libraries since .so symlinks are created in /usr/lib32 for us + Delete some old comments when the rules file was created + * debian/changelog: + Change libjack0.100.0-dev build depends to libjack-dev + + -- Scott Ritchie Fri, 27 Mar 2009 18:40:44 -0700 + +wine (1.1.17~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Joystick support on Mac OS X. + - Implementation of iphlpapi on Solaris. + - A number of 64-bit improvements. + - Obsolete LinuxThreads support has been removed. + - Many fixes to the regression tests on Windows. + - Various bug fixes. + + -- Scott Ritchie Fri, 13 Mar 2009 14:05:48 -0700 + +wine (1.1.16~winehq0~ubuntu~8.10-0ubuntu2) intrepid; urgency=low + + * debian/wine-uninstaller.desktop: fix exec link + + -- Scott Ritchie Wed, 04 Mar 2009 11:11:13 -0800 + +wine (1.1.16~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Improved SANE scanner support. + - Support for digital CD audio playback. + - Improved cookies management in Wininet. + - Support for building stand-alone 16-bit modules. + - Many fixes to the regression tests on Windows. + - Various bug fixes. + * Reverse previous patch as it's now included + + -- Scott Ritchie Fri, 27 Feb 2009 21:53:15 -0800 + +wine (1.1.15~winehq0~ubuntu~8.10-0ubuntu4) intrepid; urgency=low + + * Cherry pick a patch from git to prevent build failure + - Should be included in 1.1.16 + * Revert previous (nonworking) changes with binutils build dep + + -- Scott Ritchie Wed, 18 Feb 2009 13:55:56 -0800 + +wine (1.1.15~winehq0~ubuntu~8.10-0ubuntu3) intrepid; urgency=low + + * Change build depend on binutils to binutils-multiarch + + -- Scott Ritchie Sat, 14 Feb 2009 16:55:25 -0800 + +wine (1.1.15~winehq0~ubuntu~8.10-0ubuntu2) intrepid; urgency=low + + * Build depend on binutils to prevent launchpad build failure + + -- Scott Ritchie Sat, 14 Feb 2009 11:28:37 -0800 + +wine (1.1.15~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Gecko engine update. + - Better region support in GdiPlus. + - Support for cross-compilation in winegcc. + - Beginnings of MS Text Framework support. + - Many fixes to the regression tests on Windows. + - Various bug fixes. + * Gecko package will be updated separately + + -- Scott Ritchie Sat, 14 Feb 2009 02:16:31 -0800 + +wine (1.1.14~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Various bug fixes for Internet Explorer 7. + - Many crypt32 improvements, including new export wizard. + - Better support for windowless Richedit. + - Improvements to the print dialog. + - Many fixes to the regression tests on Windows. + - Various bug fixes. + + -- Scott Ritchie Fri, 30 Jan 2009 10:41:27 -0800 + +wine (1.1.13~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Freedesktop.org-compliant startup notifications. + - Many fixes for 64-bit application support. + - Improved graphics support in Internet Explorer. + - Various Richedit improvements. + - Better certificate manager dialog. + - Various bug fixes. + + -- Scott Ritchie Sat, 17 Jan 2009 10:40:07 -0800 + +wine (1.1.12~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Some simple 64-bit apps should now run. + - Support for subpixel font rendering. + - 64-bit code generation in the IDL compiler. + - New version of the Gecko engine. + - Various bug fixes. + * wine-gecko will be updated separately + + -- Scott Ritchie Fri, 02 Jan 2009 13:29:19 -0800 + +wine (1.1.11~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Numerous fixes for IE7 support. + - Support for 64-bit cross-compile using Mingw64. + - User interface support for crypto certificates. + - Better support for MSI installation patches. + - Various Direct3D optimizations. + - Various bug fixes. + * Remove libx86-dev from build depends (not sure why I added it) + + -- Scott Ritchie Sat, 20 Dec 2008 17:39:51 -0800 + +wine (1.1.10~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Support for virtual memory write watches. + - Workarounds for the WINAPI compiler bug on Mac OS. + - Several fixes for the 64-bit build. + - Some more GdiPlus functions. + - Various bug fixes. + + -- Scott Ritchie Fri, 05 Dec 2008 13:39:52 -0800 + +wine (1.1.9~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - A large number of regression test fixes. + - Performance improvements in memory management. + - Improved POP3 support in inetcomm. + - Initial implementation of the XInput DLL. + - Various bug fixes. + + -- Scott Ritchie Fri, 21 Nov 2008 11:14:16 -0800 + +wine (1.1.8~winehq0~ubuntu~8.10-0ubuntu2) intrepid; urgency=low + + * Link libgnutls.so.26 on amd64 + * Fix link for libdbus-1.so.3 on amd64 + * Build-depend on libgnutls-dev + + -- Scott Ritchie Mon, 10 Nov 2008 20:32:50 -0800 + +wine (1.1.8~winehq0~ubuntu~8.10-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Substantial parts of inetcomm implemented (for Outlook). + - Still better crypt32 support. + - Memory management improvements. + - Theming support for buttons. + - Various bug fixes. + * Rebase around Intrepid packages (re-adds sysctl.d files) + * Add libx86-dev to build depends + + -- Scott Ritchie Fri, 07 Nov 2008 14:03:12 -0800 + +wine (1.0.1-0ubuntu2) intrepid; urgency=low + + * debian/wine-browsedrive.desktop: + - remove $HOME in Exec=xdg-open .wine/dosdevices/c: + - Should make "Brose C:\ Drive" work again. (LP: #223989) + * debian/control: + - Replace libcupsys2-dev build depend with renamed libcups2-dev + + -- Scott Ritchie Sun, 26 Oct 2008 12:06:10 -0700 + +wine (1.0.1-0ubuntu1) intrepid; urgency=low + + * New upstream release + - Bug Fix only release (LP: #285341) + * Update includes our tools/wine.desktop patch, so we no longer have that + + -- Scott Ritchie Sat, 18 Oct 2008 00:44:19 -0700 + +wine (1.0.0-1ubuntu11) intrepid; urgency=low + + * debian/control: add new wine-gecko to Recommends for Wine + + -- Scott Ritchie Tue, 14 Oct 2008 16:05:17 -0700 + +wine (1.0.0-1ubuntu10) intrepid; urgency=low + + * Reverting last revision, moved procps from Build-Dep to Depends. + + -- Nicolas Valcárcel Sat, 23 Aug 2008 13:43:08 -0500 + +wine (1.0.0-1ubuntu9) intrepid; urgency=low + + * Added procps to Build-Depends to make postinst happy. + + -- Nicolas Valcárcel Sat, 16 Aug 2008 01:16:58 -0500 + +wine (1.0.0-1ubuntu8) intrepid; urgency=low + + * create debian/wine.sysctl.conf + - now Wine can access the lower 64k of memory (LP: #114025) + * debian/rules: add rules for installing wine.sysctl.conf + * debian/wine.dirs.*: add /etc/sysctl.d folder + * debian/wine.install.*: add /etc/sysctl.d install folder + * remove non arch-specific .install and .dirs files. + * debian/wine.postinst: add invoke-rc.d procps start + - so no reboot is required for Wine's sysctl.conf setting + + -- Scott Ritchie Thu, 07 Aug 2008 04:28:31 -0700 + +wine (1.0.0-1ubuntu7) intrepid; urgency=low + + * debian/control: add ttf-liberation to recommends + + -- Scott Ritchie Tue, 15 Jul 2008 03:15:53 -0700 + +wine (1.0.0-1ubuntu6) intrepid; urgency=low + + * debian/control: change winbind from depends to recommends (LP: 247746) + + -- Scott Ritchie Sat, 12 Jul 2008 01:43:52 -0700 + +wine (1.0.0-1ubuntu5) intrepid; urgency=low + + * debian/wine-browsedrive.desktop: + - change xdg-open ~.wine/drive_c to xdg-open $HOME/.wine/dosdevices/c: + - Opens correct folder even if c drive changed (LP: 223989) + + -- Scott Ritchie Thu, 10 Jul 2008 13:09:33 -0700 + +wine (1.0.0-1ubuntu4) intrepid; urgency=low + + * Re-add dh_installchangelogs to install this changelog (LP: #242072) + + -- Scott Ritchie Fri, 27 Jun 2008 13:22:56 -0700 + +wine (1.0.0-1ubuntu3) intrepid; urgency=low + + * tools/wine.desktop: associate wine with .msi files + * tools/wine.desktop: change to "Wine Windows Program Loader" + - retranslate all current entries (LP: #235593) + - add ca, pt, pt_br, it, da, nb, nn translations + + -- Scott Ritchie Sat, 21 Jun 2008 17:42:12 -0700 + +wine (1.0.0-1ubuntu2) intrepid; urgency=low + + * debian/wine.mime: associate wine with .msi files + + -- Scott Ritchie Fri, 20 Jun 2008 03:12:37 -0700 + +wine (1.0.0-1ubuntu1) intrepid; urgency=low + + * New upstream release + - First stable release of Wine + * Change to 1.0.0 versioning scheme since Wine will make a 1.0.1 + * Remove dh_installchangelogs since the upstream changelog was removed + - It is now available online at winehq.org + + -- Scott Ritchie Tue, 17 Jun 2008 10:22:39 -0700 + +wine (1.0-rc3-1ubuntu1) intrepid; urgency=low + + * New upstream release + - Bugfixes only due to feature freeze pending 1.0 release + + -- Scott Ritchie Fri, 30 May 2008 08:48:53 -0700 + +wine (1.0-rc2-1ubuntu1) intrepid; urgency=low + + * Bump version number because Debian autosynced on top + + -- Scott Ritchie Tue, 27 May 2008 18:46:28 -0700 + +wine (1.0~rc2-1) intrepid; urgency=low + + * New upstream release + - Bugfixes only due to feature freeze pending 1.0 release + * Depend explicitly on winbind package for ntlm_auth + - This provides some added functionality, even though Wine doesn't use it + at build time, which is why it isn't included with shlibs:Depends + + -- Scott Ritchie Sat, 24 May 2008 08:16:24 -0700 + +wine (1.0~rc1-0ubuntu1) intrepid; urgency=low + + * Port from winehq package; update to intrepid + + -- Scott Ritchie Tue, 13 May 2008 23:56:19 -0700 + +wine (1.0~rc1~winehq0~ubuntu~8.04-1) hardy; urgency=low + + * New upstream release + - Bugfixes only due to feature freeze pending 1.0 release + + -- Scott Ritchie Fri, 09 May 2008 15:02:02 -0700 + +wine (0.9.61~winehq0~ubuntu~8.04-1) hardy; urgency=low + + * Added lib32dns-mdns to dependencies for amd64 version + - Internet applications doing domain lookups should work now on amd64 + * New upstream release + - Automatic updating of the WINEPREFIX directory. + - Winhelp now uses Richedit as display engine. + - Many RichEdit fixes. + - More improvements to IME support. + - More quartz fixes. + - Implementation for many more Gdiplus functions. + - Lots of bug fixes. + + -- Scott Ritchie Sat, 03 May 2008 02:17:45 -0700 + +wine (0.9.60~winehq0~ubuntu~8.04-1ubuntu1) hardy; urgency=low + + * Pre-Depends on newer dpkg instead of lzma + + -- Scott Ritchie Fri, 18 Apr 2008 22:05:58 -0700 + +wine (0.9.60~winehq0~ubuntu~8.04-1) hardy; urgency=low + + * New upstream release + - Better support for Windows IMEs. + - Option for Windows-style window decorations. + - Improved system tray behavior. + - Window management fixes. + - Improved quartz audio support. + - Better support for launching apps from Unix file managers. + - Lots of bug fixes. + * The backported system tray regression patch no longer applies + * Compress package with lzma and add Pre-Depends: lzma + + -- Scott Ritchie Fri, 18 Apr 2008 10:27:19 -0700 + +wine (0.9.59-0ubuntu4) hardy; urgency=low + + * Remove MIME entry for application/x-zip-compressed (LP: #213062) + * Fix the 32 bit links for libldap, libldap_r, and liblber in amd64 version + + -- Scott Ritchie Thu, 10 Apr 2008 03:40:33 -0700 + +wine (0.9.59-0ubuntu3) hardy; urgency=low + + * Backport patch to fix system tray regression (LP: #214659) + * Delete old font patches in debian/patches + + -- Scott Ritchie Thu, 10 Apr 2008 01:53:33 -0700 + +wine (0.9.59-0ubuntu2) hardy; urgency=low + + * Re-introduced lpia changes which were forgotten with last upload + + -- Stephan Hermann Wed, 09 Apr 2008 18:21:35 +0200 + +wine (0.9.59-0ubuntu1) hardy; urgency=low + + * New upstream release + - Improved support for the .NET framework. + - Better services handling through a separate services.exe process. + - Support for ATI fragment shader. + - Better support for http proxies. + - Window management fixes. + - Pre-compiled fonts are now available in the source tree. + - Lots of bug fixes. + * The old font patches are gone now since they're included + + -- Scott Ritchie Sat, 05 Apr 2008 23:58:26 -0700 + +wine (0.9.58-0ubuntu3) hardy; urgency=low + + * Make Wine Ready for LPIA + + debian/control: + - added to some build-deps the lpia arch where it's + necessary + - added myself to uploaders + + debian/*.lpia: + - copied *.i386 suffixed files to *.lpia suffixed files to install wine + correctly on lpia + + -- Stephan Hermann Fri, 04 Apr 2008 15:57:20 +0200 + +wine (0.9.58-0ubuntu2) hardy; urgency=low + + * add lithuanian glyphs to fonts file. + For reference the patch is in debian/patches/ and will go away with 0.9.59 + + -- Stephan Hermann Wed, 26 Mar 2008 11:26:42 +0100 + +wine (0.9.58-0ubuntu1) hardy; urgency=low + + * New upstream release + - The default version is now Windows XP. + - Many Richedit improvements. + - Beginning of jscript dll support. + - Shell folders now respect XDG directory configuration. + - Many translation updates. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 21 Mar 2008 23:45:25 -0700 + +wine (0.9.57-0ubuntu3) hardy; urgency=low + + * debian/wine-*.desktop: + - fixed some broken utf8 chars in catalan translation in .desktop files + (LP: #199211) + + -- Stephan Hermann Wed, 19 Mar 2008 21:05:35 +0100 + +wine (0.9.57-0ubuntu2) hardy; urgency=low + + * debian/control: + - added libxi-dev and libxinerama-dev to let wine recognize both libs on + i386 + * debian/wine-*.desktop: + - fixed some broken utf8 characters inside .desktop files (LP: #198761) + + + -- Stephan Hermann Wed, 19 Mar 2008 20:41:57 +0100 + +wine (0.9.57-0ubuntu1) hardy; urgency=low + + [Stephan Hermann] + * Add catalanian translation (LP: #199211) + + [Scott Ritchie] + * New upstream release + - Support for multiple OpenGL pixel formats. + - Improved support for color profiles. + - Many window management fixes. + - Better fullscreen support. + - Lots of bug fixes. + * Reverse dlls/winealsa.drv/waveinit.c patch as it is now upstream + * debian/rules: + - Add 64 bit symlink for libcapi20.so, libjack.so, libodbc.so + - Now Wine builds with capi20, jack, and odbc support on amd64 + * debian/control: + - Update the package description text to be clear and simple (LP: #159412) + * fonts/Makefile.in: + - Workaround an incompatible change in fontforge (LP: #199331) + * Add Polish translation to .desktop files (LP: #198761) + - The translation to wine.desktop was sent upstream + + -- Scott Ritchie Fri, 07 Mar 2008 17:43:22 -0800 + +wine (0.9.56-0ubuntu1) hardy; urgency=low + + * New upstream release (LP: #197588) + - Proper handling of OpenGL/Direct3D windows with menu bars. + - Stubs for all the d3dx9_xx dlls. + - Several graphics optimizations. + - Many installer fixes. + - Improved MIME message support. + - Lots of bug fixes. + * debian/rules: + - reset LDFLAGS to let wine not crash anymore, (LP: #191575) + thx to Albert Damen who came up with this solution. + (http://www.winehq.org/pipermail/wine-bugs/2007-July/062505.html) + - adjust dh_strip call (LP: #185513) + * debian/control: + - remove gcc-3.4 build-dep + - get rid of quilt + * cleaned debian/patches + * Add finnish translation to desktop files (LP: #196916) + * dlls/winealsa.drv/waveinit.c: (LP: #195507) + - let wine use the default alsa device + (http://bugs.winehq.org/show_bug.cgi?id=10942) + * Preloader warning (preloader: Warning: failed to reserve range + 00000000-60000000) does not occure anymore (LP: #114025) + + -- Stephan Hermann Fri, 22 Feb 2008 20:10:36 +0100 + +wine (0.9.55-0ubuntu1) hardy; urgency=low + + The "Just before FF" Release + * New upstream release + - Direct3D improvements, including driver version emulation. + - Beginnings of support for OLE objects in Richedit. + - Several fixes to the animation control. + - A bunch of fixes for regression test failures. + - Lots of bug fixes. + + -- Stephan Hermann Wed, 13 Feb 2008 21:00:57 +0100 + +wine (0.9.54-0ubuntu4) hardy; urgency=low + + * debian/rules: + - revert dh_shlibdeps change from 0.9.54-0ubuntu3 + - synced with scotts list of symlinks + - for amd64 arch: (LP: #187222) + + removed dh_shlibdeps because of a broken shlibs handling in ia32-libs + it failes + + instead add shlibs:Depends=* to dh_gencontrol -- -V + * debian/control: + - added unixodbc-dev to b-d (needed for a configure check against libodbc) + + -- Stephan Hermann Wed, 30 Jan 2008 19:35:31 +0100 + +wine (0.9.54-0ubuntu3) hardy; urgency=low + + * debian/rules: + - dh_shlibdeps: add -Xusr/lib32/wine/ to ignore the wine dll dir + + -- Stephan Hermann Mon, 28 Jan 2008 01:42:28 +0100 + +wine (0.9.54-0ubuntu2) hardy; urgency=low + + * debian/rules: + - amd64 specific: + + added symlink for libjpeg (LP: #144419) + + added symlink for libcups (LP: #155665) + + added symlink for libxml2 (LP: #135417) + * debian/control: + - add quilt to build-dep as patch system + * debian/patches/01_ubuntu_fix_libpng_check.patch: + - added patch to fix the libpng check to actually catch libpng12 + * debian/patches/90_ubuntu_update_configure.patch: + - configure patch after "autoconf" run to use the updated libpng12 fix + * debian/wine-*.desktop + - Added Swedish Translation (LP: #152745) + - Added German Translation + + -- Stephan Hermann Sun, 27 Jan 2008 16:35:13 +0100 + +wine (0.9.54-0ubuntu1) hardy; urgency=low + + * New upstream version: + - Photoshop CS/CS2 should now work, please help us testing it. + See http://wiki.winehq.org/AdobePhotoshop for details. + - A number of RPC fixes. + - Various improvements to the debugger support. + - Lots of bug fixes. + + * debian/control: + - get rid of libjpeg-mmx-dev + + -- Stephan Hermann Fri, 25 Jan 2008 19:32:45 +0100 + +wine (0.9.53-0ubuntu1) hardy; urgency=low + + * New upstream version + - RunOnce and Run entries now executed on startup. + - Beginnings of support for emulated disk devices. + - Many Richedit improvements. + - Nicer looking color dialog. + - Lots of bug fixes. + + -- Stephan Hermann Sat, 12 Jan 2008 17:21:50 +0100 + +wine (0.9.52-0ubuntu1) hardy; urgency=low + + [ Stephan Hermann ] + [Scott Ritchie] + * New upstream version + - Improved graphics tablet support. + - Support for RPC context handles. + - Fixes for some longstanding screen depth issues. + - Implementation of "My Network Places" shell folder. + - Lots of bug fixes. + * Use bzip2 compression rather than gzip for deb to save bandwidth + * Use gcc-3.4 to actually fix copy protection + + [Stephan Hermann] + * debian/control: + - Bumped Standards-Version to 3.7.3 + - Changed giflib3g-dev to libgif-dev + + [ Scott Kitterman ] + * debian/control: + - Prefer libgif-dev to libungif4-dev in build-dep to avoid later problem + with fontforge needing libgif which conflicts with libungif4 + + -- Scott Kitterman Sat, 05 Jan 2008 11:55:30 -0500 + +wine (0.9.51-0ubuntu1) hardy; urgency=low + + * New Upstream Release + - Using Scott Ritchies packages from winehq.org + * debian/rules: + - Changed dh_iconcache to dh_icons + - Added dh_desktop because we install some .desktop files + + + -- Stephan Hermann Sat, 22 Dec 2007 14:32:10 +0100 + +wine (0.9.51~winehq0~ubuntu~7.10-1) gutsy; urgency=low + + * New upstream release + - A bunch of WinHelp improvements. + - Better Japanese font support. + - A ton of rpcrt4 fixes. + - Several Alsa capture fixes. + - Improved support for screen resolution changes. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 14 Dec 2007 15:32:11 -0800 + +wine (0.9.50~winehq0~ubuntu~7.10-2) gutsy; urgency=low + + * Use gcc-4.2 instead of default to fix copy protection + + -- Scott Ritchie Tue, 11 Dec 2007 15:18:44 -0800 + +wine (0.9.50~winehq0~ubuntu~7.10-1) gutsy; urgency=low + + * New upstream release + - Completed I/O completion. + - Improved user credentials management, including Mac Keychain support. + - More Valgrinding. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 30 Nov 2007 21:38:43 -0800 + +wine (0.9.46-0ubuntu1) gutsy; urgency=low + + * New upstream release + - A variety of fixes to improve Photoshop CS2 support. + - More complete support for device installation in setupapi. + - New Bidi text implementation that doesn't depend on libicu. + - The usual assortment of Direct3D improvements. + - Beginning of I/O completion ports support. + - Lots of bug fixes. + * Remove libicu36-dev from build depends - Wine no longer uses it + * Remove libgl1-mesa-dev | libgl-dev from build depends - it was a duplicate + * Link to the ssl and crypto libraries on amd64 + * Added all the pretty icons someone sent to the wine mailing list a while ago + * Modified the .desktop files to use the pretty icons + - Also changed the location of some of the tools to more logical places + - And removed some of the unimportant ones + * Added dh_installmime to rules to make the .mime file actually work + * Created a wine.menu file to make the Applications->Wine folder system-wide + + -- Scott Ritchie Fri, 28 Sep 2007 14:47:50 -0700 + +wine (0.9.45-0ubuntu1) gutsy; urgency=low + + * New upstream release + - Better heuristics for making windows managed. + - Automatic detection of timezone parameters. + - Improvements to the builtin WordPad. + - Better signatures support in crypt32. + - Still more gdiplus functions. + - Lots of bug fixes. + * Incorporate the 32 bit building procedure from winehq packages + - This procedure works around the lack of .so links in /usr/lib32 + - Configure requires .so files, so we make temp .so's in a temp folder + * Comment out the --enable-win64 in 64 bit configure + - Support for Win 64 bit binaries is completely broken in Wine at the moment + - 64 mode prevents Wine from working with 32 bit binaries, making it nearly worthless. + * Updated the build depends: + - Added libpng12-dev (Wine now uses it) + - Removed freeglut (Wine now doesn't use it) + - Added many amd64 specific ones for packages that have 32 bit versions + - Added gcc-multilib [amd64] + * Set myself as uploader rather than original maintainer + * Removed libwine and libwine-dev dummy packages + - They were only needed to work around bugs in apt when users had an old libwine-* package + - Feisty users won't have them, so they're no longer needed + - Removed libwine.links and libwine-dev.links as well + * Added the wine.mime file from upstream to handle .exe files + * The 64 bit package should install libraries into /usr/lib32 now + - Removed wine.install, wine-dev.install, wine.dirs + - And then replaced them with wine.install.i386, wine.install.amd64, etc + + -- Scott Ritchie Tue, 18 Sep 2007 21:11:38 -0700 + +wine (0.9.42-0ubuntu1) gutsy; urgency=low + + * New upstream release. (LP: #128980) + * Changes from upstream: + - Support for activation contexts and side-by-side assemblies. + - Many more gdiplus functions. + - More messaging support in crypt32.dll. + - Many HTTP protocol handling fixes. + - Lots of bug fixes. + + -- Arthur Loiret Fri, 27 Jul 2007 18:23:02 +0200 + +wine (0.9.41-0ubuntu2) gutsy; urgency=low + + * debian/rules: ignore dh_strip errors to fix FTBFS in buildds + + -- Arthur Loiret Sun, 15 Jul 2007 06:33:51 +0200 + +wine (0.9.41-0ubuntu1) gutsy; urgency=low + + * New upstream release + * debian/rules: + - Remove comments in binary-arch target + - Fix debian-rules-ignores-make-clean-error + * debian/control: + - Make wine-dev bin-NMU safe + - Add Uploaders field + * Changes from version 0.9.40: + - Many MSHTML improvements. + - A few more sound fixes. + - Many Direct3D fixes. + - Lots of bug fixes. + * Changes from version 0.9.41: + - A number of gdiplus functions. + - More complete pdh.dll implementation. + - Support for MSI remote calls. + - Messaging support in crypt32.dll. + - Lots of bug fixes. + + -- Arthur Loiret Sat, 14 Jul 2007 14:27:25 +0200 + +wine (0.9.39-0ubuntu1) gutsy; urgency=low + + * New upstream release + * Add debian/watch + * Update Standards-Version to 3.7.2 + * Update compat and debhelper version to 5 + * debian/control: + - remove duplicate Depends on libstdc++6 + - Add homepage to extended description + * debian/libwine{,-dev}.links: link /usr/share/doc/libwine{,-dev} to + /usr/share/doc/wine{,-dev} to fix missing debian changelogs. + * Changes from upstream: + - Many MSHTML improvements. + - Several improvements to the sound support. + - A number of Winsock fixes. + - Several new supported constructs in the IDL compiler. + - Many Direct3D threading fixes. + - Lots of bug fixes. + + -- Arthur Loiret Sun, 17 Jun 2007 11:23:24 +0200 + +wine (0.9.38-0ubuntu1) gutsy; urgency=low + + * New Upstream Version + * Changes from Upstream: + - Beginnings of support for copy protected kernel drivers + - More MSI automation support + - Many 64-bit compilation fixes + - A number of OLE fixes + - Lots of bug fixes + + -- Stephan Hermann Sat, 2 Jun 2007 08:41:21 +0000 + +wine (0.9.37-0ubuntu3) gutsy; urgency=low + + * debian/wine.binfmt: + - changed /usr/bin/wine-auto to /usr/bin/wine + + -- Stephan Hermann Fri, 25 May 2007 11:52:01 +0200 + +wine (0.9.37-0ubuntu2) gutsy; urgency=low + + * debian/control: + - Added libstdc++6-4.1-dev to build-dep for easier backports to Ubuntu + releases < Gutsy Gibbon + * Added debian/wineserver-restart-required.update-notifier for notifiying + the user when wine is upgraded + * debian/wine.postinst: + - added rule for package upgrade to copy + usr/share/wine/wineserver-restart-required.update-notifier to + var/lib/update-notifier/user.d/wineserver-restart-required + * debian/rules: + - removed -fno-stack-protector + + (Upstream Fix: http://bugs.winehq.org/show_bug.cgi?id=6035) + + (Ubuntu Closes: LP #56965) + - copied debian/winserver-restart-required.update-notifier to usr/share/wine + + -- Stephan Hermann Fri, 18 May 2007 06:36:52 +0000 + +wine (0.9.37-0ubuntu1) gutsy; urgency=low + + * New Upstream Release + - MSI automation with JScript/VBScript support. + - Various MSHTML improvements. + - The usual assortment of Direct3D fixes. + - Support for a few more exe protection schemes. + - Lots of bug fixes. + + -- Stephan Hermann Sat, 12 May 2007 14:18:53 +0200 + +wine (0.9.36-0ubuntu2) gutsy; urgency=low + + * Removed debian/patches/* completly and updated debian/rules accordingly + Fixes were applied upstream + * Removed dpatch from build-deps + + -- Stephan Hermann Wed, 2 May 2007 10:08:23 +0200 + +wine (0.9.36-0ubuntu1) gutsy; urgency=low + + * New Upstream release + * Merged with winehq package again + * debian/control: + - Changed libstdc++-4.0-dev to libstdc++-4.2-dev + + -- Stephan Hermann Sun, 29 Apr 2007 14:49:53 +0200 + +wine (0.9.36~winehq0~ubuntu~7.04-1) feisty; urgency=low + + * Add missing build depends libesd0-dev libxrandr-dev liblcms1-dev + x11proto-xinerama-dev + * Should fix issues with screen scrolling, color management, multiple + monitors and esd + * Remove one of the duplicate build-depends libxt-dev + * Updated the list of debian split libwine-* packages this replaces + * New upstream release + - Midi support in the CoreAudio driver. + - Mixer support in the Alsa driver. + - A lot of MSI fixes. + - Implementation for most D3DRM functions. + - The usual assortment of Direct3D fixes. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 27 Apr 2007 11:34:05 -0700 + +wine (0.9.35-0ubuntu1) gutsy; urgency=low + + * New Upstream Version + * Added additional xrender.c patch to wine-0.9.35 + (http://www.winehq.org/pipermail/wine-devel/2007-April/055637.html) + + -- Stephan Hermann Sun, 15 Apr 2007 11:30:19 +0200 + +wine (0.9.35~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Broken aRts sound driver now removed for good. + - Many fixes to the Quartz DLL sound support. + - File I/O performance improvements. + - The usual assortment of Direct3D fixes. + - Lots of bug fixes. + * Removed no longer needed build-depends: libarts1-dev + + -- Scott Ritchie Fri, 13 Apr 2007 21:54:02 -0700 + +wine (0.9.34-0ubuntu1) feisty; urgency=low + + * New Upstream Release + + -- Stephan Hermann Fri, 6 Apr 2007 14:26:57 +0200 + +wine (0.9.34~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Support for Xcursor. + - A range of fixes for various installers. + - New builtin xcopy tool. + - The usual assortment of Direct3D fixes. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 30 Mar 2007 18:43:45 -0700 + +wine (0.9.33-0ubuntu1) feisty; urgency=low + + * New Upstream Release + - Many Direct3D fixes and performance improvements. + - More comctl32 tests and some bug fixes. + - Compatibility improvements in cmd.exe. + - Still more fixes to builtin OLE. + - Support for process control on Solaris. + - Lots of bug fixes. + + -- Stephan Hermann Mon, 19 Mar 2007 19:39:57 +0100 + +wine (0.9.32-0ubuntu1) feisty; urgency=low + + * New Upstream Release + - Remaining Ubuntu Changes: + * debian/wine.mime, debian/rules: stop MIME-based execution, drop + upstream .desktop file. + * debian/wine.prerm, debian/wine.postinst, debian/wine.binfmt, + debian/rules, debian/control: adding execution via binfmt-support + (LP: #85338). + * debian/control: dropped libjpeg-mmx-dev; no longer in archives. + * debian/wine-*.desktop: + - Added desktopfiles (Closes: LP #82776, #82778, #82778, #82779, + #82780, #82781) + * debian/control: + - added | libstdc++6-dev to build deps + * debian/rules: + - copy desktop files to the right position + - added dh_iconcache + + + -- Stephan Hermann Sat, 3 Mar 2007 18:08:28 +0100 + +wine (0.9.32~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Many Direct3D fixes and performance improvements. + - Several new features in the builtin cmd.exe. + - Improvements to HTML help support. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 2 Mar 2007 13:51:43 -0800 + +wine (0.9.31-0ubuntu1) feisty; urgency=low + + * New Upstream release + - Remaining Ubuntu Changes: + * debian/wine.mime, debian/rules: stop MIME-based execution, drop + upstream .desktop file. + * debian/wine.prerm, debian/wine.postinst, debian/wine.binfmt, + debian/rules, debian/control: adding execution via binfmt-support + (LP: #85338). + * debian/control: dropped libjpeg-mmx-dev; no longer in archives. + * debian/wine-*.desktop: + - Added desktopfiles (Closes: LP #82776, #82778, #82778, #82779, #82780, + #82781) + * debian/control: + - added | libstdc++6-dev to build deps + * debian/rules: + - copy desktop files to the right position + - added dh_iconcache + + -- Stephan Hermann Wed, 28 Feb 2007 14:08:56 +0100 + +wine (0.9.31~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Many Direct3D fixes and performance improvements. + - Several new comctl32 test cases. + - IDL compiler improvements. + - More OLE32 marshalling fixes. + - Lots of bug fixes. + * Removed build depend libxxf86dga-dev, depend libxxf86dga1 + + -- Scott Ritchie Fri, 16 Feb 2007 18:57:10 -0800 + +wine (0.9.30-0ubuntu4) feisty; urgency=low + + * debian/wine.mime, debian/rules: stop MIME-based execution, drop + upstream .desktop file. + * debian/wine.prerm, debian/wine.postinst, debian/wine.binfmt, + debian/rules, debian/control: adding execution via binfmt-support + (LP: #85338). + * debian/control: dropped libjpeg-mmx-dev; no longer in archives. + + -- Kees Cook Fri, 16 Feb 2007 11:17:03 -0800 + +wine (0.9.30-0ubuntu3) feisty; urgency=low + + * debian/wine-*.desktop: + - Added desktopfiles (Closes: LP #82776, #82778, #82778, #82779, #82780, + #82781) + * debian/control: + - added | libstdc++6-dev to build deps + * debian/rules: + - copy desktop files to the right position + - added dh_iconcache + + -- Stephan Hermann Thu, 8 Feb 2007 10:57:25 +0100 + +wine (0.9.30-0ubuntu2) feisty; urgency=low + + * debian/rules: + - Removed dpatch rules + + -- Stephan Hermann Fri, 26 Jan 2007 19:27:06 +0100 + +wine (0.9.30-0ubuntu1) feisty; urgency=low + + * New Upstream release + * What's new in this release: + - Many improvements to Direct3D shaders and state management. + - Support for inter-process memory allocations. + - OLE32 marshalling fixes. + - Lots of bug fixes. + * debian/control: + - Removed dpatch from build-deps + - Removed debian/patches/ directory, because all bugfixes are now in + upstream. + + -- Stephan Hermann Fri, 26 Jan 2007 17:45:43 +0100 + +wine (0.9.29-0ubuntu3) feisty; urgency=low + + * debian/control: introduced dpatch to build-deps + * added 01_ubuntu_mdi_c.dpatch (Closes: LP #81182) + + -- Stephan Hermann Thu, 25 Jan 2007 09:41:25 +0100 + +wine (0.9.29-0ubuntu2) feisty; urgency=low + + * debian/control: + - Added Suggest: xdg-utils (Closed: LP #80849) + + -- Stephan Hermann Tue, 23 Jan 2007 11:33:21 +0100 + +wine (0.9.29-0ubuntu1) feisty; urgency=low + + * New Upstream release + + -- Stephan Hermann Thu, 11 Jan 2007 13:30:36 +0100 + +wine (0.9.29~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - More work on the new Direct3D state management. + - Debugger support for Mac OS. + - Many OLE fixes and improvements. + - Audio input support on Mac OS. + - Lots of bug fixes. + + -- Scott Ritchie Tue, 9 Jan 2007 21:09:52 -0800 + +wine (0.9.28-0ubuntu1) feisty; urgency=low + + * New Upstream release + + -- Stephan Hermann Mon, 8 Jan 2007 13:33:11 +0100 + +wine (0.9.28~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - OpenGL in child windows should work again. + - Better mouse support in games. + - Beginnings of new state management in Direct3D. + - Improved audio and font support on Mac OS. + - Lots of bug fixes. + + -- Scott Ritchie Sat, 23 Dec 2006 21:48:25 -0800 + +wine (0.9.27-0ubuntu1) feisty; urgency=low + + * New Upstream Release + + -- Stephan Hermann Wed, 13 Dec 2006 13:30:08 +0100 + +wine (0.9.27~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Better support for noexec kernels. + - Better Dwarf support in dbghelp. + - Several Winsock fixes. + - Various code cleanups. + - Lots of bug fixes. + + -- Scott Ritchie Sat, 9 Dec 2006 16:32:53 -0800 + +wine (0.9.26-0ubuntu1) feisty; urgency=low + + * New Upstream Release + + -- Stephan Hermann Thu, 30 Nov 2006 11:01:59 +0100 + + +wine (0.9.26~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Better support for Unix locale settings. + - Improved X11 keyboard support. + - Various MSI fixes. + - Winecfg improvements. + - Lots of bug fixes. + + -- Scott Ritchie Mon, 27 Nov 2006 23:25:44 -0800 + +wine (0.9.25-0ubuntu1) feisty; urgency=low + + * New Upstream release + * debian/control: + - Changed build-deps + + linux-kernel-headers => linux-libc-dev + + libfontconfig-dev => libfontconfig1-dev + + -- Stephan Hermann Fri, 24 Nov 2006 10:05:00 +0100 + +wine (0.9.25~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Many more fixes for installer support. + - Many MSHTML improvements. + - Support for NTLMv2. + - RPC over TCP improvements. + - Lots of bug fixes. + + -- Scott Ritchie Sat, 11 Nov 2006 17:33:14 -0800 + +wine (0.9.24~winehq0~ubuntu~6.10-1) edgy; urgency=low + + * New upstream release + - Support for multiple monitors using Xinerama. + - Various MSI fixes and improvements. + - A ton of memory leaks fixed. + - Many common controls fixes. + - Lots of bug fixes. + + -- Scott Ritchie Sun, 29 Oct 2006 17:12:35 -0800 + +wine (0.9.22-0ubuntu4) feisty; urgency=low + + * Rebuild for ldbl128 change on powerpc and sparc. + + -- Matthias Klose Thu, 2 Nov 2006 10:27:26 +0000 + + +wine (0.9.22-0ubuntu3) edgy; urgency=low + + * Re-apply dropped change from dapper: (Closes: Ubuntu #63492) + + Remove insecure mailcap entries; MS Windows '.exe' files should be run + using 'binfmt-misc' support instead. (Closes: Ubuntu #24829) + + -- Paul Sladen Fri, 13 Oct 2006 02:15:26 +0100 + +wine (0.9.22-0ubuntu2) edgy; urgency=low + + * Fixed diff.gz + + -- Stephan Hermann Wed, 11 Oct 2006 14:03:46 +0200 + +wine (0.9.22-0ubuntu1) edgy; urgency=low + + * New Upstream Release + - The usual assortment of MSI improvements. + - Several bug fixes to the various common controls. + - Pixel shaders enabled by default in D3D. + - Various improvements to the build process. + - Many translation updates. + - Lots of bug fixes. + + Thx Scott Ritchie + * debian/control: + - added build-deps libhal-dev, libhal-storage-dev, libgphoto2-2-dev + + -- Stephan Hermann Fri, 6 Oct 2006 15:49:27 +0200 + +wine (0.9.21-0ubuntu1) edgy; urgency=low + + * New upstream version + * Changelog from Upstream: + - OpenGL restructurations. + - The usual assortment of MSI improvements. + - Several Richedit fixes. + - WCMD Winelib app renamed to CMD for compatibility. + - Many improvements to the Wintrust DLL. + - Some code cleanups. + - Lots of bug fixes. + + -- Stephan Hermann Thu, 14 Sep 2006 14:39:06 +0200 + +wine (0.9.20-0ubuntu3) edgy; urgency=low + + * debian/rules: changed x86_64 to amd64 to provide amd64 packages + + -- Stephan Hermann Tue, 12 Sep 2006 12:42:46 +0200 + +wine (0.9.20-0ubuntu2) edgy; urgency=low + + * debian/rules: changed ARCH = $(DEB_BUILD_ARCH) to + ARCH += $(DEB_BUILD_ARCH) (trying to fix amd64 build) + + -- Stephan Hermann Mon, 11 Sep 2006 15:20:47 +0200 + +wine (0.9.20-0ubuntu1) edgy; urgency=low + + * New WineHQ Release + * debian/rules: + - added to CFLAGS -fno-stack-protector + - added some code to build wine on x86_64 archs + * debian/control: + - Removed libjack0.80.0-dev from build-deps + + -- Stephan Hermann Wed, 30 Aug 2006 12:47:41 +0200 + +wine (0.9.20~winehq0~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - XEmbed system tray support. + - Many improvements to NTLM support. + - Many messages made localizable instead of hardcoded to English. + - Improved support for various OpenGL platforms. + - More improvements to the IDL compiler. + - Lots of bug fixes. + + -- Scott Ritchie Thu, 24 Aug 2006 16:06:35 -0700 + +wine (0.9.19~winehq0~ubuntu~6.06-2) unstable; urgency=low + + * Added my own patch to make Full Tilt Poker work + + -- Scott Ritchie Fri, 11 Aug 2006 00:19:57 -0700 +wine (0.9.19-0ubuntu3) edgy; urgency=low + + * debian/rules: Added -fno-stack-protector to CFLAGS to fix segmentation + faults (Closes: lp #56965) + + -- Stephan Hermann Wed, 23 Aug 2006 13:15:31 +0200 + +wine (0.9.19-0ubuntu2) edgy; urgency=low + + * debian/rules: Fix rules file to determina $DEB_BUILD_ARCH and build wine + for 64bit + + -- Stephan Hermann Sun, 20 Aug 2006 10:19:05 +0200 + +wine (0.9.19-0ubuntu1) edgy; urgency=low + + * New upstream version + * debian/control: + - Removed libicu28-dev,libjack0.80.0-dev from build-dep + + -- Stephan Hermann Sat, 19 Aug 2006 23:14:28 +0200 + +wine (0.9.19~winehq0~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - Support for a proper Trash folder. + - Many improvements to the IDL compiler. + - Better FreeBSD support. + - A number of MSI bug fixes. + - Many RichEdit improvements. + + -- Scott Ritchie Thu, 10 Aug 2006 23:20:48 -0700 + +wine (0.9.18~winehq0~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - Still more work on Direct3D. + - A lot of MSI bug fixes and improvements. + - More compatible memory management. + - Several fixes for Win64 support. + - Some performance improvements. + + -- Scott Ritchie Sat, 29 Jul 2006 20:34:02 -0700 + +wine (0.9.17~winehq0~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - Still more work on Direct3D shaders. + - Now using the Gecko engine directly for MSHTML. + - Better support for apps switching to full screen mode. + - Support for multiple joysticks. + + -- Scott Ritchie Wed, 12 Jul 2006 21:36:19 -0700 + +wine (0.9.16~winehq0~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - More work on Direct3D shaders. + - Major DirectDraw rewrite on top of Direct3D. + - Support for debug information in Dwarf format. + - Beginnings of an OleView Winelib application. + - Lots of bug fixes. + + -- Scott Ritchie Thu, 22 Jun 2006 00:44:54 -0700 + +wine (0.9.15~winehq0~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - More MS/RPC improvements. + - Core Audio driver for Mac OS X. + - More complete DNSAPI dll. + - Improvements to Web browser support. + - Lots of bug fixes. + + -- Scott Ritchie Thu, 8 Jun 2006 16:30:06 -0700 + +wine (0.9.14~winehq1~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - Better MS/RPC compatibility. + - Many fixes to Direct3D shaders. + - Several improvements to the header control. + - Lots of bug fixes. + * Added libgl-dev, libicu-dev, libjack-dev, freeglut-dev virtual packages as + options in build-depends + * Added ${shlibs:Depends} to depends + + -- Scott Ritchie Sun, 28 May 2006 21:26:30 -0700 + +wine (0.9.13~winehq1~ubuntu~6.06-1) unstable; urgency=low + + * New upstream release + - New GPhoto backend for TWAIN. + - Dynamic drive configuration using HAL. + - A gazillion Direct3D fixes. + - New TCP transport for RPC. + - Lots of bug fixes. + + -- Scott Ritchie Sat, 13 May 2006 02:16:47 -0700 + +wine (0.9.12~winehq2~ubuntu~6.06-1) unstable; urgency=low + + * Changed libicu28-dev to libicu34-dev + * Package is now separate from the Breezy version + * This is the first package to enter the winehq dapper repo + + -- Scott Ritchie Thu, 4 May 2006 01:04:44 -0700 + +wine (0.9.12~winehq1-1) unstable; urgency=low + + * New upstream release + - New Winelib Internet Explorer application (all 5 lines of it). + - Several improvements to the font support. + - More work on the IDL compiler. + - Faster drawing of the cards in Solitaire (very important feature). + - A number of fixes for issues found by the Coverity code cheker. + + -- Scott Ritchie Mon, 17 Apr 2006 01:17:15 -0700 + +wine (0.9.11~winehq1-1) unstable; urgency=low + + * New upstream release + - Fake dll files created in the system directory to help installers. + - Desktop mode now properly supports multiple processes. + - Better type parsing in dbghelp. + - Several OpenGL fixes. + - A bunch of Unicode functions in advpack. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 31 Mar 2006 15:18:06 -0800 + +wine (0.9.10~winehq1-2) unstable; urgency=low + + * Added new build depends, libglut3-dev | freeglut3-dev + + -- Scott Ritchie Mon, 20 Mar 2006 10:15:13 -0800 + +wine (0.9.10~winehq1-1) unstable; urgency=low + + * New upstream release + - Improved ESD audio driver. + - More Web browser improvements in mshtml and wininet. + - Direct3D fixes and preparation for ddraw code migration. + - Explorer process now managing the desktop window. + - Lots of bug fixes. + * New naming scheme uses ~winehq1 at end of version name. This should make Dapper packages replace. + + -- Scott Ritchie Wed, 15 Mar 2006 23:04:54 -0800 + +wine (0.9.9-winehq-2) unstable; urgency=low + + * Adjusted build depends to make compatible with Dapper by allowing different packages + - libjack0.80.0-dev | libjack0.100.0-dev + - libicu28-dev | libicu34-dev + * Next release will use newer version numbering system to make Dapper have higher numbers (-00winehq) + + -- Scott Ritchie Sun, 12 Mar 2006 12:41:39 -0800 + +wine (0.9.9-winehq-1) unstable; urgency=low + + * New upstream release + - Many new features and improvements in Richedit. + - More Web browser support. + - Recursive directory change notifications. + - Wine installation is now fully relocatable. + - Direct3D 8 and 9 now use the same code. + - Many debugger improvements. + - Systray is now handled by the explorer process. + - Lots of bug fixes. + + -- Scott Ritchie Fri, 3 Mar 2006 18:05:17 -0800 + +wine (0.9.8-winehq-1) unstable; urgency=low + + * New upstream release + - Better Web browser support. + - Beginnings of a Wordpad application. + - Many richedit improvements. + - A number of Direct3D fixes. + - A few more options in winecfg. + - Lots of bug fixes. + + -- Scott Ritchie Wed, 15 Feb 2006 21:45:23 -0800 + +wine (0.9.7-winehq-1) unstable; urgency=low + + * New upstream release + - Directory change notifications can use inotify now. + - Hardware breakpoints in the Wine debugger. + - Beginnings of support for tape APIs. + - A bunch of improvements to the IDL compiler. + - Better scheme for mapping My Documents etc. to Unix directories. + - Lots of bug fixes. + * The BUGS textfile is gone, and is now removed from the docs file + -- Scott Ritchie Thu, 2 Feb 2006 18:01:46 -0800 + +wine (0.9.6-winehq-1) unstable; urgency=high + + * New upstream release + - A bunch of OLE fixes and improvements. + - DirectSound improvements, including full duplex support. + - Fix for the Windows metafile vulnerability. + - Many static control improvements. + - Some fixes for copy protection support. + - Lots of bug fixes. + * Package now replaces libwine-gl properly + -- Scott Ritchie Thu, 19 Jan 2006 22:01:04 -0800 + +wine (0.9.5-winehq-1) unstable; urgency=low + + * New upstream release + - A number of MSI fixes. + - More improvements to the IDL compiler. + - Lots of bug fixes. + -- Scott Ritchie Wed, 4 Jan 2006 08:34:21 -0800 + +wine (0.9.4-winehq-1) unstable; urgency=low + + * New upstream release + - Improvements to the IDL compiler. + - Some infrastructure work for loadable driver support. + - The usual assortment of Direct3D improvements. + - IME support in the edit control. + - Better support for AVI animations. + - Debugging support improvements. + - Relay traces now work on NX platforms. + + -- Scott Ritchie Thu, 29 Dec 2005 18:44:00 -0800 + +wine (0.9.3-winehq-1) unstable; urgency=low + + * New upstream release + - Many marshalling fixes in rpcrt4. + - Various OLE improvements and fixes. + - Better audio driver management in winecfg. + - Many wininet fixes. + - Several Web browser improvements. + - More dbghelp APIs implemented. + - Directory objects in wineserver. + - Lots of bug fixes. + * Add new build depends: prelink, libsane-dev, libsane-extras-dev. + * Remove build-dependency valgrind. Doesn't have any use in a binary package. + * The above two should make some things faster and scanners work. + + -- Scott Ritchie Thu, 8 Dec 2005 21:49:54 -0800 + +wine (0.9.2-winehq-1) unstable; urgency=low + + * New upstream release + - Winelib Explorer app (just a wrapper around winefile for now). + - Debugger cleanups and improvements. + - Many wininet fixes. + - Better autogenerated API manpages. + - A bunch of Korean translations. + - Lots of bug fixes. + * Added missing build depends: libxt-dev + + -- Scott Ritchie Mon, 28 Nov 2005 18:10:51 -0800 + +wine (0.9.1-winehq-3) unstable; urgency=low + + * Added a dependency on libxxf86dga1, since it is now required. + In the future, I may make a Wine package without X at all, but + when X is compiled in we need to have it as a dependency here. + + -- Scott Ritchie Sat, 12 Nov 2005 11:52:17 -0800 + +wine (0.9.1-winehq-2) unstable; urgency=low + + * Added some missing build-depends: libldap2-dev, libxml2-dev, + libxslt1-dev, valgrind, libxxf86vm-dev, libxxf86dga-dev + * Replaced build dependency mesa-common-dev with the package that + replaces it, libgl1-mesa-dev + -- Scott Ritchie Thu, 10 Nov 2005 23:02:55 -0800 + +wine (0.9.1-winehq-1) unstable; urgency=low + + * New upstream release + - Support for Find function in regedit. + - Winelib app to eject a CD. + - Many MSI improvements. + - Better support for running text-mode apps without X. + - Improved support for various code obfuscation tools. + + -- Scott Ritchie Thu, 10 Nov 2005 12:52:27 -0800 + +wine (0.9.0-winehq-2) unstable; urgency=low + + * Wine now depends on libstc++6 + * Added missing build-depend libstdc++6-4.0-dev + * Since Mono no longer attempts to use Wine, libwine-cil is added to + conflicts and replaces section like the other legacy libwine-* packages + * xwine is also added to the replaces and conflicts section, since it + does nothing just like winesetuptk. + + -- Scott Ritchie Tue, 1 Nov 2005 15:04:32 -0800 + +wine (0.9.0-winehq-1) unstable; urgency=low + + * MASSIVE New upstream release + - This is Wine's first beta release, meaning things + are going to be a lot more stable, and further + regressions in numbered versions shouldn't happen. + - Too many changes to list. + + -- Scott Ritchie Tue, 25 Oct 2005 12:14:34 -0700 + +wine (0.0.20050725-winehq-1) unstable; urgency=low + + * Actually two new upstream releases in this one - I skipped the last due to + all the config file weirdness. + * New upstream release (older one): + - Configuration settings moved to the registry. + - Graphical Wine configuration tool is now enabled. + - More MSI and OLE improvements. + - Reorganisation of the DirectDraw directory. + - Initial support for webcams. + - Lots of bug fixes. + * New upstream release (newer one): + - Beginnings of theme support in common controls. + - Many MSHTML improvements. + - A bunch of OLE fixes for InstallShield installers. + - Many Direct3D fixes and improvements. + - Beginnings of LDAP support. + - Various cleanups after removal of the config file. + - Lots of bug fixes. + + -- Scott Ritchie Thu, 28 Jul 2005 11:58:28 -0700 + +wine (0.0.20050524-winehq-1) unstable; urgency=low + + * New upstream release + - Many MSI improvements. + - More features in the file manager. + - Better compatibility for Winelib import libraries. + - SGML documentation moved out of the source tree. + - Header files cleanups. + - Lots of bug fixes. + * Documentation files have been moved into a seperate package due to upstream + changes + + -- Scott Ritchie Tue, 31 May 2005 20:09:53 -0700 + +wine (0.0.20050419-winehq-1) unstable; urgency=low + + * New upstream release + - Mailslot support. + - Support for side mouse buttons (X buttons). + - More Richedit improvements. + - Loading of Windows registry files disabled for now. + - Many code cleanups. + - Lots of bug fixes. + * Now use winehq version numbering (-winehq) to not create weirdness with + other packages at same version number + + -- Scott Ritchie Sun, 8 May 2005 15:21:46 -0700 + +wine (0.0.20050310-1) unstable; urgency=low + + * New upstream release + - Initial implementation of a true Richedit control. + - Shell extension for browsing Unix directories. + - More MSI work. + - PBuffer support in OpenGL. + - Window painting regressions should be fixed. + - Lots of bug fixes + + -- Scott Ritchie Fri, 11 Mar 2005 00:11:06 -0800 + +wine (0.0.20050211-1) unstable; urgency=low + + * New upstream release + - Still more work on the MSI dll. + - More OLE work, including a builtin stdole32.tlb. + - Fixed inter-process window resize and repaint. + - Lots of bug fixes. + * Changed dummy packages to architecture "all", set rules file's + dh_installchangelog to only do architecture dependant ones. This should + keep the changelog out of the dummy packages, making them a good meg smaller + * Added MIME types application/x-msdownload, application/exe, + application/x-exe, application/dos-exe, vms/exe, application/x-winexe, + application/msdos-windows, application/x-msdos-program, + and application/x-zip-compressed + + -- Scott Ritchie Fri, 11 Feb 2005 23:19:14 -0800 + +wine (0.0.20050111-1) unstable; urgency=low + + * New upstream release + - Many OLE bug fixes and improvements. + - A lot more work on the MSI dll. + - Update regions now handled in the Wine server. + - Beginnings of typelib generation in the IDL compiler. + - Many janitorial cleanups. + - Lots of bug fixes. + + -- Scott Ritchie Tue, 11 Jan 2005 12:32:08 -0800 + +wine (0.0.20041201-1) unstable; urgency=high + + * New maintainer Scott Ritchie + * New Upstream release 20041201 + -Many changes since last package, most notably setup is much simpler and no + longer requires special tools or configuration files. + * Removed deprecated winesetuptk and wine-utils. + * Removed deprecated libwine-* packages, which are now merged into wine. + -Wine's binaries were required for running winelib compiled packages anyway + * Changed libwine-dev to wine-dev, all proper development files should now + be there (everything from /usr/include and the library symlinks). + * Merged libwine into wine upon advice from upstream authors, as all binaries + in wine were required by winelib compiled packages anyway. This package + should now replace everything wine related that is older. + * Added dummy packages libwine (which depends on wine) and libwine-dev (which + depends on wine-dev) in order to ease upgrade from older versions. + * Removed old Debian hacks into the source code - the source code should be + the standard winehq.org source now. + * Changed the package format to a more standard one - as wine was changed + upstream to be built more consistantly now, and a separate wine-docs package + is no longer needed. + -Wine docs such as the user guide are now in /usr/share/doc/wine along with + the rest of the documentation. + -Wine development docs such as the winelib user guide are now in + /usr/share/doc/wine-dev + * Updated build depends due to upstream changes + * Upstream wineprefixcreate program now removes the need for the package + maintainer to create special directories and configuration + * Many old bugs should be gone due to above changes + * Upgraded to new standards version of Debian Policy (also removing manual + prompting code that took place in preinstall script.) + + -- Scott Ritchie Mon, 22 Nov 2004 20:30:57 -0800 + +wine (0.0.20040716-1.3) unstable; urgency=high + + * NMU. + * Build against changed libcapi20 API. + + -- Matthias Klose Wed, 10 Nov 2004 19:21:13 +0100 + +wine (0.0.20040716-1.2) unstable; urgency=low + + * NMU. + * Change libcapi20 build dependency to libcapi20-dev. + + -- Matthias Klose Sat, 4 Sep 2004 10:16:31 +0200 + +wine (0.0.20040716-1.1) unstable; urgency=high + + * NMU. + * Fix libcapi build dependency (closes: #267536). + + -- Matthias Klose Sat, 28 Aug 2004 02:04:55 +0200 + +wine (0.0.20040716-1) unstable; urgency=low + + * New upstream release 20040716 (closes: #261547) + - Implementation of the Microsoft Installer dll. + - Beginnings of proper inter-process window repaints. + - Several DirectSound improvements. + - Fixes for the regressions caused by the new filesystem support. + - Lots of bug fixes. + * Applied winelauncher patch from Kevin Shanahan which allows + each $WINEPREFIX to have its own flag files to disable + prelaunch and debug windows. + * Remove binfmt-support-specific doubledash hack from winelauncher, + it's apparently no longer needed (nor does it work anymore). + Closes: #261855. + * Added Turkish debconf translation. Closes: #252942. + + -- Ove Kaaven Sat, 14 Aug 2004 17:11:52 +0200 + +wine (0.0.20040615-1) unstable; urgency=low + + * New upstream release 20040615 + - Major winedbg rewrite using the dbghelp dll. + - New Wine preloader to reserve memory areas at startup. + - Many improvements to the audio support. + - Lots of bug fixes. + * Acknowledge NMU (closes: #251107), which although imperfectly + executed, was well meant. + * Install wine-preloader into libwine. + * Add GLUT to build dependencies. Closes: #253715. + * Remove mention of unmaintained daily CVS builds from README.Debian. + Closes: #252370. + * Mention wineprefixcreate in README.Debian. + * Change default winebrowser registry key to "sensible-browser" instead + of a hardcoded list of common browsers. Closes: #249583. + This may not change existing installations, it may be necessary for + you to change the registry entry yourself on existing installations. + I've mentioned how to do this in README.Debian. + (It may be possible to make winebrowser ignore the registry entry + entirely and hardcode it to always use sensible-browser, but I + am not sure if that's a good idea.) + + -- Ove Kaaven Thu, 17 Jun 2004 08:22:56 +0200 + +wine (0.0.20040505-2) unstable; urgency=low + + * NMU. + * Rebuild against libcupsys2-gnutls10 (fixed: Bug#251107) + + -- Kenshi Muto Sun, 13 Jun 2004 03:45:00 +0000 + +wine (0.0.20040505-1) unstable; urgency=low + + * New upstream release 20040505 (Closes: #248554) + - Many more filesystem improvements, including autodetection + of drive types and devices, and support for editing the drive + configuration with winecfg. + - Many Direct3D improvements. + - Several fixes to the various sound drivers. + - Lots of bug fixes. + + -- Ove Kaaven Wed, 12 May 2004 02:04:29 +0200 + +wine (0.0.20040408-1) unstable; urgency=low + + * New upstream release 20040408 (Closes: #245679) + - DOS devices and drives are now configured through symlinks. + - Many shell32 improvements. + - New task manager merged from ReactOS. + - First version of wineprefixcreate tool for initial setup. + - Lots of bug fixes. + * Redirect errors from final "kill" command in winelauncher to + /dev/null, since any failures there should be harmless. + Closes: #238065. + * Install taskmgr into wine-utils. + * Set ICUUC_LIB and ICUDATA_LIB variables for configure, + needed to compile this Wine release against the old ICU + version in Debian, as instructed by Shachar Shemesh. + * Adapted skeleton wine configuration in /usr/share/wine/skel + to contain DOS device and drive symlinks. For existing + installs, it seems wine will convert the old config to the + new symlink-based scheme automatically, for a limited + transition period. But I thought it best to update the + packaging now anyway, to make sure I got it right before + it's too late. + * Install wineprefixcreate into wine. This seems to be + an alternative to copying /usr/share/wine/skel into ~/.wine. + * Added Danish debconf translation. Closes: #234064. + + -- Ove Kaaven Tue, 20 Apr 2004 15:14:11 +0200 + +wine (0.0.20040309-1) unstable; urgency=low + + * New upstream release 20040309 + - Much improved winegcc tool, now used to build Wine itself. + - VxDs are now separate libraries for better modularity. + - Improvements and simplifications to the drive configuration. + - New setupapi INF script to create the initial registry. + - Many improvements to the various multimedia dlls. + - Lots of bug fixes. + * Moved skeleton wine configuration from /usr/share/wine to + /usr/share/wine/skel. Updated README.Debian to reflect this. + * Install patched tools/wineinstall into /usr/share/wine. + If the script happens to work, it might be better to use it + than copying the /usr/share/wine/skel into ~/.wine, since + it would also be able to upgrade an old installation, and + has more tweaks, but I haven't tested this script much lately. + * Moved wineconf from /usr/lib/wine to /usr/share/wine. + * Install generic.ppd and wine.inf in /usr/share/wine. + * There's no longer a winedefault.reg. Everything is handled by + wine.inf. Added explanation on how to use wine.inf to + README.Debian. + * Create program symlinks manually in debian/rules instead of + using dh_link, since these symlinks must be absolute, otherwise + they won't work when "cp -r"-ed into ~/.wine. Closes: #235406. + * Try to make winelauncher look for an existing config file + in $WINEPREFIX (before complaining that you have to run + winesetup). Closes: #235405. + * There's now a man page for widl. + * There's now a man page for winebuild. Closes: #114673. + * Update libwine-* package list in README.Debian. + + -- Ove Kaaven Wed, 10 Mar 2004 22:10:06 +0100 + +wine (0.0.20040213-1) unstable; urgency=low + + * New upstream release 20040213 + - Improved support for screen resolution changes. + - More shell32 improvements. + - Several Winelib compatibility fixes. + - Beginnings of support for typelib creation. + - Lots of bug fixes. + * Moved wine.bin, wine-[kp]thread and wineserver from wine to libwine, + since these are going to be needed for Winelib programs too. + * Added winebrowser and expand to the wine package. + * Added libfontconfig1-dev, libssl-dev, and libcapi20-2 to + Build-Depends. + * Added new package libwine-capi to contain the capi20 module. + + -- Ove Kaaven Tue, 24 Feb 2004 14:09:34 +0100 + +wine (0.0.20040121-2) unstable; urgency=high + + * Urgency high since this should hit testing as + soon as possible (both to help jack migration, and + to supersede the currently NPTL-incompatible version + in testing). + * Fixed debian/rules to also make libwine-jack depend + on libjack0.80.0-0. Sorry for the mistake. + * Put dlls/twain/README into the libwine-twain package. + Closes: #224941. + + -- Ove Kaaven Tue, 27 Jan 2004 18:46:48 +0100 + +wine (0.0.20040121-1) unstable; urgency=low + + * New upstream release 20040121 + - Many improvements in the shell32 dll. + - Better support for constructors in C++ Winelib apps. + - Improved Regedit tool. + - Full support for graphic tablets. + - Lots of DirectMusic improvements. + - Better support for video playback. + - Full IME support for Asian locales. + - Lots of bug fixes. + * The exec shield workaround was also disabled again upstream + "because it caused too much trouble". Perhaps #224837 was + some of that trouble. Need verification. + * Build-Depend on libjack0.80.0-dev instead of libjack0.71.2-dev. + Closes: #228786. + + -- Ove Kaaven Thu, 22 Jan 2004 05:08:49 +0100 + +wine (0.0.20031212-1) unstable; urgency=low + + * New upstream release 20031212 + - Initial implementation of XDND drag&drop support. + - Improved startup performance on remote displays. + - Major improvements in the oleaut32 dll. + - Some support for Netbios functions. + - Work around for Exec Shield and prelinking troubles. + - Many code cleanups. + - Lots of bug fixes. + * It seems regapi is no more, have to remove it from the + packages. (A man page for it is not needed anymore then, + which closes #83261) + * The tool regedit supersedes it, so I'm using that now to + build the skeleton configuration in /usr/share/wine. I + patched regedit to accept input from stdin if a filename + of "-" is given, so input can still be zcat-ed to it. + * Updated README.Debian for regedit instead of regapi, and + mention that regedit is in wine-utils (still). + + -- Ove Kaaven Sat, 20 Dec 2003 05:41:29 +0100 + +wine (0.0.20031118-1) unstable; urgency=low + + * New upstream release 20031118 (closes: #211906) + - Many printing improvements. + - Run-time detection of NPTL threading. (closes: #218476) + - Lots of code merges from Crossover Office 2.1. + - Some reorganization of the source tree. + - Lots of bug fixes. + * Install wine.bin-kthread and wine.bin-pthread binaries into + /usr/bin to allow the threading autoselection to work. + * The DNS lookup issues is also claimed to have been fixed now, + probably because of the NPTL detection. Closes: #214252. + * Added winecpp to libwine-dev. + + -- Ove Kaaven Wed, 17 Dec 2003 03:14:12 +0100 + +wine (0.0.20031016-1) unstable; urgency=low + + * New upstream release 20031016 + - Support for the Xrandr extension. + - Dll separation of kernel and ntdll is finished. + - Many enhanced metafile improvements. + - Lots of bug fixes. + * DocBook DSSSL stylesheets are apparently no longer included in the + upstream source. However, they have one available separately + (in the "tools" module of CVS), so I put it into the debian/ + directory and let the debian/rules file generate the documentation + itself (without using upstream makefile) using that stylesheet. + I also chose to continue to build each book as many small HTML + files instead of as one big HTML file, since that's the "tried and + true" way, or something. + * Some old plaintext documentation has also been removed upstream, + they've been removed from the packaging too. + * Added HURD and FreeBSD to architecture fields, as requested. + Closes: #222227. + + -- Ove Kaaven Sun, 30 Nov 2003 17:36:44 +0100 + +wine (0.0.20030911-1) unstable; urgency=low + + * New upstream release 20030911 + - Many improvements to the winecfg configuration tool. + - Massive header files cleanup for better source compatibility. + - Some more progress on the kernel/ntdll separation. + - Lots of bug fixes. + (Yes, newer upstream releases exist, I plan to upload each of + them with a few days in between to allow them to be archived + on snapshot.debian.net) + * Install rpcss, rundll32, start, winemenubuilder into libwine. + * Install *.def files into libwine-dev. + * Build-depend on libicu-dev, so that support for non-Western + languages gets compiled in. Suggest libicu21c102 for libwine. + * Added missing "]" in winedefault.reg. Closes: #218612. + * Fixed doc-base (it apparently got broken after the wine-doc + changes). Closes: #215393. + * Fixed dash compatibility of winelauncher. Closes: #219624. + * Noted that daily builds haven't been working lately + in README.Debian. Closes: #213729. + * Tried to fix configure to detect current freetype. + * Started rewriting the build system a little bit to make it + possible to make winelauncher configure Wine automatically + without winesetup's help. This is not finished yet, though, + and since I'm far behind on Wine releases now, I think I'll + do it later. Still, I did get around to po-debconfify the + still unused debconf templates (closes: #203286), and put + a skeleton per-user no-Windows configuration into + /usr/share/wine that it's possible to copy into ~/.wine for + those who want to do so. + * Updated README.Debian to reflect (some of) the above. + * /var/lib/wine/drivec is no longer in the package. + + -- Ove Kaaven Fri, 28 Nov 2003 13:28:20 +0100 + +wine (0.0.20030813-2) unstable; urgency=low + + * Pthread changes in current glibc CVS caused Wine to not work. + This has to be fixed both Wine-side and glibc-side. This upload + fixes it on the Wine side by applying a patch from WineHQ CVS + for this. Closes: #210300. + (The glibc side is bug #210347, which must also be fixed before + Wine runs again, sorry.) + + -- Ove Kaaven Thu, 11 Sep 2003 14:16:33 +0200 + +wine (0.0.20030813-1) unstable; urgency=low + + * New upstream release 20030813 + - Partial implementation of the Microsoft Installer (msi.dll). + - GUI for regedit (from ReactOS). + - DirectMusic dlls reorganization. + - Many Wininet improvements. + - Lots of bug fixes. + + -- Ove Kaaven Wed, 20 Aug 2003 19:29:44 +0200 + +wine (0.0.20030709-3) unstable; urgency=low + + * Place winspool.drv into libwine, not libwine-print, so that programs + that link to it don't need libwine-print. Closes: #202050. + * Remove stale libwine.so and libwine_unicode.so symlinks + in preinst. Closes: #202116. + * Build-depend on libjack0.71.2-dev instead of libjack0.50.0-dev. + I am not sure that this jack version will work with Wine, but since + 0.50.0 is apparently no longer in unstable, I guess I have no choice. + Closes: #202237. + * Changed wine-doc build rules a bit to be more in line with upstream + documentation layout. This will change the directory layout in the + wine-doc package, you may have to adjust your bookmarks. Closes: #202310. + * Added winecfg program to wine-utils. + * Updated Standards-Version to 3.6.0, rearranged debian/rules file + a bit to have a separate binary-indep rule for building wine-doc. + * Corrected sections in control file (finally). + + -- Ove Kaaven Mon, 21 Jul 2003 16:18:16 +0200 + +wine (0.0.20030709-2) unstable; urgency=low + + * Fixed shlibs so we don't depend on nvidia-glx. Closes: #201257, #201300. + * Found out that wine was never ported to alpha after all (the alpha + references in the win32 headers must be from NT or something, there's + apparently no actual code in Wine for alpha), so I removed that again. + Now only i386, powerpc, and sparc remain. + + -- Ove Kaaven Tue, 15 Jul 2003 10:05:32 +0200 + +wine (0.0.20030709-1) unstable; urgency=low + + * New upstream release 20030709 + - Still more Direct3D and DirectSound improvements. + - Inter-process clipboard support. + - Locale handling improvements. + - More progress on the kernel/ntdll separation. + - Lots of bug fixes. + * Added powerpc, sparc, and alpha to architectures, let's see + if the packages actually build on those... + + -- Ove Kaaven Mon, 14 Jul 2003 15:13:27 +0200 + +wine (0.0.20030618-1) unstable; urgency=low + + * New upstream release 20030618 (closes: #198646) + - Still more Direct3D and DirectSound improvements. + - Tons of fixes merged from Crossover Office 2.0. + - New iphlpapi dll. + - Lots of bug fixes. + * There's supposed to be a fix for Lotus Notes in this release. + Closes: #196156, #196938. + * Build-depend on libartsc0-dev (yeah, finally someone told me). + Closes: #197255. + * Build-depend on libjpeg62-dev | libjpeg-dev instead of just + libjpeg-dev. Closes: #196136. + + -- Ove Kaaven Tue, 24 Jun 2003 21:52:30 +0200 + +wine (0.0.20030508-2) unstable; urgency=low + + * Added winevdm.exe.so to the wine package (no, not wine-utils). + Closes: #195950, #196013. + * Make it possible to build from source with libjack0.71.2. However, + I'm not convinced that the code might work with a new jack version, + so I'll still be compiling against the older version myself. + Closes: #196014. + * Since people keep complaining about libwine-arts depending on arts + 4:2.2.2, without telling me what's wrong with that, I now + depend on arts 1.1.2, clearly an even older arts, but if they can't + tell me what they want me to do, I'll teach'em to. Closes: #195518. + + -- Ove Kaaven Wed, 4 Jun 2003 07:26:12 +0200 + +wine (0.0.20030508-1) unstable; urgency=low + + * New upstream release 20030508 (closes: #192873) + - Some more reorganizations of the source tree. + - A few more steps towards kernel/ntdll separation. + - Many Direct3D improvements. + - More compatible COM interfaces definitions. + - Lots of bug fixes. + * Build-depend on flex-old | flex (<< 2.5.31) + + -- Ove Kaaven Mon, 2 Jun 2003 04:40:08 +0200 + +wine (0.0.20030408-1) unstable; urgency=low + + * Long overdue Wine updates for Debian + (Closes: #181499, #183854). + Wonder if I should RFA. + * New upstream release 20030408 + - Some reorganizations of the source tree. + - File change notifications. + - Support for all variants of glibc 2.3. + - Many documentation updates. + - Lots of bug fixes. + * New upstream release 20030318 + - Many Direct Sound improvements. + - File locking support. + - Progress on kernel/ntdll dll separation. + - Lots of bug fixes. + * New upstream release 20030219 (Closes: #183854) + - Better dead keys support. + - Many debugger fixes. + - More Direct3D work. + - Lots of bug fixes. + * Fixed winelauncher bashism (Closes: #178986) + * Created libwine-jack package. + * Changed build dependencies (added glu, ungif and jack). + They're no longer compatible with potato. + + -- Ove Kaaven Thu, 17 Apr 2003 14:55:30 +0200 + +wine (0.0.20030115-2) unstable; urgency=low + + * Added workaround for the broken docbook-utils in woody + in debian/rules. Closes: #172082. + * Hopefully less winelauncher failures in case of Ctrl-C. + Closes: #176615. + * Automatically add "--" if launched as wine-auto, and + make binfmt-support launch that. Closes: #178521. + + -- Ove Kaaven Mon, 27 Jan 2003 18:18:26 +0100 + +wine (0.0.20030115-1) unstable; urgency=low + + * New upstream release 20030115 + - Much better header files compatibility in Winelib. + - A ton of Direct3D work. + - Many improvements in sound support. + - New wineboot tool to simulate a Windows reboot. + - Lots of bug fixes. + * New tool wineboot placed in wine-utils. + * Installed winewrap and winegcc/wineg++ into libwine-dev. + + -- Ove Kaaven Sun, 19 Jan 2003 21:03:50 +0100 + +wine (0.0.20021219-1) unstable; urgency=low + + * New upstream release 20021219 + - DLL linking now done through import libraries. + - A couple of new tools to make Winelib easier to use. + - Many Direct3D improvements. + - Improved Windows compatibility of the regression tests. + - Lots of bug fixes. + + -- Ove Kaaven Sat, 21 Dec 2002 21:03:21 +0100 + +wine (0.0.20021125-1) unstable; urgency=low + + * New upstream release 20021125 + - Finished conversion to STRICT compilation mode. + - WinHelp revival. + - Client-side fonts supported even without RENDER extension. + - Regression tests no longer require Perl. + - Lots of bug fixes. + * Removed libperl-dev from build dependencies accordingly. + * CUPS is now loaded dynamically, so I made debian/rules add + the necessary libcupsys2 dependency itself. + + -- Ove Kaaven Thu, 28 Nov 2002 17:25:21 +0100 + +wine (0.0.20021031-1) unstable; urgency=low + + * New upstream release 20021031 + - Complete listview overhaul. + - Beginnings of real RPC support. + - Most dlls now build properly in STRICT mode. + - Inter-process window activation and focus handling. + - Many improvements to AVI support. + - Lots of bug fixes. + + -- Ove Kaaven Wed, 6 Nov 2002 15:36:15 +0100 + +wine (0.0.20021007-1) unstable; urgency=low + + * New upstream release 20021007 (closes: #164607) + - Massive listview rewrite. + - New MS RLE codec. + - winemaker should be working again. + - Beginnings of Direct3D 8 support. + - Lots of bug fixes. + * Patched to work with glibc 2.3. Closes: #165323. + + -- Ove Kaaven Sun, 20 Oct 2002 23:11:17 +0200 + +wine (0.0.20020904-1) unstable; urgency=low + + * New upstream release 20020904 + - Much improved PowerPC support. + - More correct locale definitions. + - Progress on the conversion of handle types to pointers. + - Many Visio and Quicken fixes merged from Crossover. + - Lots of bug fixes. + * Yeah, I know I'm late in packaging this release, + but I've been sick. Closes: #159867. + * Fixed debian/*.dirs (many of them accidentally contained + /usr/share/doc/libwine-twain). Closes: #157063. + * Changed gluck.debian.org to people.debian.org in README.Debian + since it's reported that the apt source doesn't work otherwise. + * Fixed path of system.ini in README.Debian. Closes: #159833. + + -- Ove Kaaven Fri, 13 Sep 2002 15:44:32 +0200 + +wine (0.0.20020804-2) unstable; urgency=low + + * Made comdlg32 import winspool using delayed imports + instead of regular imports. This should make comdlg32 + work without libwine-print as long as the print + dialog isn't opened (trying that will probably crash). + Closes: #156338. + + -- Ove Kaaven Thu, 15 Aug 2002 21:38:38 +0200 + +wine (0.0.20020804-1) unstable; urgency=low + + * New upstream release (closes: #155542) + - Beginnings of an IDL compiler. + - Several new winedbg features. + - More OLE and shell improvements. + - NAS and AudioIO sound drivers. + - Still more Sparc portability fixes. + - Lots of bug fixes. + * New tool widl placed in libwine-dev. + * The new NAS driver is placed in a new libwine-nas package. + For some reason, the build system makes this driver depend on X11, + but I don't know enough about NAS to know if it's supposed to. + * The AudioIO driver is for Solaris, so it isn't built. + * There's now a man page for winebuild (closes: #83274). + + -- Ove Kaaven Tue, 6 Aug 2002 19:42:51 +0200 + +wine (0.0.20020710-1) unstable; urgency=low + + * New upstream release 20020710 + - DirectSound 8 and DirectInput 8 support. + - Many OLE improvements. + - Support for font downloading in Postscript driver. + - ALSA sound driver. + - More portability fixes, particularly for Sparc. + - Lots of bug fixes. + * Split off libwine components with heavy dependencies + into separately installable packages (closes: #148479): + libwine-print (depends on CUPS) + libwine-twain (depends on SANE) + libwine-alsa (depends on ALSA) + libwine-arts (depends on aRts) + * List all the Wine packages in README.Debian. + + -- Ove Kaaven Thu, 25 Jul 2002 04:48:55 +0200 + +wine (0.0.20020605-1) unstable; urgency=low + + * New upstream release 20020605 (Closes: #150139) + - Better Mingw support, including cross-compilation on Linux. + - Still more dll separation work. + - Winelib applications now get loaded much like builtin dlls. + - Some command-line options replaced by config entries. + - Multimedia improvements, including an MP3 decoder. + - Massive whitespace cleanup. + - New Winelib file manager. + - Lots of bug fixes. + * Fixed wine-doc.doc-base. Closes: #149649. + * Added Catalan debconf template. Closes: #139745. + * New tool regsvr32 placed in wine. + * New tool winefile placed in wine-utils. + * Wine build system has changed and installs hardlinked binaries. + I'll just package the hardlinked files as ordinary files for now. + But at least there's no longer .so files in /usr/bin (closes: #148357). + * Removed README.Debian reference to my old apt repository on WineHQ; + since they no longer run Debian, I can't host it there anymore. + + -- Ove Kaaven Sun, 23 Jun 2002 04:55:39 +0200 + +wine (0.0.20020509-1) unstable; urgency=low + + * New upstream release 20020509 + - More dll separation work. + - Many async I/O improvements. + - Still more unit tests. + - A lot less multimedia code. + - Many portability fixes, esp. for ReactOS. + - Lots of bug fixes. + * New tool winepath placed in wine-utils. + * clock and hlp2sgml removed from wine-utils. + * Added German debconf templates. Closes: #139095. + * Added Catalan debconf template. Closes: #139746. + * Doubled size of MAX_FONTS. Closes: #145033. + * Explicitly depend on libfreetype6, and changed Wine code + to look for libfreetype.so.6 instead of libfreetype.so. + Closes: #146136. + + -- Ove Kaaven Mon, 13 May 2002 05:58:19 +0200 + +wine (0.0.20020411-1) unstable; urgency=low + + * New upstream release 20020411 + - Beginnings of an SMB client implementation. + - New naming scheme and location for builtin dlls. + - aRts sound driver. + - A bunch of unit tests. + - Much more complete setupapi implementation. + - Some dll separation progress. + - The usual common controls rewrites. + - Much improved Microsoft Office support. + - Lots of bug fixes. + * Wine license changed to LGPL. Updated debian/copyright. + * Build system changed. Updated debian/* files. + * New build dependency libarts-dev added for aRts driver. + * New build dependency libsane-dev added for TWAIN support. + * New tool regedit placed in wine-utils. + + -- Ove Kaaven Sat, 13 Apr 2002 14:31:02 +0200 + +wine (0.0.20020228-1) unstable; urgency=low + + * New upstream release 20020228 + - Client-side font rendering using Xrender. + - Local server COM support. + - Many DrawText improvements. + - A ton of fixes for better MS Office support. + - Preliminary support for C unit tests. + - Lots of bug fixes. + * Updated the build dependencies, been too long since last time. + * Added tchar.h to list of headers to install in include/Makefile.in. + Closes: #131918. + * Made winelauncher errors about not finding winesetup more + helpful. Closes: #135263. + + -- Ove Kaaven Fri, 8 Mar 2002 12:21:08 +0100 + +wine (0.0.20020122-2) unstable; urgency=low + + * Sigh. Conflict with binfmt-support (<< 1.1.2), then. + Closes: #130887. + + -- Ove Kaaven Sat, 26 Jan 2002 23:21:36 +0100 + +wine (0.0.20020122-1) unstable; urgency=low + + * New upstream release 20020122 + - Lots of improvements to asynchronous I/O. + - Beginnings of unit testing infrastructure. + - Inter-process DDE should work now. + - Lots of bug fixes. + * dosmod no longer exist. (Closes: #83260) + * Tried to make the winelauncher script behave in the absence + of a display. Closes: #128068. (Also tried to make the script + return the correct error code while I was at it. Didn't I have + a bug on that once?) + * Updated Spanish debconf templates. Closes: #120241, #128927. + * Changed short description of wine-utils from "Wine Emulator" + to "Windows Emulator" to match the other binary packages... + * Install wine.xpm and wine_small.xpm into /usr/share/pixmaps. + + -- Ove Kaaven Fri, 25 Jan 2002 15:58:51 +0100 + +wine (0.0.20011226-2) unstable; urgency=low + + * Added xlibmesa-dev to the build dependencies. + * Added "undocumented" manpage for wineconsole. + * Added support for the binfmt-support package. Closes: #89386. + * Prepend "--" to arguments in wineshelllink. Closes: #128124. + + -- Ove Kaaven Sat, 12 Jan 2002 00:06:15 +0100 + +wine (0.0.20011226-1) unstable; urgency=low + + * New upstream release 20011226 + - Many improvements to audio support. + - Lots of new actions in SystemParametersInfo. + - New console based on Win32 window instead of xterm. + - Server protocol redesigned. + - More shlwapi improvements. + - Lots of bug fixes (Closes: #115482). + * Placed the new wineconsole program into the wine package. + * Changed build dependency cygnus-stylesheets to docbook-utils. + Closes: #123736. + * Updated Standards-Version to 3.5.6. + + -- Ove Kaaven Thu, 27 Dec 2001 10:41:11 +0100 + +wine (0.0.20011108-2) unstable; urgency=low + + * Revert to debhelper v2 compatibility, and wrote ldconfig into + postinst manually, since debhelper no longer likes libwine.so + anyway. Closes: #119051. + + -- Ove Kaaven Sun, 11 Nov 2001 13:18:40 +0100 + +wine (0.0.20011108-1) unstable; urgency=low + + * New upstream release 20011108 + - Shared windows support starts doing something useful. + - Overlapped I/O improvements. + - Support for running files from removable media. + - Many shlwapi improvements. + - Quartz dll keeps growing. + - Lots of bug fixes (Closes: #115319). + * Present a verification question if Wine is launched + as a MIME handler from mailcap (Closes: #114977). + * Tried to add a KDE file association (Closes: #118430). + If anyone has suggestions for improving that (I didn't manage + to make Wine launch on left-click, only on right-click + and then selecting WINE), please let me know. + + -- Ove Kaaven Fri, 9 Nov 2001 03:05:30 +0100 + +wine (0.0.20011004-1) unstable; urgency=low + + * New upstream release 20011004 + - Beginnings of shared window handles. + - Much improved typelib support. + - Tons of new code in quartz dll. + - Lots of bug fixes (Closes: #109668). + * The specmaker tool has been replaced by the winedump tool + (Closes: #87552). + * This release was apparently badly timed (it was exceedingly broken). + However, one day after the release, all the major breakages were + fixed in the CVS tree (i.e. business as usual in the Wine project). + So I've applied the current CVS patches to make this Debian + release somewhat useful. + + -- Ove Kaaven Sat, 6 Oct 2001 13:15:44 +0200 + +wine (0.0.20010824-1) unstable; urgency=low + + * New upstream release 20010824 + - Inter-process SendMessage support + - More DDE improvements + - Preparation work for shared window handles + - Several debugger improvements + - Better GDI objects management + - Lots of bug fixes + + -- Ove Kaaven Sun, 26 Aug 2001 15:27:56 +0200 + +wine (0.0.20010731-1) unstable; urgency=low + + * New upstream release 20010731 + - 16-bit comm routines reimplemented properly + - More improvements to the Postscript driver + - A few more steps towards dll separation + - Lots of bug fixes + * And from release 20010629 (which I didn't package + because I think it was a very unstable release) + - Better font metrics support in Postscript driver using Freetype + - Major window management redesign (still in progress) + - Message queues in wineserver to prepare for inter-process messaging + - DDE merged from Corel tree, plus various fixes + - 64-bit file size support + - Lots of bug fixes + * You wanted a more recent Wine, you got it (closes: #109230) + * Applied another Linux 2.4 winsock patch. + * Updated README.Debian to point to WineHQ resources and such + (troubleshooting guide, FAQ, etc). + + -- Ove Kaaven Sun, 26 Aug 2001 15:21:57 +0200 + +wine (0.0.20010510-3) unstable; urgency=low + + * Applied patch from Marcus Meissner to make CUPS support + build on potato. + + -- Ove Kaaven Thu, 17 May 2001 20:05:46 +0200 + +wine (0.0.20010510-2) unstable; urgency=low + + * Added CUPS build dependency, and installed it on my build + machines, so users that need printing can take advantage of + Wine's new support for CUPS. + * Moved sample config files potentially referenced from postinst + from /usr/share/doc/wine to /usr/share/wine, and added symlinks + to them in /usr/share/doc/wine, as per Debian policy. + * There's a new generic.ppd among the sample config files, I'm + not sure what to do with it other than stuff it into + /usr/share/doc/wine. + * Updated Standards-Version to 3.5.4. + + -- Ove Kaaven Thu, 17 May 2001 13:10:06 +0200 + +wine (0.0.20010510-1) unstable; urgency=low + + * New upstream release 20010510 + - Many improvements to printing support + - Some graphics driver restructures + - Lots of bug fixes + * And from release 20010418 (which I didn't package + because I think it was a very bad release) + - DirectDraw restructuration and improvements + - MSVCRT headers for compiling Winelib apps + - Postscript driver enhancements + - Several multimedia fixes + - Lots of bug fixes + * Declared versioned dependency on debhelper v3. + + -- Ove Kaaven Sat, 12 May 2001 12:15:41 +0200 + +wine (0.0.20010326-3) unstable; urgency=low + + * Maybe tell postinst too that I moved documentation/samples/* + (system.ini) from libwine to wine. Closes: #92446. + * Added Spanish to wine.templates. Closes: #92316. + + -- Ove Kaaven Sun, 1 Apr 2001 21:52:30 +0200 + +wine (0.0.20010326-2) unstable; urgency=low + + * Implemented DEB_BUILD_OPTIONS *properly*. + * Cleaner .a file handling in debian/rules. + + -- Ove Kaaven Fri, 30 Mar 2001 11:39:04 +0200 + +wine (0.0.20010326-1) unstable; urgency=low + + * New upstream release + - Serial async I/O improvements + - Support for app-specific dll overrides in config file + - Lots of bug fixes. + * New build dependency libperl-dev (because of the new + winetest program, which is supposed to be wine's new + API test suite, but though it was necessary to compile + it, I don't think it's useful to have in the debian + packages, is it?) + * There's a new winecheck script too, but I didn't include + it either, as I'm not sure how it works and whether it + would be useful in Debian packages. + * Made the dependency on xbase-clients versioned >= 4.0, + so it doesn't satisfy potato xfree86 3.x users, forcing + the ORed xcontrib dependency instead. + * Added Suggests: msttcorefonts (neat package). + * Moved documentation/samples/* from libwine to wine. + * Implemented DEB_BUILD_OPTIONS stuff. + Upgraded Standards-Version to 3.5.2. + + -- Ove Kaaven Wed, 28 Mar 2001 16:31:47 +0200 + +wine (0.0.20010305-1) unstable; urgency=low + + * New upstream release 20010305. + - Some improvements to the wineserver protocol. + - The usual common controls fixes/improvements. + - Version information in builtin dlls. + - Lots of bug fixes. + + -- Ove Kaaven Tue, 6 Mar 2001 00:35:21 +0100 + +wine (0.0.20010216-5) unstable; urgency=low + + * Added dependency on xbase-clients | xcontrib, since the + winelauncher needs xmessage in order to operate. + * Made winelauncher handle filenames with spaces. Closes: #87710. + * Moved libwine's unused config stuff to wine (though still not used). + * Fixed bashism in libwine.preinst. Closes: #87864. + * Added French debconf translations. Closes: #87749, #87750. + + -- Ove Kaaven Mon, 26 Feb 2001 17:19:50 +0100 + +wine (0.0.20010216-4) unstable; urgency=low + + * Gave in and killed the OSMesa support, by overriding + the config.cache with a debian/config.anticache in rules. + Sadly, users most likely can no longer use plain old non-GLX + Mesa (without hardware acceleration) to play Half-Life at 0.2 fps + anymore, but maybe that's no big loss anyway. + Closes: #83391, #83393. + * Removed MesaGL mess explanation from README.Debian again. + * Changed german translation of libwine.templates. Closes: #87604. + + -- Ove Kaaven Sun, 25 Feb 2001 19:23:11 +0100 + +wine (0.0.20010216-3) unstable; urgency=low + + * Made Wine a handler of the application/x-msdos-program MIME + type. (Soon your Unix mailers will also be able to run all + those Windows viruses, muahahaha...) + * Added a GNOME file association for that too. + (But I don't know how to do that for KDE... if there's anything + extra I need to do to make it work in KDE too, send a patch + to the bug tracker or something) + * Moved winemaker manpage to where winemaker is now (wine-utils). + * Added "undocumented" manpage for specmaker and wine.bin. + + -- Ove Kaaven Sun, 25 Feb 2001 11:26:35 +0100 + +wine (0.0.20010216-2) unstable; urgency=low + + * Oops... seems that as I moved from one machine to another, the + 0.0.20010216-1 was built on top of 0.0.20010112-2, not -3. + Now I've imported the changes that was done to -3 + (changelog and shlibs.local)... + + -- Ove Kaaven Wed, 21 Feb 2001 20:34:55 +0100 + +wine (0.0.20010216-1) unstable; urgency=low + + * New upstream release 20010216. + - Several PostScript driver enhancements. + - Improved enhanced metafiles support. + - Beginnings of PowerPC support. + - Lots of bug fixes. (Closes: #83214) + * libwine_tsx11.so is new, placed it in /usr/lib. + * specmaker is new, placed it in wine-utils. + * Updated README.Debian to explain the MesaGL mess. + * Built with debhelper v3. + * Moved winemaker from libwine-dev to wine-utils, since it's just a + porting tool for preparing windows for winelib compilation, not + a build requirement once the sources have been prepared. + * Removed rpath hack from debian/rules, assuming that winelauncher + does a good enough job (or recognizing that the upstream configure + adds rpath itself so I wouldn't have to anyway). + * Patched winelauncher a lot, so now it works without rpath in the + Debian packaging, and works with the winelib apps. + * Moved /usr/lib/*.so symlinks to libwine-dev. + * Finally moved the /var/lib/wine stuff from libwine to wine. + * Someone apparently translated libwine.templates to German. + While not terribly useful (the first message might be obsolete + and the other isn't actually used, at least not right now), + especially not without also translating wine.templates, I just + threw it into libwine.templates anyway to close the bug. + Closes: #83366. + + -- Ove Kaaven Mon, 19 Feb 2001 22:00:36 +0100 + +wine (0.0.20010112-3) unstable; urgency=low + + * Added shlibs.local, to use "xlibosmesa3 | mesag3" instead of just + xlibosmesa3, so that users that use mesag3 can just add a symlink + (or mesag3 can be made to provide such a symlink itself). + On the other hand, would adding a Build-Conflicts: xlibosmesa-dev + (and build without OSMesa support) be a better idea...? + * Removed bashism from winelauncher script. Closes: #83559. + + -- Ove Kaaven Fri, 26 Jan 2001 16:36:03 +0100 + +wine (0.0.20010112-2) unstable; urgency=low + + * Updated README.Debian. Closes: #82624. + + -- Ove Kaaven Wed, 17 Jan 2001 16:52:06 +0100 + +wine (0.0.20010112-1) unstable; urgency=low + + * New upstream release 20010112. + This version of Wine unfortunately doesn't support a global config + file, so the default wine.conf is now removed from the package. + I'll just have to recommend using winesetuptk for now. + * Using debconf to notify the sysadmin of the above issue, and ask + whether to delete /etc/wine.conf. + * Decided to use winelauncher like it was intended; rename the main + wine binary to wine.bin, and rename winelauncher to wine. + This will also automatically launch winesetup if there's no config. + * Removing wine.conf in postrm if wine is purged. + + -- Ove Kaaven Sat, 13 Jan 2001 16:38:56 +0100 + +wine (0.0.20001222-2) unstable; urgency=low + + * Added usr/lib to libwine-dev.dirs. (Oops.) + * Added ldconfig to libwine.postinst. + * Now that winesetuptk is available, I added winesetup to Suggests, + and mentioned it in README.Debian. The next Wine release ought to + have support for a new global config file, I plan to remove wine.conf + from the package once that happens. + * Added information about other sources for Wine .deb packages + (from the WineHQ download page) to README.Debian. + + -- Ove Kaaven Thu, 11 Jan 2001 18:34:39 +0100 + +wine (0.0.20001222-1) unstable; urgency=low + + * New upstream release 20001222. + The configuration file format has changed, but I've kept the wine.conf + in here since the winesetuptk tool isn't ready yet (I'm waiting for it + to handle the new configuration file format), and wine will simply + automatically generate a ~/.wine/config using the old wine.conf. + * Updated README.Debian to explain these config issues. + * Built more of the winelib apps, put some of them (including the + all-important "winemine") into wine-utils. + + -- Ove Kaaven Sat, 23 Dec 2000 04:54:03 +0100 + +wine (0.0.20001202-1) unstable; urgency=low + + * New upstream release 20001202. + New tools winelauncher and wineshelllink. + Updated wine.conf. + (I ought to use winelauncher for something, maybe soon.) + * Updated Build-Depends for XFree86 4.0. + * Install regapi into wine. Closes: #76138, #47857. + Also put winedefault.reg into wine instead of libwine. + Will clean up the inconsistencies, such as drive setup + and files being in libwine instead of wine, later. + * Moved winebuild, wmc, and wrc from wine-utils and + into libwine-dev, since these are tools required for + compiling Winelib apps. + * Added LDFLAGS with rpath set to /usr/lib/wine as arguments + to make during build, so that regapi and winedbg works. + Closes: #72243 (may have been closed by 20001026-2 too). + Eventually DLL separation will remove the need for rpath, + but I'll keep it until then. + * Added a new fake drive for /usr/bin, so that wine can find + winedbg. + + -- Ove Kaaven Sun, 3 Dec 2000 11:15:53 +0100 + +wine (0.0.20001026-2) unstable; urgency=low + + * Repackaged with debhelper, since debmake proved too limited. + Closes: #69467, #69469, #69570, #70820, #71461. + * The default wine.conf update and the libdir fix (and + the repackaging) closes: #67381, #67382. + * Reorganized wine-doc package, it now features HTML docs. + * Took Windows directories with spaces out of the package proper, + since debhelper didn't cope with them. Created them in postinst + instead for now. + * Some initial debconf support. But doing real configuration + questions must wait until I've patched the upstream + tools/wineinstall script for easier debconf integration. + * Moved Drive C path from /usr/share/wine/drivec to + /var/lib/wine/drivec for FHS compliance. (libwine.preinst takes + care of moving the actual contents and performing a search & + replace in wine.conf.) Closes: #70618, #70619, #70620. + + -- Ove Kaaven Sat, 28 Oct 2000 23:40:07 +0200 + +wine (0.0.20001026-1) unstable; urgency=low + + * New upstream release + + -- Ove Kaaven Fri, 27 Oct 2000 05:11:28 +0200 + +wine (0.0.20001002-1) unstable; urgency=low + + * New maintainer Ove Kaaven. + * New upstream release + * Update default wine.conf, fixed EXTRA_LD_LIBRARY_PATH. + * Set --libdir=/usr/lib/wine explicitly, the $${exec_prefix} didn't work. + * Added a few Windows directories into the /usr/share/wine/drivec. + * Add an empty winsock.dll file to Windows directory in libwine. + * Initialize win.ini and system.ini in Windows directory in + libwine.postinst. (Hmm. Wonder if a --purge should remove everything? + If the user only wanted to remove the .deb to compile wine himself, + that might be a bad idea if the user installed something...) + + -- Ove Kaaven Thu, 26 Oct 2000 12:52:42 +0200 + +wine (0.0.20000909-1) unstable; + + * New version for unstable. Hopefully, this one will run. + + -- Andrew D. Lenharth Wed, 20 Sep 2000 10:01:17 -0800 + +wine (0.0.20000801-1) unstable; urgency=low + + * New version for unstable. Enjoy. + * elfdlls are seperated from libwine and put into /usr/lib/wine + * lib directories moved, should close a few bugs in 20000614 + + -- Andrew D. Lenharth Mon, 20 May 2000 10:01:17 -0800 + +wine (0.0.20000614-1) unstable; urgency=low + + * New version for unstable. Enjoy. + * Many new upstream bug fixes. wine-utils now contains utilities. + * Directory structure reorganized for debian. + * elfdlls are seperated from libwine and put int /usr/share/wine/lib + * winebuild now included. Closes#62395 + * fnt2bdf now included. Closes#61214 Closes#64892 + + -- Andrew D. Lenharth Mon, 20 May 2000 10:01:17 -0800 + +wine (0.0.20000430-1) unstable; urgency=low + + * New version for unstable. Enjoy. + * Many new upstream bug fixes, and a few file moves, so expect bugs. + * Directory structure reorganized for debian. + * elfdlls are seperated from libwine and put int /usr/share/wine/lib + + -- Andrew D. Lenharth Sat, 13 May 2000 10:01:17 -0800 + +wine (0.0.20000326-2) unstable; urgency=low + + * Tryed out the elfdll stuff. Didn't work yet. + + -- Andrew D. Lenharth Mon, 14 Feb 2000 18:01:17 -0800 + +wine (0.0.20000326-1) unstable; urgency=low + + * New version for unstable. Enjoy. + * Many new upstream bug fixes, and a few file moves, so expect bugs. + + -- Andrew D. Lenharth Mon, 14 Feb 2000 18:01:17 -0800 + +wine (0.0.20000130-1) unstable; urgency=low + + * New version for unstable. Closes a few bugs. + + -- Andrew D. Lenharth Mon, 14 Feb 2000 18:01:17 -0800 + +wine (0.0.20000109-2) frozen; urgency=low + + * OpenGL depends fixed. Closes 55313 55365 55186 + + -- Andrew D. Lenharth Wed, 14 Dec 1999 18:01:17 -0800 + +wine (0.0.20000109-1) unstable; urgency=low + + * Assorted upstream Bug fixs as always :). + * Compiled with Xpm again. Closes #54910 + + -- Andrew D. Lenharth Wed, 14 Dec 1999 18:01:17 -0800 + +wine (0.0.991212-1) unstable; urgency=low + + * Assorted upstream Bug fixs as always :). + + -- Andrew D. Lenharth Wed, 14 Dec 1999 18:01:17 -0800 + +wine (0.0.991114-2) unstable; urgency=low + + * Added check for /usr/X11R6/lib/libwine*. Closes: 43322 43597 + * fixed dependency on libwine. + * Assorted upstream Bug fixs as always :). + + -- Andrew D. Lenharth Wed, 21 Nov 1999 18:01:17 -0800 + +wine (0.0.991114-1) unstable; urgency=low + + * New upstream version. + * Assorted upstream Bug fixs as always :). + + -- Andrew D. Lenharth Wed, 14 Nov 1999 18:01:17 -0800 + +wine (0.0.991031-1) unstable; urgency=low + + * New upstream version. + * Changed a to point to /floppy instead of /mnt/fd0. + * Now links to mesa. Closes: #47312 + * symtable is now set correctly in wine.conf. Closes: #43601 + * Assorted upstream Bug fixs as always :). + + -- Andrew D. Lenharth Wed, 3 Nov 1999 18:01:17 -0800 + +wine (0.0.990923-2) unstable; urgency=low + + * Packaging fix. + * libgl1 dependecy now libmesagl. Closes: #47351 #47014 #46937 #46937 + + -- Andrew D. Lenharth Sat, 16 Oct 1999 09:09:27 -0700 + +wine (0.0.990923-1) unstable; urgency=low + + *New Upstream release. + *Lots of bug fixes (of course). + *Reworked msacm driver. + + -- Andrew D. Lenharth Tue, 05 Oct 1999 14:21:46 -0700 + +wine (0.0.990815-1) unstable; urgency=low + + * New Upstream release. + * Lots of bug fixes. + * Many more dlls are seperate from the main library. + * includes documentation/ directory included. Closes: #29103 + * fixed depend problem. Closes: #43320 #43325 #43332 + * wine.conf is now back in /etc. Closes: #43387 + + -- Andrew D. Lenharth Tue, 24 Aug 1999 14:21:46 -0700 + +wine (0.0.990731-1) unstable; urgency=low + + * New upstream version + * Lots of bug fixes. + + -- Andrew D. Lenharth Tue, 24 Aug 1999 12:18:25 -0700 + +wine (0.0.990704-2) unstable; urgency=low + + * New maintainer Andrew Lenharth. + * Repackaged. + * libwine0.0.971116 renamed to libwine + + -- Andrew D. Lenharth Sun, 1 Aug 1999 14:36:54 -0700 + +wine (0.0.990704-1) unstable; urgency=low + + * New upstream release: + - Server communication optimized. + - Many window painting fixes. + - Portability improvements. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 5 Jul 1999 13:17:44 +0200 + +wine (0.0.990613-1) unstable; urgency=low + + * New upstream release: + - All tasks now run in their own thread. + - Win32 debug API preliminary implementation. + - New Winelib app: a command-line interpreter. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 14 Jun 1999 12:47:10 +0200 + +wine (0.0.990523-1) unstable; urgency=low + + * New upstream release: + - Printing improvements + - X input and multimedia timers moved to service thread. + - More threading and locking fixes. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 31 May 1999 17:49:52 +0200 + +wine (0.0.990508-1) unstable; urgency=low + + * New upstream release: + - Lots of threading fixes. + - Start of enhanced metafile support. + - Several common controls improvements. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 10 May 1999 16:14:26 +0200 + +wine (0.0.990426-1) unstable; urgency=low + + * New upstream release: + - Resources in built-in DLLs. + - Threading support for FreeBSD and Solaris. + - Lots of threading and synchronization changes. + - Loader reorganization and new load order support. + - Lots of bug fixes. + + -- Vincent Renardias Tue, 27 Apr 1999 14:16:38 +0200 + +wine (0.0.990328-1) unstable; urgency=low + + * New upstream release: + - Lots of new OLE stuff. + - Use separate threads for Win32 processes. + - Various multimedia improvements. + - Lots of bug fixes. + + -- Vincent Renardias Sun, 28 Mar 1999 21:54:03 +0200 + +wine (0.0.990214-1) unstable; urgency=low + + * New upstream release: + - More reorganizations of headers and drivers. + - Still more OLE stuff. + - Many new functions and stubs. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 15 Feb 1999 14:24:45 +0100 + +wine (0.0.990131-1) unstable; urgency=low + + * Add menu support (Fix bug #19196). + * Correct dosmod.1 symlink (Bugs #32361, #32342, #32236). + * New upstream release: + - Tons of new OLE stuff. + - Several improvements to DirectDraw support. + - Better message queues. + - Many new functions and stubs. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 1 Feb 1999 11:08:20 +0100 + +wine (0.0.990110-3) unstable; urgency=low + + * Rebuild with OpenGL dev. libs so DirectX emulation works. + * Make dosmod.1 point to wine.1 rather than undocumented.7. + + -- Vincent Renardias Tue, 19 Jan 1999 18:25:22 +0100 + +wine (0.0.990110-2) unstable; urgency=low + + * Updated documentation (Fix bug #31873). + * Add missing dep. on libwine (Fix bug #31982). + + -- Vincent Renardias Sat, 16 Jan 1999 22:43:48 +0100 + +wine (0.0.990110-1) unstable; urgency=low + + * New upstream release: + - Many more COM interfaces definitions. + - Improvements to the resource compiler. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 11 Jan 1999 04:36:02 +0100 + +wine (0.0.990103-1) unstable; urgency=low + + * New upstream release: + WHAT'S NEW with Wine-990103: (see ChangeLog for details) + - Improved console support. + - Tons of new stubs. + - Improvements to header files compatibility. + - More features in Wine server. + - Lots of bug fixes. + * Added several more READMEs. + + -- Vincent Renardias Mon, 4 Jan 1999 13:05:48 +0100 + +wine (0.0.981211-1) unstable; urgency=low + + * New upstream release: + WHAT'S NEW with Wine-981211: + - A lot of code moved around for a better structure. + - New console support. + - Beginnings of TTY driver. + - Tons of new stubs. + - More DOS and native USER support. + - Lots of bug fixes. + WHAT'S NEW with Wine-981108: + - More common controls. + - Better separation of X11-dependent code. + - More DOS support. + - Winsock IPX support. + - Lots of bug fixes. + WHAT'S NEW with Wine-981025: + - KDE drag&drop support. + - Still more common controls and SHELL32 features. + - More Postscript driver functions. + - Lots of bug fixes. + * Updated FAQ. + * Removed installation of texinfo manual (doesn't work since 2 releases) + + -- Vincent Renardias Tue, 29 Dec 1998 14:52:20 +0100 + +wine (0.0.981018-1.1) frozen unstable; urgency=low + + * Non-maintainer release. + * Recompiled with new libc, to fix __register_frame_info problem, + at maintainer's request. + * Build manpages with "c2man-wine" (now packaged as such), because + the mainline c2man lacks an option wine uses. + * A bugfix in c2man-wine fixes the problem of manpages with spaces in + their names. Removed the attempted workaround (which didn't work :) + of removing those manpages after they are generated. + + -- Richard Braakman Mon, 14 Dec 1998 14:28:48 +0100 + +wine (0.0.981018-1) unstable; urgency=low + + * New upstream release: + - ELF DLL loader. + - Some more DOS support. + - Still more common controls and SHELL32 features. + - Using Windows native USER.DLL may work. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 19 Oct 1998 17:33:08 +0200 + +wine (0.0.980927-1) unstable; urgency=low + + * New upstream release: + - Still more common controls and SHELL32 features. + - MIDI I/O support. + - Several new undocumented KERNEL functions. + - More DOS exe stuff including some debugger support. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 28 Sep 1998 15:35:42 +0200 + +wine (0.0.980913-2) unstable; urgency=low + + * Just fixed a bug that made libwine-dev useless + since ~ 1 year ago (Which makes we wonder if anyone + actually used this package since this bug has never + been reported to me ;). + * Include graphics/psdrv/README as /usr/doc/wine/README.psdrv + (Bug #26699). + * Patches included from winehq.com: + - callproc.diff: Fix the CallProc{Ex}32W function. + - file_fix: Fix FILE_Read & FILE_Write behavior. + - int_fix: Missing last minute change. + - more_tsx: Fixed ``threadsafeness''. + + -- Vincent Renardias Tue, 15 Sep 1998 16:02:56 +0200 + +wine (0.0.980913-1) unstable; urgency=low + + * New upstream release: + - Even more common controls stuff. + - Many PostScript driver improvements. + - More DOS executables support. + - Lots of bug fixes. + + -- Vincent Renardias Sun, 13 Sep 1998 20:48:23 +0200 + +wine (0.0.980822-1) unstable; urgency=low + + * New upstream release: + - Improved mmio support. + - VxDCall support. + - More common controls and shell32 stuff. + - Better DOS executables support. + - Lots of bug fixes. + * Patches included from winehq.com: + - SetWindowLong: it's now possible to switch between the listview + and the iconview in the word95 File open dialog. + - RevokeDragDrop: New stub. + * Put the manpages in the correct directory! + + -- Vincent Renardias Thu, 27 Aug 1998 14:17:26 +0200 + +wine (0.0.980809-3) unstable; urgency=low + + * Patches from winehq.com applied: + - glibc2-dos: nows builds dosmod properly on libc6. + + -- Vincent Renardias Thu, 13 Aug 1998 14:03:24 +0200 + +wine (0.0.980809-2) unstable; urgency=low + + * Added loader/dos/dosmod in the binary package. + + -- Vincent Renardias Mon, 10 Aug 1998 18:09:26 +0200 + +wine (0.0.980809-1) unstable; urgency=low + + * New upstream release: + - Preliminary DOS executables support. + - Postscript driver improvements. + - More client/server stuff. + - Better shell32.dll builtin support. + - Proper Win16 mutex locking. + - Lots of bug fixes. + + -- Vincent Renardias Sun, 9 Aug 1998 16:25:30 +0200 + +wine (0.0.980726-1) unstable; urgency=low + + * New upstream release: + - Still more common controls stuff. + - More DirectDraw support. + - Compilation problems should be gone. + - Lots of bug fixes. + - Much improved manual pages generation. + * Now takes over 2 hours to build... ;( + + -- Vincent Renardias Mon, 27 Jul 1998 12:58:43 +0200 + +wine (0.0.980712-1) unstable; urgency=low + + * tried to fix #24140. + * New upstream release: + - More common controls stuff. + - Win32s VxD support. + - Beginnings of client/server architecture. + - More NLS support. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 13 Jul 1998 12:47:47 +0200 + +wine (0.0.980628-2) unstable; urgency=low + + * Added more doc. files (Bug #24139). + * Patches from www.winehq.com included: + - stub-for-fontview (Allows c:\windows\fontview.exe to start). + - winelib_snoop16 (Fix pbm when linking with libwine.so). + + -- Vincent Renardias Thu, 2 Jul 1998 16:23:49 +0200 + +wine (0.0.980628-1) unstable; urgency=low + + * New upstream release: + - Common controls improvements. + - Win16 DLL snooping. + - Preliminary internal Postscript driver. + - Improved DIB section handling. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 29 Jun 1998 12:27:40 +0200 + +wine (0.0.980614-1) unstable; urgency=low + + * New upstream release: + - Many drawing fixes. + - Inter-DLL calls snooping. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 15 Jun 1998 11:37:51 +0200 + +wine (0.0.980601-1) unstable; urgency=low + + * New upstream release: + - New resource compiler. + - Toolbar control. + - Partial implementation of CreateDIBSection. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 1 Jun 1998 17:05:08 +0200 + +wine (0.0.980517-2) unstable; urgency=low + + * Patches from www.winehq.com included: + commdlg_crash + + -- Vincent Renardias Wed, 20 May 1998 12:58:43 +0200 + +wine (0.0.980517-1) unstable; urgency=low + + * New upstream release: + - Lots of common controls improvements. + - Better thunking support. + - Lots of bug fixes. + + -- Vincent Renardias Sun, 17 May 1998 20:13:29 +0200 + +wine (0.0.980503-3) unstable; urgency=low + + * Correct dependencies... *sigh* + + -- Vincent Renardias Thu, 14 May 1998 16:05:00 +0200 + +wine (0.0.980503-2) unstable; urgency=low + + * Fix debian/rules (Fix #22382) + * Patch from www.winehq.com included: + - word980503.diff: makes Word95's file dialog boxes work. + + -- Vincent Renardias Tue, 12 May 1998 16:28:49 +0200 + +wine (0.0.980503-1) unstable; urgency=low + + * New upstream release: + - Module loading restructuration. + - Some rotated text support. + - Documentation for many more functions. + - Lots of bug fixes. + * Patches from www.winehq.com included: + - crtdll.diff: More functions implemented. + - module.diff: Fix patch mess in LoadModule16. + - profile: Make PROFILE_GetSection work properly. + - region: Fixes a problem with CombineRgn(). + + -- Vincent Renardias Tue, 12 May 1998 16:28:49 +0200 + +wine (0.0.980413-2) unstable; urgency=low + + * Patches from www.winehq.com included: + - arc_fix: Allows tk/tcl 8.0 (wish80.exe) to draw properly. + - default_bitmap_depth: fix buglet in displaying. + - metafile32: improved matefile support. + - mohr.diff: missing 'break;' statement. + - profile2: tweak profile reading in registry. + - rootcursor: Don't change the cursor look on the rootwindow. + * Updated FAQ. + * Updated html documentation. + + -- Vincent Renardias Fri, 17 Apr 1998 21:49:55 +0200 + +wine (0.0.980413-1) unstable; urgency=low + + * New upstream release: + - Flat thunks support. + - Many more autoconf checks for better portability. + - DIALOGEX resource support. + - Lots of bug fixes. + + -- Vincent Renardias Mon, 13 Apr 1998 16:26:48 +0200 + +wine (0.0.980329-1) unstable; urgency=low + + * New upstream release: + - More ImageLists support. + - More Win32 metafile support. + - Still some debugging output changes. + - Lots of bug fixes. + * Fix ugly shlibs.local bug (fortunatly, noone noticed ;) + * Patches included from winehq.com: init_crash, managed_winpos, relay_string. + + -- Vincent Renardias Mon, 30 Mar 1998 19:18:42 +0200 + +wine (0.0.980315-1) frozen unstable; urgency=low + + * New upstream release: + - Preliminary ImageLists support. + - Beginnings of enhanced metafiles. + - More debugging macros changes. + - Lots of bug fixes. + * Fix critical Bug #19429: libwine now depends on wine since + for now this library is totally useless without it. + + -- Vincent Renardias Fri, 20 Mar 1998 22:18:05 +0100 + +wine (0.0.980301-1) unstable; urgency=low + + * New upstream release: + - New debugging printfs scheme. + - Better DOS device handling. + - Lots of bug fixes. + * Polished debian/rules file. + * Updated html doc & FAQ. + + -- Vincent Renardias Mon, 2 Mar 1998 20:21:44 +0100 + +wine (0.0.980104-2) unstable; urgency=low + + * Include GNU Info & Postscript documentation as well as extra + manpages in wine-doc. + + -- Vincent Renardias Sat, 10 Jan 1998 15:49:19 +0100 + +wine (0.0.980104-1) unstable; urgency=low + + * New upstream release: + - Beginnings of DirectDraw/DirectSound support. + - Preliminary threading support based on clone(). + - Lots of bug fixes. + + -- Vincent Renardias Thu, 8 Jan 1998 01:43:26 +0100 + +wine (0.0.971221-2) unstable; urgency=low + + * Included the following patches from www.winehq.com/patches/ : + - ComboBox Fix (Bertho Stultiens). + - Console Fix (Karl Garrison). + - SetMetaFileBitsEx function updated. + - fd_set Winsock fixes (Ove Kaaven). + * Now compiled with egcs (gcc dies with sig 11 on misc/shellord.c). + + -- Vincent Renardias Thu, 1 Jan 1998 16:06:13 +0100 + +wine (0.0.971221-1) unstable; urgency=low + + * New upstream release (Bug #16209): + - Preliminary GDI paths support. + - DrawFrameControl implementation. + - Multimedia support for time and joystick functions. + - Win32 spec files now generate C code for Winelib. + - Tons of new Win32 functions and stubs. + - Lots of bug fixes. + * Corrected 2 buglets in debian/rules; closes:#15054, #15051. + * strip fnt2bdf (Fix #15724). + * Added libwine-dbg binary package. + * Adjusted packages section/priority. + * Moved libwine.a from libwine0.0.971116 to libwine-dbg. + * Compile with '-O3' flag. + + -- Vincent Renardias Sun, 28 Dec 1997 21:13:53 +0100 + +wine (0.0.971116-1) unstable; urgency=low + + * New upstream code. + - Emulator and library unification. + - New About dialog. + - Menus improvements. + - Lots of bug fixes. + - Now compiles under libc6 without additional patch. + * Added libwine0.0.971116 (Yes, the name is ugly ;) & libwine-dev packages; + They allow to compile Win32 C code as native Linux executable. + (Examples included in libwine-dev) + * Added wine.sym file to aid debugging. + * Added wine-doc package (FAQ + misc. documentation). + * Updated packages descriptions. + * Include more documentation in main package. + + -- Vincent Renardias Mon, 17 Nov 1997 16:11:34 +0100 + +wine (0.0.971101-1) unstable; urgency=low + + * New upstream code (#14057). + * Recompiled with libc6/xlib6g/xpm4g (#12715,#12918). + * Added documentation/fonts file. + + -- Vincent Renardias Sat, 20 Sep 1997 21:56:44 +0200 + +wine (0.0.970914-1) unstable; urgency=low + + * New Upstream Source: + - Better resource handling. + - New Progress control. + - Improved PE module support. + - Many relay code changes. + - Lots of bug fixes. + * Include wineconf configuration script. + * Use pristine source. + + -- Vincent Renardias Fri, 29 Aug 1997 22:06:05 +0200 + +wine (0.0.970804-1) unstable; urgency=low + + * New Upstream Source: + - Joystick support, + - More Win32 stuff, + - Lots of bug fixes. + + -- Vincent Renardias Sat, 9 Aug 1997 17:31:05 +0200 + +wine (0.0.970720-1) unstable; urgency=low + + * new upstream source. + * new maintainer. + * released to unstable. + * compiled with libc6. + * modified dependencies (Fixes #5992). + * moved /usr/bin/wine to /usr/X11R6/bin. + * use /usr/lib/wine [ (c) bcwhite ]. + * Modified numbering scheme after agreement with upstream maintainer. + + -- Vincent Renardias Sat, 26 Jul 1997 17:47:45 +0200 + +wine (970629-1) experimental; urgency=LOW + + * new upstream source + + -- Brian White Wed, 4 Dec 1996 20:49:55 -0500 + +wine (951124-1) experimental; urgency=LOW + + * first Debianized packages + + -- Brian White Sun, 26 Nov 1996 23:02:47 -0400 + + +Local variables: +mode: debian-changelog +End: --- wine1.2-1.1.43.orig/debian/wine-winehelp.desktop +++ wine1.2-1.1.43/debian/wine-winehelp.desktop @@ -0,0 +1,24 @@ +[Desktop Entry] +Name=Wine Help Browser +Name[fi]=Wine-ohjeselain +Name[ca]=Ajuda del Wine +Name[it]=Guida di Wine +Name[hu]=Wine súgóböngészÅ‘ +Name[ru]=ПроÑмотрщик Ñправочных файлов Wine +Name[el]=Βοήθεια Wine +Name[es]=Ayuda de Wine +Name[pt_br]=Ajuda do Wine +Comment=Windows Help Browser +Comment[fi]=Winen Windows-ohjeselain +Comment[ca]=Visualitzeu l'ajuda dels programes del Windows +Comment[pt_br]=Programa para abrir arquivos de ajuda (*.hlp) +Comment[es]=Acceso a la ayuda en linea de Windows +Comment[el]=ΠεÏιηγητής βοήθειας Windows +Comment[ru]=ПроÑмотрщик Ñправочных файлов в формате Windows +Comment[hu]=Windowsos súgóböngészÅ‘ +Comment[it]=Visualizza la guida in linea di Windows +Exec=winhelp +Terminal=false +Type=Application +Icon=wine +Categories=Wine;Utility;Emulator; --- wine1.2-1.1.43.orig/debian/wine-regedit.svg +++ wine1.2-1.1.43/debian/wine-regedit.svg @@ -0,0 +1,6526 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- wine1.2-1.1.43.orig/debian/wine-winefile.svg +++ wine1.2-1.1.43/debian/wine-winefile.svg @@ -0,0 +1,1073 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- wine1.2-1.1.43.orig/debian/wine-notepad.desktop +++ wine1.2-1.1.43/debian/wine-notepad.desktop @@ -0,0 +1,32 @@ +[Desktop Entry] +Name=Notepad +Name[sv]=Anteckningar +Name[de]=Editor +Name[fi]=Muistio +Name[pl]=Notatnik +Name[ca]=Bloc de notes +Name[it]=Blocco note +Name[nl]=Kladblok +Name[hu]=Jegyzettömb +Name[ru]=Блокнот +Name[el]=ΣημειωματάÏιο +Name[es]=Bloc de Notas +Name[pt_br]=Bloco de Notas +Comment=A clone of Windows Notepad +Comment[sv]=En klon av Windows Anteckningar +Comment[de]=Ein Windows Editor Klon +Comment[fi]=Windows Muistio -klooni +Comment[pl]=Klon Notatnika Windows +Comment[ca]=Un clon del Windows Notepad +Comment[pt_br]=Uma cópia do Bloco de Notas do Windows +Comment[es]=Un clon del Bloc de Notas de Windows +Comment[el]=Κλώνος του ΣημειωματάÏιου των Windows +Comment[ru]=Клон Блокнота Windows +Comment[hu]=A windowsos Jegyzettömb klónja +Comment[it]=Un clone del «Blocco note» di Windows +Comment[nl]=Een kloon van Kladblok in Windows +Exec=notepad +Terminal=false +Type=Application +Icon=wine-notepad +Categories=Wine-Programs-Accessories; --- wine1.2-1.1.43.orig/debian/wine-winemine.svg +++ wine1.2-1.1.43/debian/wine-winemine.svg @@ -0,0 +1,262 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- wine1.2-1.1.43.orig/debian/wine1.2.mime +++ wine1.2-1.1.43/debian/wine1.2.mime @@ -0,0 +1,11 @@ +application/x-msdos-program; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/x-msdownload; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/exe; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/x-exe; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/dos-exe; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +vms/exe; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/x-winexe; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/msdos-windows; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/x-msdos-program; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Executable +application/x-msi; /usr/bin/cautious-launcher '%s' /usr/bin/wine ; description=Windows Installer archive + --- wine1.2-1.1.43.orig/debian/wine-browsedrive.desktop +++ wine1.2-1.1.43/debian/wine-browsedrive.desktop @@ -0,0 +1,39 @@ +[Desktop Entry] +Name=Browse C: Drive +Name[cs]=Procházet disk C: +Name[sv]=Bläddra i C: +Name[da]=Udforsk C: drev +Name[de]=Durchsuche C: +Name[eu]=Arakatu C: diskoa +Name[fi]=Selaa C:-asemaa +Name[fr]=Parcourir le disque C: +Name[he]=סיור בכונן C: +Name[pl]=PrzeglÄ…daj napÄ™d C: +Name[ca]=Navegeu per l'unitat C: +Name[it]=Esplora unità C: +Name[lt]=NarÅ¡yti C: diskÄ… +Name[nl]=Station C: bekijken +Name[hu]=A C: meghajtó tallózása +Name[ru]=Обзор диÑка C: +Name[el]=ΠεÏιήγηση στο C: +Name[es]=Explorar la unidad C: +Name[pt]=Navegar no Disco C: +Name[pt_br]=Explorar C: +Comment=Browse your virtual C: drive +Comment[sv]=Bläddra i virtuella enheten C: +Comment[de]=Durchsuche das virtuelle C: Laufwerk +Comment[fi]=Selaa virtuaalista C:-asemaa +Comment[pl]=PrzeglÄ…danie wirtualnego napÄ™du C: +Comment[ca]=Navegeu per la vostra unitat virtual C: +Comment[pt_br]=Explorar a unidade virtual C: +Comment[es]=Explorar la unidad virtual C: +Comment[el]=ΠεÏιήγηση στον εικονικό οδηγό C: +Comment[ru]=Обзор виртуального диÑка C: +Comment[hu]=A virtuális C: meghajtó tallózása +Comment[it]=Esplora l'unità virtuale C: +Comment[nl]=Bekijk uw virtuele C: schijf +Exec=xdg-open .wine/dosdevices/c: +Terminal=false +Type=Application +Icon=folder-wine +Categories=Wine; --- wine1.2-1.1.43.orig/debian/wine1.2.postinst +++ wine1.2-1.1.43/debian/wine1.2.postinst @@ -0,0 +1,73 @@ +#!/bin/sh +set -e + +. /usr/share/debconf/confmodule + +# Remove a no-longer used conffile +rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE".dpkg-obsolete ]; then + echo "Removing obsolete conffile $CONFFILE" >&2 + rm -f "$CONFFILE".dpkg-obsolete + fi +} + +case "$1" in + configure|reconfigure) + db_get wine/memory + case "$RET" in + normal) + rm -f /etc/sysctl.d/31-wine.conf + ;; + zeropage) + cat >>/etc/sysctl.d/31-wine.conf <&2 + exit 1 + ;; +esac + + +if [ "$1" = "configure" ] ; then + + if [ -x /usr/sbin/update-binfmts ]; then + /usr/sbin/update-binfmts --import wine || true + fi +fi + +if [ "$1" = "upgrade" ] ; then + if ps -C wineserver > /dev/null && test -d /var/lib/update-notifier/user.d/ ; then + cp -f /usr/share/wine/wineserver-restart-required.update-notifier /var/lib/update-notifier/user.d/wineserver-restart-required + fi +fi + +#DEBHELPER# + --- wine1.2-1.1.43.orig/debian/wine1.2.install.i386 +++ wine1.2-1.1.43/debian/wine1.2.install.i386 @@ -0,0 +1,5 @@ +usr/bin +usr/share +usr/lib/wine +usr/lib/*.so.* +etc/xdg --- wine1.2-1.1.43.orig/debian/ttf-symbol-replacement.dirs +++ wine1.2-1.1.43/debian/ttf-symbol-replacement.dirs @@ -0,0 +1 @@ +usr/share/fonts/truetype/ttf-symbol-replacement/ --- wine1.2-1.1.43.orig/debian/wine1.2-dev.install.i386 +++ wine1.2-1.1.43/debian/wine1.2-dev.install.i386 @@ -0,0 +1,2 @@ +usr/lib/*.so +usr/include --- wine1.2-1.1.43.orig/debian/wine1.2.preinst +++ wine1.2-1.1.43/debian/wine1.2.preinst @@ -0,0 +1,63 @@ +#!/bin/sh +# preinst script for wine +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Prepare to remove a no-longer used conffile +prep_rm_conffile() +{ + PKGNAME="$1" + CONFFILE="$2" + MD5CONF="$3" + if [ -z "$MD5CONF" ]; then + MD5CONF="$CONFFILE" + fi + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$MD5CONF\" | sed -e \"s/ .*//\"`" + # md5sum from the "wine" package + wine_md5sum="6eb1c09e24335b0058c3fc60013f1837" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $MD5CONF'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" != "$old_md5sum" ] && [ "$md5sum" != "$wine_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak" + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + mv -f "$CONFFILE" "$CONFFILE".dpkg-obsolete + fi + fi +} + + +case "$1" in + install|upgrade) + if dpkg --compare-versions "$2" lt 1.1.36-0ubuntu3; then + prep_rm_conffile wine1.2 /etc/sysctl.d/wine.sysctl.conf /etc/sysctl.d/30-wine.conf + prep_rm_conffile wine1.2 /etc/sysctl.d/30-wine.conf + fi + ;; + + abort-upgrade) + # Do nothing + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- wine1.2-1.1.43.orig/debian/rules +++ wine1.2-1.1.43/debian/rules @@ -0,0 +1,171 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +# Rational http://www.winehq.org/pipermail/wine-bugs/2007-July/062505.html +LDFLAGS = +CFLAGS = -Wall -g + + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +# Support passing of parallel= in build options +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) +endif + + +ifeq ($(DEB_BUILD_ARCH), amd64) + # Support for 64-bit windows binaries is disabled for now until + # Wine can be built with both 64 and 32 bit support + # CONFFLAGS += --enable-win64 + + # Wine installs 32 bit libraries, place those into /usr/lib32 + CONFFLAGS += --libdir=\$${prefix}/lib32 +endif + + +config.status: configure + dh_testdir + dh_quilt_patch + # Add here commands to configure the package. + + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info $(CONFFLAGS) + +build: build-stamp +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) depend + $(MAKE) + + # Make the documentation. The dh_installdocs command should install them + # Remember to have the files wine.docs and wine-dev.docs point to any new + # documentation files made + # As of 20050524 as the documentation was split into another package + # and all that's here are the foreign language readmes and the manpages. + # It should be compiled automatically as the package compiles + # $(MAKE) -C documentation txt + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + #-$(MAKE) -C documentation clean + +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + + dh_quilt_unpatch + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp + $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr + + # Create a system-wide Wine Applications folder + mkdir -p $(CURDIR)/debian/tmp/etc/xdg/menus/applications-merged + cp -f $(CURDIR)/debian/wine.menu $(CURDIR)/debian/tmp/etc/xdg/menus/applications-merged + + # Install application-specific desktop files + mkdir -p $(CURDIR)/debian/tmp/usr/share/applications + cp -f $(CURDIR)/debian/wine-uninstaller.desktop $(CURDIR)/debian/tmp/usr/share/applications/ + cp -f $(CURDIR)/debian/wine-notepad.desktop $(CURDIR)/debian/tmp/usr/share/applications/ + cp -f $(CURDIR)/debian/wine-browsedrive.desktop $(CURDIR)/debian/tmp/usr/share/applications/ + cp -f $(CURDIR)/debian/wine-winecfg.desktop $(CURDIR)/debian/tmp/usr/share/applications/ + + mkdir -p $(CURDIR)/debian/tmp/usr/share/desktop-directories/ + cp -f $(CURDIR)/debian/wine-wine.directory $(CURDIR)/debian/tmp/usr/share/desktop-directories/ + cp -f $(CURDIR)/debian/wine-Programs.directory $(CURDIR)/debian/tmp/usr/share/desktop-directories/ + cp -f $(CURDIR)/debian/wine-Programs-Accessories.directory $(CURDIR)/debian/tmp/usr/share/desktop-directories/ + # Drop MIME-sensing .desktop file: execution must use binfmt-support + # Re-enabled for usability purposes, ultimately to be replaced by exe-handler + # rm -f $(CURDIR)/debian/tmp/usr/share/applications/wine.desktop + + # Install icons (uuencoded to allow binary existence in debian/ folder) + # These should be moved to be part of the icon themes upstream, but it hasn't happened yet + cp -f $(CURDIR)/debian/icons.tar.coded $(CURDIR)/debian/tmp + uudecode -o $(CURDIR)/debian/tmp/icons.tar $(CURDIR)/debian/tmp/icons.tar.coded + tar -C $(CURDIR)/debian/tmp -xf $(CURDIR)/debian/tmp/icons.tar + mkdir -p $(CURDIR)/debian/wine1.2/usr/share/icons + mv $(CURDIR)/debian/tmp/icons $(CURDIR)/debian/wine1.2/usr/share/icons/hicolor + # Clean up (so dh_install --fail-missing doesn't complain) + rm $(CURDIR)/debian/tmp/icons.tar + rm $(CURDIR)/debian/tmp/icons.tar.coded + + # Set up binfmt-support file + mkdir -p $(CURDIR)/debian/tmp/usr/share/binfmts + cp $(CURDIR)/debian/wine.binfmt $(CURDIR)/debian/tmp/usr/share/binfmts/wine + + # Set up wineserver restart notificition + mkdir -p $(CURDIR)/debian/tmp/usr/share/wine/ + cp -f $(CURDIR)/debian/wineserver-restart-required.update-notifier $(CURDIR)/debian/tmp/usr/share/wine/ + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + # The changelog was removed upstream in 1.0-rc4 as it was very large + dh_installchangelogs + dh_installdocs -a + dh_installexamples + dh_install --fail-missing --sourcedir=debian/tmp + dh_installmime + dh_installman + dh_installdebconf + dh_link + dh_strip -Xwine-pthread -Xwine-kthread --dbg-package=wine1.2-dbg + dh_compress + dh_fixperms + dh_icons + dh_makeshlibs + dh_installdeb +ifeq ($(DEB_BUILD_ARCH), amd64) + dh_gencontrol -- -V"shlibs:Depends= ia32-libs (>= 1.6), lib32asound2 (>> 1.0.14), libc6-i386 (>= 2.6-1), lib32nss-mdns (>= 0.10-3)" +else + dh_shlibdeps -L wine -l debian/wine/usr/lib + dh_gencontrol +endif + dh_md5sums + dh_builddeb -- -Z lzma + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- wine1.2-1.1.43.orig/debian/wine-winecfg.desktop +++ wine1.2-1.1.43/debian/wine-winecfg.desktop @@ -0,0 +1,39 @@ +[Desktop Entry] +Name=Configure Wine +Name[cs]=Nastavení Wine +Name[sv]=Konfigurera Wine +Name[da]=Konfigurer Wine +Name[de]=Konfiguriere Wine +Name[eu]=Konfiguratu Wine +Name[fi]=Winen asetukset +Name[fr]=Configurer Wine +Name[he]=תצורת Wine +Name[pl]=Konfiguracja Wine +Name[ca]=Configureu el Wine +Name[it]=Configura Wine +Name[lt]=Wine nustatymai +Name[nl]=Wine configureren +Name[hu]=A Wine beállítása +Name[ru]=ÐаÑтройка Wine +Name[el]=ΡÏθμιση Wine +Name[es]=Configurar Wine +Name[pt]=Configurar o Wine +Name[pt_br]=Configurar o Wine +Comment=Change application-specific and general Wine options +Comment[sv]=Ändra programspecifika och allmänna Wine-alternativ +Comment[de]=Ändere Wine Optionen und Applikations-spezifische Einstellungen +Comment[fi]=Muuta yleisiä ja sovelluskohtaisia Winen asetuksia +Comment[pl]=Konfigurowanie ustawieÅ„ aplikacji i ogólnych opcji Wine +Comment[ca]=Canvieu la configuració general del Wine i especifiqueu opcions per a programes concrets +Comment[pt_br]=Configurar as opções do Wine e dos programas nele instalados +Comment[es]=Cambia la configuración de Wine en general o de una aplicación específica +Comment[el]=Αλλαγή γενικών Ïυθμίσεων του Wine ή επιλογών εφαÏμογών +Comment[ru]=Изменение общих параметров Wine и наÑтройка параметров Ð´Ð»Ñ Ð¾Ñ‚Ð´ÐµÐ»ÑŒÐ½Ñ‹Ñ… приложений +Comment[hu]=Alkalmazásspecifikus és általános Wine beállítások módosítása +Comment[it]=Cambia le opzioni delle singole applicazioni e quelle generali di Wine +Comment[nl]=Verander instellingen voor specifieke programma's en Wine in het algemeen +Exec=winecfg +Terminal=false +Icon=wine-winecfg +Type=Application +Categories=Wine; --- wine1.2-1.1.43.orig/debian/wine1.2.links +++ wine1.2-1.1.43/debian/wine1.2.links @@ -0,0 +1 @@ +usr/bin/wine usr/bin/wine-auto --- wine1.2-1.1.43.orig/debian/wine.menu +++ wine1.2-1.1.43/debian/wine.menu @@ -0,0 +1,26 @@ + + + Applications + + wine-wine + wine-wine.directory + + Wine + + + wine-Programs + wine-Programs.directory + + Wine-Programs + + + wine-Programs-Accessories + wine-Programs-Accessories.directory + + Wine-Programs-Accessories + + + + + --- wine1.2-1.1.43.orig/debian/wine1.2.dirs.amd64 +++ wine1.2-1.1.43/debian/wine1.2.dirs.amd64 @@ -0,0 +1,7 @@ +usr/bin +usr/share +usr/share/man +usr/share/man/man1 +usr/share/man/man5 +usr/lib32 +usr/lib32/wine --- wine1.2-1.1.43.orig/debian/wine-uninstaller.desktop +++ wine1.2-1.1.43/debian/wine-uninstaller.desktop @@ -0,0 +1,39 @@ +[Desktop Entry] +Name=Uninstall Wine Software +Name[cs]=Odinstalovat software z Wine +Name[sv]=Avinstallera Wine-programvara +Name[da]=Fjern Wine software +Name[de]=Deinstalliere Wine Applikationen +Name[eu]=Desinstalatu Wine-ko softwarea +Name[fi]=Poista Wine-ohjelmien asennuksia +Name[fr]=Désinstaller un logiciel Wine +Name[he]=הסרת תוכנות מ־Wine +Name[pl]=Deinstalacja oprogramowania Wine +Name[ca]=Elimineu programes del Wine +Name[it]=Disinstalla software di Wine +Name[lt]=PaÅ¡alinti Wine programas +Name[nl]=Wine programma's verwijderen +Name[hu]=Wine szoftverek eltávolítása +Name[ru]=Удаление программ Wine +Name[el]=Απεγκατάσταση Ï€ÏογÏαμμάτων Wine +Name[es]=Desinstala software de Wine +Name[pt]=Desinstalar Programas do Wine +Name[pt_br]=Gerenciador de Programas do Wine +Comment=Uninstall Windows applications for Wine +Comment[sv]=Avinstallera Windows-program för Wine +Comment[de]=Wine Applikations Deinstallations Programm +Comment[fi]=Poista Wineen asennettuja Windows-sovelluksia +Comment[pl]=Deinstalowanie oprogramowania dla Wine +Comment[ca]=Elimineu programes del Windows que hageu instaÅ€lat amb el Wine +Comment[pt_br]=Desinstalar ou Reparar um Programa instalado no Wine +Comment[es]=Desinstala una aplicación Windows en Wine +Comment[el]=Απεγκατάσταση Ï€ÏογÏαμμάτων Windows από το Wine +Comment[ru]=Удаление Windows-программ, уÑтановленных под Wine +Comment[hu]=Windows alkalmazások eltávolítása a Wine-ból +Comment[it]=Disinstalla le applicazioni Windows per Wine +Comment[nl]=Verwijder Windows programma's voor Wine +Exec=wine uninstaller +Terminal=false +Type=Application +Icon=wine-uninstaller +Categories=Wine; --- wine1.2-1.1.43.orig/debian/wine1.2-dev.dirs +++ wine1.2-1.1.43/debian/wine1.2-dev.dirs @@ -0,0 +1,3 @@ +usr/include +usr/include/wine +usr/share/doc/wine-dev --- wine1.2-1.1.43.orig/debian/wine1.2.config +++ wine1.2-1.1.43/debian/wine1.2.config @@ -0,0 +1,15 @@ +#!/bin/sh +set -e +. /usr/share/debconf/confmodule + +# Default to "normal", then read system config +db_set wine/memory normal +if [ -e /etc/sysctl.d/31-wine.conf ]; then + MEM=`egrep '^vm\.mmap_min_addr=[0-9]+$' /etc/sysctl.d/31-wine.conf | cut -d= -f2` + if [ "$MEM" -eq 0 ]; then + db_set wine/memory zeropage + fi +fi + +db_input medium wine/memory || true +db_go || true --- wine1.2-1.1.43.orig/debian/wine-regedit.desktop +++ wine1.2-1.1.43/debian/wine-regedit.desktop @@ -0,0 +1,26 @@ +[Desktop Entry] +Name=Wine RegEdit +Name[ca]=Editor del registre del Wine +Name[el]=Wine RegEdit +Name[es]=Editor del Registro de Wine +Name[hu]=Wine RegEdit +Name[it]=RegEdit di Wine +Name[fi]=Wine RegEdit +Name[nl]=Wine Registereditor +Name[pt_br]=Editor de Registro (do Wine) +Name[ru]=Редактор рееÑтра Wine +Comment=Wine Registry Editor +Comment[ca]=Editeu les entrades del registre del Wine +Comment[el]=ΕπεξεÏγαστής μητÏώου του Wine +Comment[es]=Editor del registro del sistema de Wine +Comment[hu]=Wine rendszerleíróadatbázis-szerkesztÅ‘ +Comment[it]=Editor del registro di sistema di Wine +Comment[fi]=Wine-rekisterieditori +Comment[nl]=Hulpprogramma voor het bewerken van het Wine register +Comment[pt_br]=Edita o Registro do Wine +Comment[ru]=Редактор запиÑей рееÑтра Wine +Exec=regedit +Terminal=false +Type=Application +Icon=wine.xpm +Categories=Wine;Application;Settings;Emulator; --- wine1.2-1.1.43.orig/debian/copyright +++ wine1.2-1.1.43/debian/copyright @@ -0,0 +1,18 @@ +Wine has been 1st debianized by Brian White, first +taken over by Vincent Renardias, then by Andrew Lenharth, then by Ove Kaaven. +This package is currently maintained by Scott Ritchie: scott@open-vote.org + +The Wine homepage is http://www.winehq.com/ +Download locations are listed in the ANNOUNCE file. + +Copyright (c) 1993-2009 the Wine project authors (see the file AUTHORS +for a complete list) + +Wine 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. + +On Debian systems, the complete text of the GNU Lesser General Public +License can be found in /usr/share/common-licenses/LGPL-2.1 file. + --- wine1.2-1.1.43.orig/debian/wineserver-restart-required.update-notifier +++ wine1.2-1.1.43/debian/wineserver-restart-required.update-notifier @@ -0,0 +1,14 @@ +Name: WineServer restart required +Name-hu: A WineServer újraindítása szükséges +Name-el: Απαιτείται επανεκκίνηση του WineServer +Priority: High +Terminal: False +DontShowAfterReboot: True +Description: Wine has been upgraded and you are running wineserver. + Please reboot your computer or restart wineserver. +Description-el: Έγινε αναβάθμιση του Wine. + ΠαÏακαλοÏμε, επανεκκινήστε τον υπολογιστή σας ή το wineserver. +Description-hu: A Wine frissítésre került, és a wineserver jelenleg fut. + Indítsa újra a számítógépet vagy a wineserver programot. +END + --- wine1.2-1.1.43.orig/debian/ttf-symbol-replacement.defoma-hints +++ wine1.2-1.1.43/debian/ttf-symbol-replacement.defoma-hints @@ -0,0 +1,15 @@ +category truetype +begin /usr/share/fonts/truetype/ttf-symbol-replacement/symbol-replacement.ttf + Family = Symbol + FontName = Symbol + Encoding = Unicode + Location = English + Charset = ISO8859-1 + GeneralFamily = SansSerif + Weight = Medium + Width = Variable + Shape = NoSerif Upright + Alias = symbol + Foundry = Wine + Priority = 5 +end --- wine1.2-1.1.43.orig/debian/icons.tar.coded +++ wine1.2-1.1.43/debian/icons.tar.coded @@ -0,0 +1,4099 @@ +begin 644 icons.tar +M:6-O;G,O```````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#`P,#`W-34`,#`P,3#$V +M+V%P<',O```````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````P +M,#`P-S4U`#`P,#$W-3``,#`P,3`IH%@K`0^"%81X[$70MB>OI1<5/(H@Q2#U(GZ`FA:*,;U;&A%- +M7!#MP6+3C1M,_<#5;.L0%5J1S7@P0[-M:BN^R_\-S/O/;V;>@_\,89+B7?J` +M&>#85GIXB+RIDP"71R^=`68.'G?8CK826$V]`?#M^3FVHU=/2MVL.RV-T]Y4 +M0%D56-V3IZP*_.AZV%9?3$L&QXHGW#2P=!@)M)K15[RWPM374`/1$#V[:Q;3M2 +M[/L^;B;%X%B1Q<<97I674:4<0,_(9&/VKP3FY(%T@<5\AKFW"E7*\7/_1CT%O6EVK:P`VC2A;DL0AB&[/Z9Y]*6;^[D&"612&!9%I9E1;IX`T$L%D-K3:U60VN- +ME!*M-4((A!"MVQL1`Z44CN-L.G7&9'T8@XF;MZ^?^H&NU6V]Q82@4"HP#*/85L(/V9.UE\>&7TG;D5KEL^!F#=)PN +M??/VL#%__[N;[Q$0E6I6O1YO=SIHAT((QF+@C.FVJNI<\06.%2B:MEGZ^6,D +M7*]'U_?W<6)O#S$`UV=GV"]-VW#S7F=<&4L^L&I;7_DU`#<5!3.+26F=/=/D +MG#_M2>SU2/E"]C3M=M?\$N.*HA#F\VT?$-Q.&1GSOP0`D,OESOLHMJ24D)Q< +M3J?352_N2`$`%%;S92$X4D;FTE&,UQ_\+2F_27'T`L\$^4+VI*IJRX3@"F/\ +MXI_^CA"\1`A)I8Q,LV\"2NFKR&!D=&3X7'77W*W9CAVP+>=4EQW.^P/Z,(#I +MO@+&V(+M-)>;3>NJ$"+`!2=4)0Y1M(^44L/-_P8O.N#HI[$,7`````!)14Y$ +MKD)@@@`````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````:6-O;G,O,39X,38O87!PV[%X.14C>%&GF=F!_YO9 +MF8%_-`%HU,PP\&R3VI'QF="21LTT@=&S5Q?T_?QC%5LVH``8([D72#XO8DH# +M&6DB+Y[>,W,/IP'J%N#TY5:6++\QLY.GQ#L'P-I:&Q]%"()S#E-P^+A:.';Q +M#DMOG[/[P!BO6_='+;!#C)B0I6(*GC3D_46]`P!4^JL@!H#JKGVT5]X1*%#9 +ML@T-V;`%^I*5#[Q\ +M@_0+9*N@`=4,0HIJR'U8!VM@S][]/)B]#FC1`GYP^Y!BC.`K0.7'>E`DK[W^ +MIC-?AD8.LC#7C*11,Y>`^E^>0;US!WKDQ'F6YYM=J>*=A[A[ZPKC,T%L)^FC +M,CWQUJX`SD??XY\`)8C[NP*8J+@1X$H]V"X!J?M=!W&5X'O_(,WW$8+\`K#E +M:],3Q\]L9OQ?$[W!_[!OX-*'S!,II;0`````245.1*Y"8((````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````:6-O;G,O,39X,38O87!P"TC:)21<5@E5ITY>&($1$.C-N9H8Q +M'>O"L_NYYYQ[[[D__"<$YR.=4:*`"LCQ6"+W%TTTG5%LCMA25/NO]@.HIIFK +M^/JU`BZ;NBZ1F%^3BB\+P+(.P4KM'2P$>F[2+E28;GV!2`9CR7N_O.,3KS*OS1* +ME1+=)WLHE@N8$TP"NJM!,)(Z#-2L]Y603M<)B:-'CM%L-GDW]Q:W-3Q.\?AP +MF+Y0)QT!+]F938ZW?TLN?5XZUWVJAX`_P$IM^?*%\/GYZ:G75<``$(.15!=0 +M>S0F,UM>9+:\2,=!'P#FWG(N_P))DCA[NM?Z9'8>(E`<'PXS]:;$EJ8C[O.S +M46_:(YHCR]DGCSG0[N=,J!=@S&D`P.Y='O;X#O'SQR^R^06`<*M)+J]2_5C] +M(VP18&7C._M]`=KV>G@^\P$@_&ER=-I)-$V2:^NK"T#2OD(PDKH$3#BXV\0[ +MX3;[CP:```"I$E$050X +MC8633VQ4513&?W?NFRG%@2&$#*5:FL9"X%E271@V8*(DC8:@$#43""O"`L** +M/UOV+M"-<6GBQJ2--4`")DTT&A?&P,K*V*G&%*:Q#C"9SILI,]/W[CV'Q6AG +M("9^BW-6WR_G^W*O457^3Q]_F\> +M[SVO3KZ&]YYZO<[``YM`.[?O(IOKX&"=@>H\DFMO0BB(#S)%&Q+PN(=ZS\OL3PZ#A/!@<9S.?QSE%WBE%C-@"J +M"LZC<=)S`\,[+'>3)J5*A>^:3;)11!XX>/1M,'7M`410Y]'8=6$X5!P3>5@Z +M>9P'-[YG$GC16L9.GZ(\MI,]R]=]#^`2-.[@GT2@'L2C.#:Y#D?'A6_>>PM] +M9XK`6E8RGJF1.Y1+C]@`)&LUI!7A5LNH6P>)4>\!)6/@2'Z56]4W4%6.[?B) +M34D+];X78>VO$JZQ'U>K]%?P[R)K8EZP;42$;+**QB`B_1UX-'%H9[W_1='_ +M4[9('5%!.G&W)U7Z.I!N@9V8?L5DN!>\3I+=3HB6^UC#:RU +ME9F9F:$A,A3GOD*E2U915(0_1]YE]^1A]@WE65HNTXX]8^,AU?H$I48@1E4Q +MQNP"1H$&S^F5B3#WP8?O7QQY:>1`+K=MF[6I5*U6:RTNEN8KE8?GGP+XAVCJ +MOH04CP````!)14Y$KD)@@@`````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````!I8V]N&UL +M;G,](FAT='`Z+R]W=W&UL;G,Z:6YK +M#$](C(W+C(Q-C6QE/2)S=&]P+6-O;&]R.B-F9F9F9F8[6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[ +M6QE/2)S=&]P+6-O;&]R.B,S-S,W +M,S<[6QE +M/2)S=&]P+6-O;&]R.B-F9F9F9F8[6QE/2)S=&]P+6-O;&]R.B-E-#`P,#`[&QI;FLZ:')E9CTB(VQI;F5A#$](C,P+C,W-C`W."(* +M("`@("`@('DQ/2(R-2XR-S`S-CDB"B`@("`@("!X,CTB,C(B"B`@("`@("!Y +M,CTB,3DB"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0S,C`V(@H@("`@("`@ +M>&QI;FLZ:')E9CTB(VQI;F5A"@Q+C4T,SDU-C,L,"PP+#$N-30R.#(R,RPM,3,N,#`R +M-S4T+"TQ,2XW.#4R-S@I(B`O/@H@("`@/&QI;F5A&QI;FLZ:')E9CTB(VQI;F5A"@Q+C4U,3,R.2PP+#`L,2XU,CDS-#DL+3$S+C(S +M,3@Y-"PM,3$N.#8R.3,Q*2(@+SX*("`@(#QL:6YE87)'#$](C(Y+C0U-#4U.2(*("`@("`@('DQ/2(Q.2XQ,C$X-S@B"B`@("`@ +M("!X,CTB,C$N-#,Y-S4Q(@H@("`@("`@>3(](CDN,C#$](C$W+C8P +M-#8Q-B(*("`@("`@('DQ/2(Q."XS,3(U(@H@("`@("`@>#(](C(S(@H@("`@ +M("`@>3(](C$X+C,Q,C4B"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0S,C&QI;FLZ:')E9CTB(VQI;F5A"@R+C,X-C8U.3#TB+3`N,#8W,3DY.3DX(@H@("`@ +M("`@:60](F9I;'1E7,B("\^"B`@("`\+V9I;'1E3TB+3`N,30P,#@T.3#TB+3`N,#3(](C(U+C4B"B`@("`@("!I9#TB;&EN96%R1W)A9&EE +M;G0S-#0P(@H@("`@("`@>&QI;FLZ:')E9CTB(VQI;F5A3(] +M(C(W(@H@("`@("`@:60](FQI;F5A#TB,3@B"B`@("`@("!C>3TB,30N +M,3@Y-S$B"B`@("`@("!R/2(U+C4P-30Y,#@B"B`@("`@("!F>#TB,3@B"B`@ +M("`@("!F>3TB,30N,3@Y-S$B"B`@("`@("!I9#TB&QI;FLZ:')E9CTB(VQI;F5A&QI;FLZ:')E9CTB(VQI;F5A65R."(^ +M"B`@("`\<&%T:`H@("`@("`@9#TB32`U,BPS,RXQ.#3IN;VYE.W-T"@P+C6QE/2)D:7-P;&%Y.FEN;&EN92(@+SX*("`\+V<^ +M"B`@/&<*("`@("!I9#TB;&%Y97(T(@H@("`@('-T>6QE/2)D:7-P;&%Y.FEN +M;&EN92(^"B`@("`\<&%T:`H@("`@("`@9#TB32`R-RXT,S3HP+C([9FEL;#HC,#`P,#`P.V9I;&PM;W!A8VET>3HQ +M.W-T3HQ.V1I#MS=')O:V4M +M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO:6XZ;6ET97([6QE/2)O<&%C:71Y.C$[9FEL;#IU3IN;VYE.W-T3HQ.V9I;&PM6QE/2)F:6QL.G5R;"@C3HQ +M(B`O/@H@("`@/'!A=&@*("`@("`@(&0](DT@,C#MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO +M:6XZ;6ET97([3HQ.V9I;&PM3HQ.W-T6QE/2)D:7-P;&%Y.FEN;&EN92(^"B`@("`\<&%T +M:`H@("`@("`@9#TB32`R,BPS,"!#(#(R+#,P(#(R+C4L,S$@,C0L,S`N.34X +M.#0@0R`R-2XU+#,P+CDQ-S8X(#(V+#,P(#(V+#,P(@H@("`@("`@:60](G!A +M=&@S,SDU(@H@("`@("`@#MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO:6XZ3HQ.V9I;&PM#MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M +M;&EN96IO:6XZ6QE/2)D:7-P;&%Y.FEN;&EN92(^"B`@ +M("`\<&%T:`H@("`@("`@9#TB32`S,2XW-38V-#4L-"XQ.34R,S,U($,@,S`N +M.3@P.3@L,2XY,#$R,2`Q-RXP,3DP,BPQ+CDP,3(Q(#$V+C(T,S,U-2PT+C$Y +M-3(S,S4@0R`Q-BXR-#,S-34L-BXT.#DR-38Y(#$S+CDQ-C,V,BPQ,RXS-S$S +M,C<@,3,N.3$V,S8R+#$Y+C0X.#&UL;G,Z&UL;G,Z:6YK#TB-C`U+C3TB-#@V+C8T-S@Y(@H@("`@("`@:60](G)A9&EA;$=R861I96YT-C#TB-C`U+C6QE/2)S=&]P+6-O;&]R +M.B,P,#`P,#`[6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[#(](C,P,BXX-3&QI;FLZ:')E9CTB(VQI;F5A6QE/2)S=&]P +M+6-O;&]R.B,P,#`P,#`[6QE/2)S=&]P+6-O;&]R.B-A,S9D,3@[6QE/2)S=&]P+6-O;&]R.B-A,#8W,&,[6QE/2)S=&]P+6-O;&]R +M.B-F9F9F9F8[6QE +M/2)S=&]P+6-O;&]R.B-E86)A-F8[6QE/2)S=&]P+6-O;&]R.B-D-SDP,C`[#(](C$W+C8Y +M-C$V.2(*("`@("`@('DR/2(Q,BXS,S,V,S(B"B`@("`@("!I9#TB;&EN96%R +M1W)A9&EE;G0R,C8Y(@H@("`@("`@>&QI;FLZ:')E9CTB(VQI;F5A3$](C$T+C8V,34U-R(*("`@("`@('@R/2(T-RXP-C4X,S0B +M"B`@("`@("!Y,CTB,34N,C8W-C0Y(@H@("`@("`@:60](FQI;F5A#$](C(U+C,X,3(U-B(*("`@ +M("`@('DQ/2(R-"XW,C`V-#@B"B`@("`@("!X,CTB,C0N,3$Y,38W(@H@("`@ +M("`@>3(](C$V+C$W,#,W(@H@("`@("`@:60](FQI;F5A#(](C,T+C$Y +M,S8T,B(*("`@("`@('DR/2(Q,BXV,S8V-C&QI;FLZ:')E9CTB(VQI;F5A#(](C(R+C`W,3@P-B(*("`@("`@('DR/2(Q-BXP,C`V.34B"B`@ +M("`@("!I9#TB;&EN96%R1W)A9&EE;G0R,C@R(@H@("`@("`@>&QI;FLZ:')E +M9CTB(VQI;F5A3$](C$Y+CDQ,C,S-B(*("`@("`@ +M('@R/2(S,"XP,30X,3(B"B`@("`@("!Y,CTB-##$] +M(C(T+CDY,#0Y.2(*("`@("`@('DQ/2(S-"XP,#0X-38B"B`@("`@("!X,CTB +M,C0N.3DP-#DY(@H@("`@("`@>3(](C(R+C4X-3(Q,2(*("`@("`@(&ED/2)L +M:6YE87)'#TB,C,N.30S-C3TB,C`N.#`P,C@W +M(@H@("`@("`@:60](G)A9&EA;$=R861I96YT,C@Y-B(*("`@("`@('AL:6YK +M.FAR968](B-L:6YE87)'#TB,C$N-3&QI;FLZ +M:')E9CTB(VQI;F5A"@P+C#TB,C,N.30S-C3TB,C`N.#`P,C@W(@H@ +M("`@("`@:60](G)A9&EA;$=R861I96YT,CDP-B(*("`@("`@('AL:6YK.FAR +M968](B-L:6YE87)'#TB,C$N-3&QI;FLZ:')E +M9CTB(VQI;F5A#(](C(R(@H@("`@("`@ +M>3(](C$Y(@H@("`@("`@:60](FQI;F5A3(](CDN,C&QI;FLZ:')E9CTB(VQI;F5A +M#TB,C#$](C(Y(@H@("`@("`@>3$](C,S(@H@("`@("`@>#(](C$Y(@H@ +M("`@("`@>3(](C(W(@H@("`@("`@:60](FQI;F5A3TB,C8N-33TB +M,C8N-33$](C$X+C,Q,C4B"B`@("`@("!X,CTB,C,B"B`@("`@("!Y,CTB,3@N,S$R +M-2(*("`@("`@(&ED/2)L:6YE87)'&QI +M;FLZ:')E9CTB(VQI;F5A"@Q+C`S-#(Q.30L,"PP+#$N,#$Y-38V+"TW+CDS-C8P,3&QI;FLZ:')E9CTB +M(VQI;F5A#$](C$V(@H@("`@ +M("`@>3$](C(W(@H@("`@("`@>#(](C(Q+C4B"B`@("`@("!Y,CTB,C&QI;FLZ:')E +M9CTB(VQI;F5A#(](C(P+C4B"B`@("`@("!Y,CTB,C4N-2(*("`@("`@(&ED/2)L:6YE +M87)'#$](C(W+C(Q-C&QI;FLZ:')E9CTB(VQI;F5A"@Q+#`L,"PP+C0Y-3`P,C4L,"PU+C4U-#DW,C4I(B`O +M/@H@("`@/')A9&EA;$=R861I96YT"B`@("`@("!C>#TB,S#TB +M,S&QI;FLZ:')E9CTB(VQI;F5A6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[#TB+3`N,#8W,3DY.3DX(@H@("`@("`@=VED=&@](C$N,3,T-"(*("`@("`@ +M('D](BTP+C$V."(*("`@("`@(&AE:6=H=#TB,2XS,S8B/@H@("`@("`\9F5' +M875S6QE/2)S=&]P+6-O;&]R.B,V83`P,#`[6QE/2)S=&]P+6-O;&]R.B-E-#`P,#`[ +M6QE/2)S +M=&]P+6-O;&]R.B-F9F9F9F8[6QE +M/2)S=&]P+6-O;&]R.B,S-S,W,S<[6QE/2)S=&]P+6-O;&]R.B,S-S,W +M,S<[6QE/2)S=&]P+6-O;&]R.B,P +M,#`P,#`[6QE/2)S=&]P+6-O;&]R.B,T.3`P,#`[65R,2(^"B`@("`\9PH@("`@("`@=')A +M;G-F;W)M/2)M871R:7@H,BXQ,#4T-C%E+3(L,"PP+#(N,#@V-S4X92TR+#0R +M+C8P,3F5R;SMS=')O:V4Z;F]N93MS +M=')O:V4M=VED=&@Z,3MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN +M96IO:6XZ;6ET97([;6%R:V5R.FYO;F4[;6%R:V5R+7-T87)T.FYO;F4[;6%R +M:V5R+6UI9#IN;VYE.VUA3IV:7-I8FQE.V1I6QE/2)O +M<&%C:71Y.C`N-#`R,#8Q.#4[9FEL;#IU3HQ.W9IB(*("`@("`@("`@:60](G!A=&@V-S$S(@H@("`@("`@("!S +M='EL93TB;W!A8VET>3HP+C0P,C`V,3@U.V9I;&PZ=7)L*"-R861I86Q'3HQ.V9I;&PM3IN;VYE.W-T3IN;VYE.W-T3TB,2XR +M.#0V.#@R(@H@("`@("`@>#TB."XT.3@Y.3DV(@H@("`@("`@>3TB,38N,C0S +M-CDX(@H@("`@("`@:60](G)E8W0T,C(P(@H@("`@("`@3IN;VYE.W-TB(*("`@("`@(&ED/2)P +M871H-#$V,B(*("`@("`@('-T>6QE/2)F:6QL.G5R;"@C;&EN96%R1W)A9&EE +M;G0R,C@P*3MF:6QL+6]P86-I='DZ,3MF:6QL+7)U;&4Z979E;F]D9#MS=')O +M:V4Z=7)L*"-L:6YE87)'6QE/2)O<&%C:71Y.C$[9FEL +M;#IU3HQ.W9IB(*("`@("`@(&ED/2)P871H-#DU-"(*("`@("`@('-T +M>6QE/2)O<&%C:71Y.C$[9FEL;#IN;VYE.V9I;&PM;W!A8VET>3HQ.V9I;&PM +M6QE/2)O<&%C:71Y.C$[9FEL;#IU3HQ.W9I6QE/2)O<&%C +M:71Y.C$[9FEL;#IUB(*("`@("`@("`@:60] +M(G!A=&@R.3`R(@H@("`@("`@("!S='EL93TB;W!A8VET>3HQ.V9I;&PZ=7)L +M*"-R861I86Q'3HQ.V9I;&PM3IN +M;VYE.W-T3II;FQI;F4[;W9EB(*("`@("`@("`@:60](G!A=&@R.3`T(@H@ +M("`@("`@("!S='EL93TB;W!A8VET>3HQ.V9I;&PZ=7)L*"-R861I86Q'3HQ.V9I;&PM3IN;VYE.W-T3II;FQI;F4B("\^"B`@("`@(#QG"B`@("`@("`@(&ED/2)L87EE6QE/2)D:7-P;&%Y.FEN;&EN92(@+SX*("`@("`@/&<*("`@ +M("`@("`@:60](FQA>65R,B(*("`@("`@("`@3IN;VYE.W-T3HQ.V1I +M6QE/2)F:6QL +M.G5R;"@C#MS +M=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO:6XZ;6ET97([3HQ.V9I;&PM3HQ.V1I6QE/2)F +M:6QL.G5R;"@C3HQ.V1IB(*("`@("`@("`@("!I9#TB<&%T:#$P,#,R(@H@ +M("`@("`@("`@('-T>6QE/2)F:6QL.FYO;F4[9FEL;"UR=6QE.F5V96YO9&0[ +M3II;FQI;F4B("\^"B`@("`@("`@ +M/'!A=&@*("`@("`@("`@("!D/2)-(#$R+C(S,#8W-RPT+C8V-C8V-CD@3"`Q +M-2XS,S,S,S0L-"XV-C8V-C8Y($,@,34N,S,S,S,T+#0N-C8V-C8V.2`Q,RXW +M.#(P,#4L,3`N-S@T,#8S(#$S+CB(* +M("`@("`@("`@("!I9#TB<&%T:#,R-C8B"B`@("`@("`@("`@6QE/2)F:6QL.FYO;F4[9FEL;"UO<&%C:71Y.C$[3IN;VYE.W-T3II;FQI;F4B("\^"B`@("`@("`@/'!A=&@*("`@("`@("`@ +M("!D/2)-(#(Q+C`P,#`P,2PS+CDV-#DW-S4@0R`R,"XV-C8V-C@L-"XR.3@S +M,3`Y(#$X+C8Y,C(Q+#0N-C8T.3$R,B`Q-2XX,S6QE/2)F:6QL.FYO;F4[9FEL;"UO<&%C:71Y.C$[6QE/2)F:6QL.FYO;F4[9FEL;"UO<&%C:71Y.C$[ +M6QE/2)O<&%C:71Y.C`N,S4[9FEL;#IN;VYE.V9I;&PM3II;FQI;F4B("\^"B`@("`@ +M("`@/'!A=&@*("`@("`@("`@("!D/2)-(#B(*("`@("`@("`@("!T3HQ.V9I;&PM#MS=')O:V4M +M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO:6XZ6QE/2)F:6QL.FYO;F4[9FEL;"UO<&%C:71Y.C$[9FEL;"UR=6QE +M.F5V96YO9&0[&UL;G,Z>&QI;FL](FAT='`Z+R]W +M=W&QI;FLB"B`@('AM;&YS.FEN:W-C87!E/2)H='1P +M.B\O=W=W+FEN:W-C87!E+F]R9R]N86UE6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[6QE +M/2)S=&]P+6-O;&]R.B-C.6,Y8SD[6QE/2)S=&]P+6-O;&]R.B-E-V4R8C@[6QE/2)S=&]P+6-O;&]R.B-F9C%D,60[6QE/2)S +M=&]P+6-O;&]R.B,V9C`P,#`[6QE +M/2)S=&]P+6-O;&]R.B-A,V$T83`[6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[6QE/2)S=&]P+6-O;&]R.B-D9F1F9&8[#TB+3`N,#3TB+3`N,38X(@H@("`@("`@:&5I9VAT/2(Q+C,S-B(^ +M"B`@("`@(#QF94=A=7-S:6%N0FQU<@H@("`@("`@("!I;FMS8V%P93IC;VQL +M96-T/2)A;'=A>7,B"B`@("`@("`@('-T9$1E=FEA=&EO;CTB,"XQ-"(*("`@ +M("`@("`@:60](F9E1V%U6QE/2)S=&]P+6-O;&]R.B,T.3`P,#`[6QE/2)S=&]P+6-O;&]R.B-F9F9F9F8[6QE/2)S=&]P+6-O;&]R.B-C +M9F-F8V8[6QE/2)S +M=&]P+6-O;&]R.B,W,S6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[6QE/2)S=&]P+6-O;&]R.B-F9F9F9F8[#TB,C#$](C(W+C8X,#&QI;FLZ:')E9CTB(VQI;F5A#TB,C8N-C(U(@H@("`@("`@8WD](C(V+C4W-S,X +M,2(*("`@("`@('(](C$R+C4B"B`@("`@("!F>#TB,C8N-C(U(@H@("`@("`@ +M9GD](C(V+C4W-S,X,2(*("`@("`@(&ED/2)R861I86Q'&QI;FLZ:')E9CTB(VQI;F5A#$](C(W+C(Q-C#(](C(R(@H@("`@("`@>3(](C$Y(@H@("`@("`@:60](FQI +M;F5A3(] +M(C(U+C4B"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0Q,C,T,R(*("`@("`@ +M('AL:6YK.FAR968](B-L:6YE87)'&QI;FLZ:')E9CTB(VQI +M;F5A#(](C,P,BXX-3#TB-C`U +M+C3TB-#@V+C8T +M-S@Y(@H@("`@("`@:60](G)A9&EA;$=R861I96YT,3(T-38B"B`@("`@("!X +M;&EN:SIH#TB-C`U+C&QI;FLZ:')E9CTB(VQI;F5A"@M,BXW-S0S.#DL,"PP+#$N.38Y-S`V+#$Q,BXW +M-C(S+"TX-S(N.#@U-"DB("\^"B`@("`\3TB-#`N-#,W +M-2(*("`@("`@(&ED/2)R861I86Q'&QI +M;FLZ:')E9CTB(VQI;F5A"@Q+#`L,"PP+C,T.#(T,RPP+#(V+C,U-30S*2(@+SX*("`@ +M(#QL:6YE87)'#$](C8B"B`@("`@("!Y,3TB-RXU +M-C(U(@H@("`@("`@>#(](C0P+CDX-#,W-2(*("`@("`@('DR/2(W+C4V,C4B +M"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0Q,C4Q,"(*("`@("`@('AL:6YK +M.FAR968](B-L:6YE87)'3$](C0R+C@S,S,W +M(@H@("`@("`@>#(](C$T+C(X,S8T,B(*("`@("`@('DR/2(V+C@S,S,V.#,B +M"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0Q,C4Q-B(*("`@("`@('AL:6YK +M.FAR968](B-L:6YE87)'#$](C(V+C8Q,C0Q-R(*("`@("`@ +M('DQ/2(R."XP.#,S-C@B"B`@("`@("!X,CTB,C8N,C(X-#`Q(@H@("`@("`@ +M>3(](C0R+C@S,S,W(@H@("`@("`@:60](FQI;F5A#$](C0X+CDP-C(U(@H@("`@("`@ +M>3$](C$W+C,W-C$X-"(*("`@("`@('@R/2(U,"XY.#@S,S4B"B`@("`@("!Y +M,CTB,C(N,C4P-3DQ(@H@("`@("`@:60](FQI;F5A#(](C0W+C8X-S4B"B`@("`@("!Y,CTB,C(N-C(U +M(@H@("`@("`@:60](FQI;F5A#$](C(U+C3$](C,Q +M+C`T-C@W-2(*("`@("`@('@R/2(R-2XU,30U.#DB"B`@("`@("!Y,CTB,S`N +M-S`S,3(U(@H@("`@("`@:60](FQI;F5A#TB+3$U-3DN,C4R,R(*("`@("`@ +M("`@>3TB+3$U,"XV.38X-2(*("`@("`@("`@:60](G)E8W0V-S`Y(@H@("`@ +M("`@("!S='EL93TB;W!A8VET>3HP+C0P,C`V,3@U.V9I;&PZ=7)L*"-L:6YE +M87)'F5R;SMS=')O:V4Z;F]N93MS=')O:V4M=VED=&@Z,3MS=')O:V4M;&EN96-A +M<#IR;W5N9#MS=')O:V4M;&EN96IO:6XZ;6ET97([;6%R:V5R.FYO;F4[;6%R +M:V5R+7-T87)T.FYO;F4[;6%R:V5R+6UI9#IN;VYE.VUA3IV:7-I8FQE.V1I6QE/2)O<&%C:71Y.C`N-#`R,#8Q.#4[9FEL;#IU3HQ.V9I;&PM3IN +M;VYE.W-T3II;FQI;F4[;W9E3HQ.W9I3HP+C,Q +M-33IN;VYE.W-T#TB-"XY-S`Y.#@X(@H@("`@("`@>3TB,SDN.#8X,C3IN;VYE.W-TB(*("`@("`@(&ED/2)P871H,CDQ-2(*("`@("`@ +M('-T>6QE/2)F:6QL.G5R;"@C;&EN96%R1W)A9&EE;G0Q,C4Q,"D[9FEL;"UO +M<&%C:71Y.C$[9FEL;"UR=6QE.F5V96YO9&0[3IV:7-I8FQE.V1IB(*("`@("`@(&ED/2)P871H,CDQ-R(* +M("`@("`@('-T>6QE/2)O<&%C:71Y.C`N-#,X-3DV-#@[9FEL;#IN;VYE.V9I +M;&PM;W!A8VET>3HQ.V9I;&PM3IV:7-I8FQE.V1I3IN;VYE.W-T3IV:7-I8FQE.V1I3TB +M,2(*("`@("`@("`@>#TB,38N-2(*("`@("`@("`@>3TB,BXU(@H@("`@("`@ +M("!I9#TB6QE/2)O<&%C:71Y.C$[9FEL +M;#HC9F-E.31F.V9I;&PM;W!A8VET>3HQ.V9I;&PM#TB,2(*("`@("`@("`@3IN;VYE.W-T3IV:7-I8FQE.V1I3TB,2(*("`@("`@("`@>#TB,C@N-2(*("`@("`@("`@>3TB,BXU(@H@("`@ +M("`@("!I9#TB6QE/2)O<&%C:71Y.C$[ +M9FEL;#HC9F-E.31F.V9I;&PM;W!A8VET>3HQ.V9I;&PM#TB,2(*("`@("`@("`@3IN;VYE.W-T3IV:7-I8FQE.V1I6QE/2)O<&%C:71Y.C`N +M,C@P-S`Q-S8[9FEL;#HC,#`P,#`P.V9I;&PM;W!A8VET>3HQ.V9I;&PM#TB.2(*("`@("`@("`@>3TB,30N.3@Q +M-SDR(@H@("`@("`@("!I9#TB6QE/2)O +M<&%C:71Y.C`N,C@P-S`Q-S8[9FEL;#HC,#`P,#`P.V9I;&PM;W!A8VET>3HQ +M.V9I;&PM#TB.2(*("`@("`@("`@ +M>3TB,3@N,#`S.3,Y(@H@("`@("`@("!I9#TB6QE/2)O<&%C:71Y.C`N,C@P-S`Q-S8[9FEL;#HC,#`P,#`P.V9I;&PM +M;W!A8VET>3HQ.V9I;&PM#TB.2(* +M("`@("`@("`@>3TB,C(N.3@U-S,Q(@H@("`@("`@("!I9#TB6QE/2)O<&%C:71Y.C`N,C@P-S`Q-S8[9FEL;#HC,#`P +M,#`P.V9I;&PM;W!A8VET>3HQ.V9I;&PM#TB.2(*("`@("`@("`@>3TB,C8N,#`W.#6QE/2)O<&%C:71Y.C`N,C@P-S`Q-S8[ +M9FEL;#HC,#`P,#`P.V9I;&PM;W!A8VET>3HQ.V9I;&PM#TB.2(*("`@("`@("`@>3TB,CDN,#,P,#(T(@H@("`@ +M("`@("!I9#TB6QE/2)O<&%C:71Y.C`N +M,C@P-S`Q-S8[9FEL;#HC,#`P,#`P.V9I;&PM;W!A8VET>3HQ.V9I;&PM3II;FQI;F4[;W9E6QE/2)F:6QL.B-C8CDP,C([9FEL;"UO +M<&%C:71Y.C$[9FEL;"UR=6QE.F5V96YO9&0[3IV:7-I8FQE.V1I6QE/2)F:6QL.G5R;"@C +M;&EN96%R1W)A9&EE;G0Q,C4S,RD[9FEL;"UO<&%C:71Y.C$[9FEL;"UR=6QE +M.F5V96YO9&0[3IV:7-I8FQE.V1IB(*("`@("`@ +M("`@:60](G!A=&@R.38R(@H@("`@("`@("!S='EL93TB9FEL;#IU3HQ.V9I;&PMB(*("`@("`@("`@:60](G!A=&@R.3@R(@H@("`@("`@("!S='EL93TB9FEL +M;#IU3HQ.V9I +M;&PM6QE/2)F:6QL.G5R;"@C;&EN96%R1W)A9&EE;G0Q,C4S.2D[9FEL;"UO +M<&%C:71Y.C$[9FEL;"UR=6QE.F5V96YO9&0[3IV:7-I8FQE.V1I6QE/2)F:6QL.B-F +M9F9F9F8[9FEL;"UO<&%C:71Y.C`N,S8S-C,V,SD[9FEL;"UR=6QE.F5V96YO +M9&0[3IV +M:7-I8FQE.V1I6QE/2)F:6QL.B,P,#`P,#`[9FEL;"UO<&%C:71Y.C`N +M,S8S-C,V,SD[9FEL;"UR=6QE.F5V96YO9&0[3IV:7-I8FQE.V1I6QE/2)D:7-P;&%Y.FEN +M;&EN92(@+SX*("`@("`@/"]G/@H@("`@("`\9PH@("`@("`@("!I9#TB;&%Y +M97(T(@H@("`@("`@("!S='EL93TB9&ES<&QA>3II;FQI;F4B("\^"B`@("`@ +M(#QG"B`@("`@("`@(&ED/2)G,3(Q.30B"B`@("`@("`@('-T>6QE/2)D:7-P +M;&%Y.FEN;&EN92(@+SX*("`@("`@/&<*("`@("`@("`@:60](FQA>65R,R(* +M("`@("`@("`@3HP+C`W,#`P,#`R.V9I;&PZ=7)L*"-R +M861I86Q'3IN;VYE.W-T3HQ +M.V1I6QE/2)F +M:6QL.G5R;"@C#MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO:6XZ;6ET97([ +M3HQ.V9I;&PM3HQ.V1I6QE +M/2)F:6QL.G5R;"@C3IN;VYE.W-T3II;FQI;F4B("\^ +M"B`@("`@("`@/'!A=&@*("`@("`@("`@("!D/2)-(#(P+C4Y,S3HQ.V9I;&PM3HQ.V1I3HQ.V1I#MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO +M:6XZ3II;FQI;F4[9FEL=&5R.G5R;"@C9FEL +M=&5R,S,Y,2DB("\^"B`@("`@("`@/'!A=&@*("`@("`@("`@("!D/2)-(#(Q +M+C$W,3`Y."PR+C3HQ(B`O/@H@("`@("`\+V<^"B`@("`\+V<^"B`@/"]G +M/@H\+W-V9SX*```````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````&EC;VYS+W-C86QA8FQE+V%P<',O=VEN92UW:6YE8V9G+G-V9P`` +M```````````````````````````````````````````````````````````` +M```````````````````````P,#`P-C0T`#`P,#$W-3``,#`P,3&UL;G,Z>&QI;FL](FAT='`Z+R]W=W&QI;FLB"B`@ +M('AM;&YS.FEN:W-C87!E/2)H='1P.B\O=W=W+FEN:W-C87!E+F]R9R]N86UE +M6QE/2)D:7-P +M;&%Y.FEN;&EN92(^"B`@/&1E9G,*("`@("!I9#TB9&5F6QE +M/2)S=&]P+6-O;&]R.B-E965E96,[6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[6QE/2)S=&]P+6-O;&]R.B-F +M9F9F9F8[6QE/2)S +M=&]P+6-O;&]R.B-E965E96,[6QE/2)S=&]P+6-O;&]R.B,R.35E860[6QE/2)S=&]P+6-O;&]R.B-F9F9F9F8[&QI;FLZ:')E9CTB(VQI +M;F5A6QE/2)S=&]P+6-O;&]R.B-F9F9F9F8[ +M#$](BTU+C#(](BTQ,BXV.3$V +M.#(B"B`@("`@("!Y,CTB-#0N-3$T-C#$](CDT(@H@("`@ +M("`@>3$](C0S+C(T,#@Y-"(*("`@("`@('@R/2(Y-"(*("`@("`@('DR/2(T +M,"XW-C8P,3@B"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0T,S8S(@H@("`@ +M("`@>&QI;FLZ:')E9CTB(VQI;F5A#$](CDY+C8X +M-C,V,R(*("`@("`@('DQ/2(W+C8Q-#4T-#DB"B`@("`@("!X,CTB-S4N,#,Y +M.33(](C$V+C(V,#DS,2(*("`@("`@(&ED/2)L:6YE87)' +M6QE/2)S=&]P+6-O;&]R.B,X.#AA.#4[3(](C0P+CDT,S6QE/2)S=&]P+6-O;&]R.B-D +M,V0W8V8[&QI;FLZ:')E9CTB(VQI;F5A6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[#TB +M,C$N.38P-#@B"B`@("`@("!F>3TB,S0N-#DX,S4V(@H@("`@("`@:60](G)A +M9&EA;$=R861I96YT-#,T.2(*("`@("`@('AL:6YK.FAR968](B-L:6YE87)' +M6QE/2)S=&]P+6-O;&]R.B-E.#`P,#`[6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[6QE/2)S=&]P+6-O;&]R.B,P,#`P,#`[ +M6QE/2)S +M=&]P+6-O;&]R.B,S-S,W,S<[6QE +M/2)S=&]P+6-O;&]R.B,S-S,W,S<[6QE/2)S=&]P+6-O;&]R.B,T.3`P,#`[6QE/2)S=&]P+6-O;&]R.B-F9#`P,#`[6QE/2)S=&]P+6-O +M;&]R.B,P,#`P,#`[#TB,C$N.38P-#@B"B`@ +M("`@("!C>3TB,S0N-#DX,S4V(@H@("`@("`@&QI;FLZ:')E9CTB +M(VQI;F5A#$](C(T+C4Q.#$S-2(*("`@ +M("`@('DQ/2(R,BXT,CDT.3DB"B`@("`@("!X,CTB,C4N.3$P-C,Q(@H@("`@ +M("`@>3(](C(S+C@S,3(X-"(*("`@("`@(&ED/2)L:6YE87)'&QI;FLZ:')E9CTB(VQI;F5A#(](BTQ+C`T.3(R-C,B"B`@ +M("`@("!Y,CTB-#$N,3,W-S#$](C4S+C4X.3(V(@H@("`@("`@>3$](C,R+C@U +M-C@S-"(*("`@("`@('@R/2(V.2XY-S8S.34B"B`@("`@("!Y,CTB-#0N.38P +M-#(V(@H@("`@("`@:60](FQI;F5A3$](C,W+C$R-C8Q-R(*("`@("`@ +M('@R/2(M.2XY,#0S,C,V(@H@("`@("`@>3(](C,V+C@T.#(T."(*("`@("`@ +M(&ED/2)L:6YE87)'&QI;FLZ:')E9CTB +M(VQI;F5A#$](BTX+CDS-S4B +M"B`@("`@("!Y,3TB-#`N,S#(](BTW(@H@("`@("`@>3(] +M(C0P+C,W-2(*("`@("`@(&ED/2)L:6YE87)'&QI;FLZ:')E9CTB(VQI;F5A"@P+C0S,38Q,C8L,"PP+#`N-3DY,S0Q,RPR-BXY +M-S#(](C4Y+C,U,#$P,2(*("`@("`@('DR/2(S-RXU,#4U,38B"B`@("`@("!I +M9#TB;&EN96%R1W)A9&EE;G0Q,#@Q-B(*("`@("`@('AL:6YK.FAR968](B-L +M:6YE87)'#$](C4T+C4B"B`@ +M("`@("!Y,3TB,2XW,S0P,30R(@H@("`@("`@>#(](C4T+C4B"B`@("`@("!Y +M,CTB-RXQ.3,Q-S@W(@H@("`@("`@:60](FQI;F5A&QI;FLZ:')E9CTB(VQI;F5A +M#TB,C3$](C$Y+C$R,3@W."(*("`@("`@('@R/2(R,"XQ-S8Q,R(*("`@("`@ +M('DR/2(V+C$P,S4T."(*("`@("`@(&ED/2)L:6YE87)'&QI;FLZ:')E9CTB(VQI;F5A#(](C(T+C$U.3@P,R(*("`@("`@('DR/2(Y +M+C,U,C$W,S@B"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0Q,#8Q,2(*("`@ +M("`@('AL:6YK.FAR968](B-L:6YE87)'#$](C(Y(@H@("`@("`@>3$](C,S(@H@("`@("`@ +M>#(](C$Y(@H@("`@("`@>3(](C(W(@H@("`@("`@:60](FQI;F5A#TB,C8N-C(U(@H@("`@("`@8WD](C(V+C4W +M-S,X,2(*("`@("`@('(](C$R+C4B"B`@("`@("!F>#TB,C8N-C(U(@H@("`@ +M("`@9GD](C(V+C4W-S,X,2(*("`@("`@(&ED/2)R861I86Q'&QI;FLZ:')E9CTB(VQI;F5A#$](C(W+C(Q-C#(](C(R(@H@("`@("`@>3(](C$Y(@H@("`@("`@:60] +M(FQI;F5A3(](C(U+C4B"B`@("`@("!I9#TB;&EN96%R1W)A9&EE;G0Q,#8R-R(*("`@ +M("`@('AL:6YK.FAR968](B-L:6YE87)'&QI;FLZ:')E9CTB +M(VQI;F5A65R,B(*("`@("!S='EL93TB9&ES<&QA>3II;FQI;F4B +M/@H@("`@/&<*("`@("`@('1R86YS9F]R;3TB;6%T6QE/2)D:7-P +M;&%Y.FEN;&EN92(@+SX*("`\+V<^"B`@/&<*("`@("!I9#TB;&%Y97(X(@H@ +M("`@('-T>6QE/2)D:7-P;&%Y.FEN;&EN92(^"B`@("`\9PH@("`@("`@:60] +M(F6QE/2)O<&%C:71Y.C`N,#3HQ.W-T6QE/2)O<&%C:71Y.C`N,CMF +M:6QL.B,P,#`P,#`[9FEL;"UO<&%C:71Y.C$[3IN;VYE.W-T3II;FQI +M;F4[9FEL=&5R.G5R;"@C9FEL=&5R,S0S-BDB("\^"B`@("`@(#PO9SX*("`@ +M("`@/&<*("`@("`@("`@:60](FB(*("`@("`@("`@("!I9#TB<&%T:#$P-36QE/2)F:6QL.G5R;"@C#MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M;&EN96IO:6XZ +M;6ET97([3HQ.V9I;&PZ;F]N93MF:6QL+6]P86-I='DZ,3MS=')O:V4Z(SDQ +M.3$Y,3MS=')O:V4M=VED=&@Z,"XV,30P-C(W,SMS=')O:V4M;&EN96-A<#IR +M;W5N9#MS=')O:V4M;&EN96IO:6XZ6QE/2)O<&%C:71Y.C$[9FEL;#IU3HQ.W-T3HQ(B`O/@H@("`@ +M("`@(#QP871H"B`@("`@("`@("`@9#TB32`R-BXY,#`V,C,L,3$@02`S+CDP +M,#8R,C8L,2XS-3,W-#<@,"`Q(#$@,3DN,#DY,S6QE/2)O<&%C:71Y.C$[9FEL;#IN;VYE.V9I;&PM;W!A +M8VET>3HQ.W-T3HQ(B`O/@H@("`@("`@(#QP +M871H"B`@("`@("`@("`@9#TB32`R,"XQ,C$V-S@L,C6QE/2)F:6QL.G5R;"@C;&EN96%R1W)A9&EE;G0Q,#8Q,RD[9FEL +M;"UO<&%C:71Y.C$[9FEL;"UR=6QE.F5V96YO9&0[#MS=')O:V4M;&EN96-A<#IR;W5N9#MS=')O:V4M +M;&EN96IO:6XZ;6ET97([B(*("`@("`@("`@("!T3HQ.V9I;&PZ=7)L*"-R861I86Q'6QE/2)F:6QL.FYO;F4[9FEL;"UO<&%C:71Y +M.C$[3II;FQI;F4B/@H@("`@("`@ +M(#QP871H"B`@("`@("`@("`@9#TB32`R,BPS,"!#(#(R+#,P(#(R+C4L,S$@ +M,C0L,S`N.34X.#0@0R`R-2XU+#,P+CDQ-S8X(#(V+#,P(#(V+#,P(@H@("`@ +M("`@("`@(&ED/2)P871H,3`U.3#MS=')O:V4M;&EN96-A<#IR;W5N9#MS +M=')O:V4M;&EN96IO:6XZ6QE/2)D:7-P;&%Y +M.FEN;&EN92(^"B`@("`@("`@/'!A=&@*("`@("`@("`@("!D/2)-(#,Q+CB(* +M("`@("`@("`@("!I9#TB<&%T:#$P-C`S(@H@("`@("`@("`@('-T>6QE/2)F +M:6QL.FYO;F4[9FEL;"UO<&%C:71Y.C$[9FEL;"UR=6QE.F5V96YO9&0[#MS=')O:V4M;&EN96-A<#IR +M;W5N9#MS=')O:V4M;&EN96IO:6XZ;6ET97([B(*("`@("`@("`@("!T +M"@P+C3IN;VYE.W-T3HP+C([9FEL +M;#IU3HQ.W-T +M3HQ(B`O/@H@("`@ +M("`@("`@("`\#TB,3DN-3`S-C0W(@H@("`@("`@("`@ +M("`@("!Y/2(R,2XS,S(W-S,B"B`@("`@("`@("`@("`@('1R86YS9F]R;3TB +M;6%T#TB,BXW,3DR +M.34B"B`@("`@("`@("`@("`@(')Y/2(R+C(Y,S`S-2(*("`@("`@("`@("`@ +M("`@>#TB,C`N,S6QE/2)O<&%C +M:71Y.C`N-3MF:6QL.FYO;F4[9FEL;"UO<&%C:71Y.C$[3IN;VYE.W-T#TB,"XU.#@R,#,R-2(*("`@ +M("`@("`@("`@("`@#TB +M,C`N-3`S,C0X(@H@("`@("`@("`@("`@("!Y/2(R-2XS,#`P,SDB"B`@("`@ +M("`@("`@("`@('1R86YS9F]R;3TB;6%T3HQ(B`O +M/@H@("`@("`@("`@("`\3TB,C4N,C0Y.3(R(@H@("`@("`@("`@("`@("!T3TB,2XT,38P,C8T(@H@("`@ +M("`@("`@("`@("!X/2(R-2XR-S6QE/2)O<&%C:71Y.C`N,C4[9FEL;#IU3HQ.W-T3HQ(B`O/@H@("`@("`@("`@/"]G/@H@("`@("`@("`@/'!A +M=&@*("`@("`@("`@("`@(&0](DT@,C`N,3DU.3`W+#3HQ(B`O +M/@H@("`@("`@(#PO9SX*("`@("`@/"]G/@H@("`@("`\<&%T:`H@("`@("`@ +M("!D/2)-(#$T+C(S.3(Q-BPR,"XS-#(R-S,@3"`Q,"XP.3@U,#4L,C@N-S0R +M.3DV($P@,3,N,C$S-SB(*("`@("`@("`@:60](G!A=&@V +M,#$P(@H@("`@("`@("!S='EL93TB;W!A8VET>3HP+C4[9FEL;#IU3HQ.W-T3HQ(B`O/@H@("`@/"]G/@H@("`@ +M/&<*("`@("`@('1R86YS9F]R;3TB;6%T3IN;VYE.W-T6QE/2)O<&%C:71Y.C$[9FEL;#IUB(*("`@("`@("`@("`@("`@:60](G!A=&@V +M-3`U(@H@("`@("`@("`@("`@("!S='EL93TB;W!A8VET>3HQ.V9I;&PZ;F]N +M93MF:6QL+6]P86-I='DZ,3MS=')O:V4Z=7)L*"-L:6YE87)'6QE/2)O<&%C:71Y.C$[9FEL +M;#HC.#@X83@U.V9I;&PM;W!A8VET>3HQ.W-T3IN;VYE.W-T#TB.3$N.3DR.#,V(@H@("`@("`@("`@("`@("!Y/2(Q-BXY +M-C,W-S@B"B`@("`@("`@("`@("`@('1R86YS9F]R;3TB;6%T3HQ.W-T3HQ +M.V1I6QE/2)F +M:6QL.FYO;F4[9FEL;"UO<&%C:71Y.C$[````!ET15AT4V]F='=AO!$(!C$) +M"2$$`_BR%L88W%T[NXZ"5(=A=#MKZU:'J<.,K--IW3\ZL]WICF7046N[MD(7 +M=&5W=6@9T=7HXBY!MQ8((22$I!`2\GK)O;FOO[>G?]PDYH8$XXHX/3//)-_? +MN??\SO><\SS/>9Y$$D+P_UGDK]N!+ROS(K!KI_X//]WAB>_:J?_]UX&_-`'3 +MLG9L?62]S[2LG5\'OIHH?/'%.H_'\X9IFI7"%105YR)F-= +MU]M,T[S_\<MR7J^9FU#%FYH6)V%5]^\*@NOJJ_+ +MPG6K:K-P[K82J%=4C]5XXC^SQ,#08 +M0?9X.'/F--($EF0/I]O;D.3/<%O;J2Q\ZM3)+'RR]406/G'R>!8^?N)_LG!7 +M5R>&[I4D2:J=S]NUI(:?D3Q%"$"C^%OOVM!`HN0UHP0AL10J"'&MFWIP4M +MV(00`C7_3O;M.8J:UX@0`B5O`S]_]2B>W#LQ30LD`/)F\U.::Q]XZ:67QM?= +MLC;0WMZ&XS@((3X;"!!\(2S$Q#,^LS,33_HR':NJRLWU#;2W=UQ^[+''@C/] +MG&L22Z[K^A8O+J-^U>HKE%?;_+X*72*1H*VM/3";;M82VK5K5ZZF:79!J"`[ +M\G-$Z:O6!0(!9%GV//?<<_I,7V?-@*[K0<,P+"&$=KVC/9M."(&NZ^E4*A4$ +M+DW7S4K`<9R@S^=SIAM\YYUWYGSIM7)TIC0U-4U]UNOU.HE$8GX$A!!!PS"D +MZ2_;N''C-7?T\W332\OK]0K7=>HS +M7J\769;G1T`($?3Y?,IT`LW-S9^;]C^V-9_K>XV-C5.9,`Q#$4+,>QD-&8:A +MNJX[9;RQL7%>3E[KR3OYTS`,9>#'O_3ZBNK.>!/_L1:6\^G#H%1X]`7Q_T]5'H)F0J +MJ)PD<&LH%&K>O'ESB6F:)4-#0S<%`@&$$'@\GJQQ_/AQAH:&*"\O_UPGOP@) +MQ['Y^(,#O/W:/U(4\G-?TRI*2\J)(7/9<3A568EV\"!.9R?#MLU`P$&X*),$ +M;AD8&/BA+,M>PS#^I*NK:T5#0X,7()5*89HFCN,@21*&8=#3TY/U\B]#PC+3 +M'/W-/MXYL(L;2D,\])U;*"I:"(!KC2$/OX#D_SZ6S\=I72>>2'`YU^7H0I&R +M'.E!9??NW1I0!_PWL"D3#<=KFB;Q>)QD,HEE6;BNB^NZ&(9!.!S&<9RL>?!% +M29CI)!\=WL-[OWZ>RJ6E/+QI`Z%0828;9I3D:"?IR$5`D([U8BY:RH7T"-UU +MI,X;DBF0=NQ]-]JL`-7`Q>W;MR>!$H!T.JW'8C'&QL9(I5+8MLVQ8\<00E!6 +M5H80@L.'#Z.JZKPC/2FVF:2G]5UZ3AYF1=4-?/_!C>3E999W.Q4F.=J).9[I +M%AQ7T#ML,VYW,/KI(3JU_Q5IQ]WI.OSKWO?'$Y#9!ZJ`C@G[Q9%(Q&/;MAN) +M1#S1:)14*H5E6=QTTTT((0B%0KBN2U55U=0\F`^)1"S"!P=?YJ.W_YWZ%3?R +M[4>^PX*<7`"LQ##)D0ZLQ'`F.[;@_)#%N4MIAF,JJO<(]SST0[SGQ\7(R.@+ +MSSSSC#UI5P$J)PG8MKUHN*]/Q`8&W([N;L_EWEZ40``Y$$#.R4'V^U$4!<,P +MB$:C!B!E"GH& +M3+H'TPR.*X2*EG+_UAW4W'PG7J^7[M=>,X/!8#XPG$5@\-@QZP>AT.G']^XM +M'VQMQ7KW767HPP_QVC:VHB!T'4N20):QR\K(?>().L-AAH:&YJH4A'#I.':` +M"V=^RS<:JGGB>_?B]?H`03K:2W*T$R<=!2"607E5-WUWUL +M>NC1K*`8AF''X_%@%@$KD5@;:VFY\?;24BW'-,$TD8:'*;5M#$"S;13;1@8$ +M8)T]B\9+0-O_/-3Y'"1O_[+^_%J/H1P2(WUD!SMQ+42`(S%';KZ +M32Z,.HQ$!=7UZWE@TY,L+*O,ZD:G$7`51]/MNJZ+U^N5 +M9K;4BA#BLA4(^(ZTM;%.""X"S:.C)'I[,5I;L8`4X))ICA;X?)3[_8A$@N;F +MYIFQI_7#?\//)1[8M@TD"==.HH;*<7J.,'#9YFQ_FK[+@DA<4%[;2.W*N]&, +M`"=.G07.9EG;L&%#%AE%43RF:683D!5E_\*&AL?.'CH4:#MRA$!^/DHPR$AO +M+SH0`'(!'V``*^^ZBZ'A82IK:JBOKPO/X<%$69:A851[WW@L/#!+?Y//_71V8DT43JYDD39[;>3 +M_^BC?#@X2*BB@C6WW#)EU#13U-568_@68)HFMFUC61:69>$X#K9M9SDSZ>QD +M66 +M1>[8&%I]/>>%X*-PF.HU:UA>DWT9Z_'X\7K]6;4Z.1S'F?I]9K0E2<+C\2#+ +M\A5GB[F69DW3L"RK\`H"DR2`GSRU\ZD=4G%18535<"4)R7&P'8L[OWT/DQ== +MLQF?E)D.S??PIV>PGZ75U\5QSJX_&XOZZNGH[.#DJ*2M$'%98OK[YJM.:*VK74 +M31)()I,YT_59&=BR94M`".'F!')P')M$(I'9`0WO=8WV;#K7=5%5E50J9=36 +MUD[=*F1EH+^_?U%E9:6EZ[JJZP:)9!Q-TR@I*9DS0E]4YG-FF$LF5C1;"'&# +M)$F7@,04`4F2_*M7KPX"HJNK*[,$6C:R1^;UUU^_!JY_>5FYCT>8IEE` +MY@9%5@`D2=(`/1Z/*^ET6DJE4B@>A50RA5_W7W'R^KHDF4SB.`[)9-(+>`%G +M,@-R86&AWO3-QCLD(>FMIT[@"A=)`E>X]/=?Q'$=BHM+*+]AZ==&R'5=PN$P +MT6@T3::WS&3@R2[JE__RO@]*9TQVHJL:: +MM6L`6;2WMW/RQ,F49=G7_7\49%D>'QP<_-GX^/@XF>O%3`;R"Q8]4%18O.`; +MMZ^/GSMWKJ^CH]..Q6+^_+S\);?==ONHW^]WEBU;YMNZ=6MHW_[_2(^,CCSW +M\DO_\HOKZ+M.IJ.W@#20`)+`N`1(34U-RYONOK-Y>56-L:*F5M$-7;),RS5- +M4P0"`2T8#*J2)$F_^_U'5LO'OQ]_[>=O;&EK:SM'YI!VO0@(,E$W)PC$A!"V +M)(1`DB1/24E)U7V;[MVW8L&"G.7!_."20""P()Z(CX^,C%R,7![KN#PV +M=OK7OWSKS9&1D4[@ZG\PN'8BD:EW9X*`)81PIY0S.D6-S+G%-S%4,FE+3(R4 +M$,*\3H[/2_X/UJ24;SY%!M$`````245.1*Y"8((````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````!I8V]N;[CP:```)GTE$051H@=6::VP,[NS#^]Z8WO)0TY* +M"+2*`Z&0*$W:0A$M$A346"W]0-6B4`59&%&12A5RW1=-/N"T07Q`X$0MI96H +MJJ;]0$A5&K6T,7;(`\LACN,XCKWV^K59[WMV9N[MAQT'DP^HK+U&/=*1]N[, +MW//_S=P[Y\Z9(/'B_*(J/<\[7`Z@#$`"@`U"\ +M7W'EAJ;EC*$]N_?']1U_0*`>@"7/)_@G(\*@G#9 +M<9Q+`"!)T@;&6#,1K070!&"#YS/%8O&6??OVS5>K84E70-.TASWQO^*<'R6B +M*Z[KSCS]]-/%&W;M`X"NKBY=%,5ZSODZ(GH(P%->'T>JU;`D`")JWKQY<_JV +MVVY[:'!P\)'IZ6FS6"R&#A\^;)5*I1G;MJ>(B#1-BRF*4M_8V*CJNIYN:FHJ +M;-BP`?W]_9FS9\\V+T7#4N=`R\6+%Y_:M6N7$XU&'P*P#D"8PFHB( +M>,-N;6TE+Y8([\ZW>_=N[=Y[[[T50,M2-%1]&^WJZJKCG`?:V]M'O+]B +MB[<7"H42$;FMK:V::9JFS^OK'RL*0$2;.>=GO>8J5(8'"H6"E$PFM6/'CHFB*/I5555%451< +MUY4E2;H.``#CX^."81B31%0U0-5#B#&VF8C>]YI-`.`XCI#-9I6YN3FYKZ]/ +M)B*_+,M^29+\FJ:9JJJ:JJH&#,,(J*IJCHR,"*JJYES7W5*MCJH!B.@C`(PQ +M*A:+*HE]1%%-1%+\LRZ:JJJ8D2::JJH'Q\7$Y&`PZ +M`%86H+.S4P*PT;;M@04`QW'$8K$HY_-Y97)R$K(L^S1-\RF*XI\/C^Q5750(!#8"&!\(>.6R^4UA6Q63XV-Q28&!NHFCAYM +MN'MV5C.`)@&0;%E.NYJ6LV0Y;QE&+JMIV;RB%#CGS+(L@3&6\OH<^/C(RP0@ +M25*<,3;V,%&K!NSY_JNO?DF4),J.CSN9T5$6O'"!M5B6;`"2","U+,?-YUW7 +MNV.)G$L2$2^IZHA[[MPDA<-Y413C*P8`H#X[/+PV#'0W`;YUC8TH3T\CX+IR +MQ'6AY_-8R%Q>]I)$SJ6%M34'8'..7*FTP=_;NRZS?7N^$`K55R.D*@#.>;24 +M2*QO!&A])`)5U\'PX=K95RA`]MK*(A"!".`<'`!#98UM9[.2KUP.YBO+CY4! +M`%!?*)=3!2!BUM6AA,IBWP+@BB+DC1M1MV8-0JM70XO%`%T'5J83"20&!F`, +M#$`3!$A$X*X+!T`)0-:#+0.80R6!;-(TES%FKB3`B!F/9P'`(*+!NO7KY87V +MJ3??O+[-K*N#((J`)]1$Y8EGP6.+?DM6L&C4=07!3J52;Z\80$=' +MAP/@A9;''LN0($`011SO[D;ZZE7X`*R)1!#U`!9#+/9&P\`=3SZ)]Z:FB@!^ +MZ?6Y,@``T-C8^*(>"EV^_8DG)B+A,(Q"`6/<-XGR/+.MK8VZU,!`("77GK)7RX6WW&&AIJC0T,F +M&QU%>7@8!@#?8A`BQ.Z_'_Y''\6)P4&6"(4N2KI^Y]Z]>W-+B;]D``!X^>67 +M@X5\_GFR[<>B'WR@WY3)$!L;`Q\=A2Z*B+2T(+1C!T84!7U`V1&$WQA^_P_V +M[-E3=3UH60$6[-"A@]NY9?]3MB=Y8RW[``` +M\./.Y][-S.<^'XNM0JE4PF1R`K%8M/>G/_G%7::AB=JX/!W_M] +MP4"Q6(3/KV<%+$L.`,X8 +MGR+"20`G!,A_>?;99R<^58#.SDZ_9DC/B:+\>%-C4]^JV*KA2'W]C-_PRY/) +MR<^=[/GW5SGC6-^\X5Q/S[O"Z=.GHX9A"`V-#608:E`W]".&9OZPHZ.CZCFR +MM)=\AOQ"O"E^Z[:[=_PVF4R.)Q*)PJ5+E^VQL;%R*IV:J:^ON^_UU_X@)Q(3 +MS:JJEN+Q>'K+EBVYG5_8J>S:M2MP_OS`@V?ZS^@`OK?B`$0D/G_@9[LWW?+9 +M/QT_?OS,,\\\,Z2JJBH(@BP(@NSS:;G6;WWS])IU:U?-SV=>,PQCQK(LWMO; +MJ_3U]4F*HFQ_X(&OW7/N_3.[B6@/Y]Q=40``TGQZ_O7>4^_>=\<=6Z,]/3V% +M5"J5R>5R=CJ=MF9G9TO)9/+877?>)3_R]4?J&QH:-L5BL6@T&HTV-#3$&6/B +MT;_^N92>G_^CIZ,J@*KG`!&IJJJN_>[CW_EV_*;XWH#?G#=\YH3?\%T+A8)" +M*!3R!8/A@"B*2CZ?M[/9#)_/9BB7R?KG,VES=FY&320F7NQ^Y!*%2<`L!"'J_@0\_\ECX +MT(,O#0X+V%P<',O=VEN92UU;FEN````!ET15AT4V]F='=A\W'/?DIN$$$`(A/`B*[Y0%JJ110U:Z:RUK=B= +MG79:K(4I;-E4G%G9W6EW^T?=;9WI[*YC5SLMH]AJ7;6`;4<[HR[5:M5B*Y.Z +M@`31$!)R)!L=1[@7.L\P+G6>8!SK0\]@/E!@K=M2%K`9TS+^0??+RLT`B@1 +ME-:(2/4_H`1$5_<)6@N(TH)2@!Z-`41`(;RF??G:Y[\W_,H'!9`S>1)OVY!L +M4(;Y=Z+,S;/F+4G-N:AM]-S57Q$0#)1A(Z:)B(4R;#!ME&&"LA!E8Y@68MHH +ML1#30D0(0DVID.?%AV_W2]G>KB`(_RTZ5'CT,X_JRED#;-N0-$P[=H\._5LN +M6'AEV+KTAIAR^]G]["-X7AE!HW6UNPT1#`.4JFXK!89Z=VTH76T7C3$:8RB- +M4N`U7AU4ZOY2=7;U2UE'=2B6B!@:$;36%:``O*.4VK)ITZ:?CO?XGB5DVM'[ +M4TUSUZSXVSL=)U%/[VO;=7]W)X61C(R/,Q2$2M"APK0C:+^$,59(HVL5B1/X +M11`0!:($T2!:.'A,&?U#%:9$35K*OQ&S?E$-A +MZJ+KF;9H%1?\13MB.ASM>IF!`[L(!U^G;FX;=:W74#-C,2-#?0P>W$6EYSDX +M]FZY#\L,9M3X9,IUA+*`B#4%^X*9L5RN\CE5[+Y,1YN'@`7U]?6=@X.#?PT< +M!YBPA'[XE?K-D7CJF]=OV!ISXG40:HYV_D1W[=DEZ=Y#)\0VK]S,@A5?(!Z/ +MXS@.E4J%4JE$/I]'@&1-#?%X',,P*!0*%(M%"H4"/;_Z+Y+I)S"L""];7^;F +MCT:PFZ]%&U&\7"\5/T0C>!4OC-5-[ZIMG--MFF;GO??>N[Y4*LVZXXX[1B;, +MP(,;:SYK.8D[K[WUNU$G7@=`NNLY0$D@-E-F+@1=K7T?D[K92\FF#Y&W;<`@ +M),2K>!0*+G7U#0R5<^2&%"(*S_?PRAZ>[^',7D7?D=W4U,PB$0Z3WO-+FB+U +M.%,O)M/]'/G.^\D7*V0+OGJ[/]_LQ^?^1^.56WZKM6YS'&,?2\^PL*E'T/\_`EE`Q`$`17/I^+Y^('"\R%`H2P; +MI:IW(C%,-`8H$RTFEA7!CD2Q;1O+LMA[\`A!&++\T@58B2:T7V8XW<6N>SY- +MU+&I!$+1M^@?'"D%#5?\H]W]5E +MK...]<+L!DVY-XU,7T8E?PS7#8G-OY'77W@,)QJKV):V#<.*ZOR!;]E<_J1/ +M8NF8!W/4_(6&%7GZHI5K8P=_LZ/0=^#78:B#YV8O;K^AJ64IP7!7]>0GF*QN +MZPG:QL?ID]N.9[QZ;,ZU2-H>8D3088CKNF2/[*>^]2H2;^ZC^]`;;QK*FVM9 +M%DXT<&I(WS`4.CW'`;9M2,XT+>=YKQ)1YJ/Q;\][*&`_$ +M&HSFVG+QZOE.U*8LK3]8W]2T[OOIM&E8D>]J(`S\#JW#'ZR];\1]J*/QR;8U +M_Q*G,DQ8&CK1R+@>_*.S,!J7KP@1(^2'W_@Q"U?AN9ED4Q.^:>+F\Q2/'6/D\&%TJ807 +MAH9.+8S#2<\!P_0O=PN9VAUW?2(8:Q)1:!V>QL+93SKUCDU9X>XCT]**`$C%V!-G#5=="6^PI//O!%B8[:-GI>VGI71TRF0',7&12C3Y-6GGF+6HD5$4BERIDG&]TD`":`1B`() +MQV%I>SLO9+/*MNV?G0(`<,O]V@5XX(O5AY5I1[`BSJ0`6$""0>:T+:/[U[MY +MX?''F;UH$=,2"8QLEN0H0'P48,FMM]+7VQOJ6.R5C1LW9B8$&"\!1!F85F12 +M``!:Z*3XJ4\25D(&]^R!_?N9ZKK$@!HX#C&SO1U[V3(.93+Y4&3SV/'O\T8F +M&,K$LBM(SU_/B]E,B6Q +MK%6W;=KTNS,$`&48F/;D90`@19&EYJN\WG8Q_F5+6+!R)5,&!DC6UE)>O)A= +M(R-Z9'CX@.\X?_/539LZQQ_[W@`"2JE)+:$QI:BPHG$/+^4^PJ'X#`XV-U0`1-S$DOH9"VK[V+[P69LNX92J83&+T7K$S>>+OZ, +M2LCZ$V1@3!9PX72+@C45UW49*>1^ON6V?SIZNO@_BVO@9-5$?(9*+N6R"SK< +M_UZQ[P^@C#]I"0$DHPI_I$S@E7#+WE$1,;36P42Q$P*(B+V\A=JO7%^]B`WC +M`\U_G;62$2$,?(+`(]W7GP,:1*0$%/1)XYI3G(F(#20'1J@%SG:X\T>>:7NZE.=)T*("(& +M8`!F!:R#1RN/-CQ]_Y>LOO[+M7X%O3P@PZDH# +M(1#>\XOB8]G"[PM]/6_>9!LT3NCN+*6!@3D=B?:5*[1C6[SQVO.Z4/(J$2> +MI\O;H;P3F/`N\/\@M?[+O9MC-7MOO.*C5WJ7_=4G5>`'NEPN!ZL_CE%75]?4 +MT-!@I-/I\*E?_#P8&!Q\B.HX4\-I9N9$),Z[H]@(U1E.;Y(`!*B]YIJKVBZZ +M9/%5]:E42^/4QIFIVE2#*,5P-IOI3ZQ[_W +M[;6\VI(*265?D$T,Z@C(8L0P@L@BBH@*.C2>[CFS"0.*CF<&Z':`(!!LC]/+ +M=(,;.BBMC4?9;$5%>]JP2CI",'LJ6R6I)+6_]_G[G5O$4HI_C\GYGN.3Y+ZWA)W-8)LV[9M)LNRCU!*"P%X`#@`6``(R4=4 +M`'$`(0!!0DBM81B_6[Y\^?XKS9M<21,J*RMS6BR6,P"\`&J2:J64-C(,4Z?K +M>@T`\>, +M&3.ONKKZ[D`@(,?C<=>.'3N41"+1J6E:!R&$2)*4)@B"-R,C0[18++T^GR]6 +M5%2$RLK*T,F3)PNNQ,.5]H%Q9\^>?;2DI$1/34V=!R`/@)M2F@H@$T`V(810 +M2N,`>@@A00`]IFE6Z[I^\,LOO[0"6/"C`1!"QD6CT>4`Z@!DH[\/-!)"F@#4 +M`NAXXXTWM(4+%Y)D7BR2(]^]]]XK39\^?32`<5?B8$F26$HI +M`X`$`@%$HU&7:9IGDK$._:``A)!B2NG)Y.TP]#X[AS``#@]_L9J]7:1@@9,L"0FY!IFL6$D%/)6Q\`Z+K.A,-A +MH;N[FS]RY`A/"+'S/&_G.,XN29(LBJ(LBJ+#:K4Z1%&4Z^OK&5$4(X9A7#]4 +M'T,&((2LX`",T3:L:`-!UG8W'XWPT&A7:VMK`\[Q-DB2; +M(`AVCN/L',?)29!S:F]OY]QN-P@APY,QOW,:TI<<#L<(`/Z!&5=5U9Q8.&P) +M-C>GM595>5KW[$F?V-4E60$?`W`:S_<:DA11>#ZJ6*V1L"2%HX(0HY2:BJ(P +MIFD&DS&K`&##U@W72*QP0-65?UB]\M_V774`CN,R3=-LGD_(0@GXZ=___O?3 +M6(XC8;]?#S4VFLXS9\QQBL);`8X%8"B*;D2CAI$N/SS]N( +MVQUE63830-6N\-KMXZ*YY=_O^]/Y[N[9L*;MOYR$($A!/F$HXT^TM!1F`*0P)06BQ0(37ZV=;;$8^.2] +MD,R$`\`0`E`*"L!$_QI;"X>*$2 +MCKZV-@2KJV&&PXC;;#JE-)TR=/KPHN&"IJF(1J.@U(2F:=`TE1(>^G>J@2>> +M>*)NXS,;9[ZUYP\[[[MWDX84CN5"X#WVA'HP<,8;T:0K\=748YLL$D21T]_6A/A#`IV?.H!9` +M-:4X32E.`V@`T`Z@+PEBH/\GV]BI4Q'RI1LVIR-]ZI2I=K^_`8V-#>@.=AMG +MJL_Z-<6_KHL:,K_^;&\1++IB;8`.2D +MI"`5."?O162[?3K(K;=@VK1I:&EIPK'C)\*JHKZU:N7EF_\Z`!C7Y,E3A0:N*BM;/V/@LV>>V3![Y,C1N800$`*P+`=0BF$^'TW+R8$U%L/)'3O0 +M55$!L;<7*>A?7U\(D@:`+9T&LG`!2J9-0VMK,XX=/QY6-'7/=S4/7-"$-%VM +MZ.D)EF9GYS"/+/M9ZKY][^[>]MS6LP34ZO*X]J_FL`IFX>K*X^_8\^7Y;3,'3,OG..W3#,&SB.`R$$H7`ONH*=`("! +M[1B'[,22AY:2=ST>&KIN++'LW0^UI@96`+;!((2@;>G#:!P[!G>4E`R8CR82 +MZMN/KWIRR5#,`Q?9%]KVRRVG[ENX:"S+L8C%HN!Y'IJF@U(3%#29#4U>^J^" +M(,#E\.#4YR=Q[)/#&'7J"_`U-:"-C;"P+%+&C4/E#>-PS-!1,NU6*(DH:NOJ +M([INO/W8JB<7#]7\10'*RLJ*K3;Q@P4+[O7P/(^$DH!AZ.?,,PP!I8!I]@,9 +MNH'6]G:8AHG\O'R`4KR]YRTX6SLPBA?!21(^[`R@*AS"^/'CH>L)^%M:8J)D +MV;OV/WZQ\$K,7Q0``#9LWC#!)EG>G3AA@J.PL(AG&!84%`0$L5@4#,-"$`5$ +M(B%T=G8BT-E]SD=&>@9RLK.Q?_]>=+1U(-(7PMGZ.N3EYD/7%71V=2;LLN-/ +MSY8_-_=*S5\2``#6K5OGLLO2SRGPH,OM(KIF,)%(1&$(.:V;1N:DB9.RQUX[ +M5FST-Z&UM14#82@H;!8;1HTCA<.3P*R^_5GJUS%\VP*72NJ?7S99$X86[ +MYMWE$26)U-;50M>-<_XHI?"F>I&;DX-]^_8:]0WU[U"#63Q0$%GH)1"%`6,&'X-&AKKM7W[]P74>&S. +MA@U;3OSH`+ES-I7Z4IU_6+[T;YVU7U1`ID'<<]=<](4B:`]T@E)Z#H00@JPL +M'R1>P,Y77PF%P^%?K']ZX^8?#2!WSJ;2S%3G[A7+9K@"$1V!W@2Z6^K@CIW" +M/?-FP^M-0X._!;JF]T]Z21B'0T:.+P,'#QZ(5E7]M2(1UQ9LW;KU&U><5QT@ +M=\ZFTLP4>?>__&2F*Q@S$0PGT.#O1+N_$5G9N;#V'L'X,7DHG78K_!U=B$2B +M`&AR]J;@.`YY69GP^QOT-]]\,QB-Q^]^KORY3W\0@-PYFTHS//+N?UXZPQ56 +M372'5-0U!]#1W("<@I'H#JL(A2+($5J09^O!X@<6036`0'=O_VQ.OP(9EN*! +MQ#-XZ947P\%@SS:'W;5VS9HUYO<&,&#^GQZ^W173@:Z0@MKF`#J:&Y%3,`+= +M80U=;7Z(1,6-Q:/QR4IK.WNBL?@#OWG^-PXP?$" +M>$&$2[8`A$!5$LC/RV-6+E^9XI3EWE5M(O?:SEU<<[-_$<=QB;JZ^L9P +M.)QY]_R[^9MNFL!HF@;`!"A0VU`#29+@31V&1??=;]_^PN]V`"BY:@":HGY: +M7=^^X-K1A8*B&DC/+D)72$5WNQ\<-!05Y./]CX_&X_[_?8GK^;RNC66%6"Q> +MG9N7ZU$4=9_5:NTAA-`_?_H7*1:-SJRLK"Q8_.`2CN?CXT^-J@1QXOV"BSZ0TXQI%46B@O>OCO-Q\;N*$F^7,S$R?S^=S +MI:>G>PH+"]..GSBF;]J\D?W)WRTC&1D^I*5X<6O)-'A3TQ#LZ8:NZ4WHWPN@ +M`$Q"B`'`H)0:Y_G[IDY,"&'PU>$GF&UV^VBIFEF)!*A/7T]-!Z-2+U]?=;. +MK@Z^H:YA%R?P,V?,N"/]EBE3)5EV(!0.X;777HT>.7KD5Z^^\C]EZ-]",@#H +M26F#:^.2``,ECZ^V-CD`7$KQ@D)'UO6_%@2A$!2,DDB$(S7O_=>H3,,HR"\8 +MY?&XKA-$*97G.9L@\%9"6`(@2DTCHJI:H"_4=ZRAL>GDQX<.5_7U]<7M=GMH +MWORY*R1)F"?+#DLD$J%^O[]\_]Z#NP#T`-`&C`]HL.=OJX'!``.O10`R9_&D +M@"%V/=JMH/_,:^"PS[Q``R5'DS'89(E&DZ(`7`"`0W\$X4,DG!!")HT/!AH\/-,,BZYX-F!9J,FC5_4 +MZ/\!2S].,X_^M[8`````245.1*Y"8((````````````````````````````` +M````````````:6-O;G,O-#AX-#@O<&QA8V5S+P`````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````#`P,#`W-34`,#`P,3;[CP:```*JTE$051H@>V97:Q<5W7'?WO/F9D[<^=^VDZ, +MTYAK.8Z3$L3((@N!_^>^RQ/WFG0+[=*!+04Z=.`=!]]1_QS4L_ +M]1\I31^B]M#G`(CCF(L7+W:B*/I6%$5_]/CCC[_^CJ,NC/][N&\SRN4R#S[X +MX/C"PL*'5U=7GSA__GP#WC[U?I94-<:$UMH_>_CAA_\<"@JK<*(`E$4W1E4/^-0U4IVGQ,PQM!L-N\,HI]C#"GPJTC` +MJ"H7O_+Y;YA*X\F?ZA/I\2$_1VAAL?"LA75%![^BV?-@JOKD[ZFF5T%%`4$4 +MC`HJ`J3KXO&=C0MQM_6!`#`FJ'_DKJ-'*`55L!9,":S%6`O8=,U@*($UR1J2 +MO$@E024)$%1`LC6/BB3K(J`>]5B- +M0=2SJ)(2T@2X^"1R&;F4&.E4$7J1Y5^OWD?9"H&`=V.1XY<0IO:S@O."^(@$4HX;%XK`MY^:7S+&Y.!7MG +M]J4$T)YXCS463<&9+'TR!7(EAG?'!'`:45,`IT6@V=K.TZAGK5?GGMJ;]*Y[ +MRK.'H?DF?N4"46N%?M\1Q0[Q!ENN43%[:-L]'/N#O^NF"FB(=Q!DP$SA8H:N +M";%"VAC-"]EH%F'%X`N13Z.O:2&KIM>DZ$64C?X8LY4V=FPB+2JAV^VPM=6C +MWW?TG2*4T,TUZGOW$`;3YNFGGZZD-:`=\1X;['0\T$$TU223+'.R**8.1"%= +MM$`@3Z,,=$*`E$"K/T:]%%$BQE0F415Z?4=SLT6G$]&+/'$,WG41K]A("7Q7 +M(EM^,"4@'16?1%K(P:HD>9\GC)B"XQ=R/HMHYBP%P&0>+H-G)".16.QFO\Q$ +MN8N*IU2=HM\-"7L1K7:7L.OH]SV14[P31(1RV">0OHO@<))"(BUU<1)=<6`2 +M'L:81`!C,#9U2TG!&]+H,@"<@D_L,=D'DIGM"9F=^M0^/7BA'569#$(0AY8G +M"=>:+-Y8XP2KYSDGI^0D03<%*(?@9XVS[@:4=5VE^MH`UM/C1%%$N+Y.N+C(\M6K[!^K847WIPJXMH_Z3K16T91`LE]I6@R9`FFT +M$Q:I"CY136)$7`+2QTDM29IBDLZL2"WG?8\B^*3(U*$2Y_=Y +MXZ:,=)B9(NES@40./B6SO[;`_I./\/IS+_#:N7,T9F8(9F=9O7F3*M``IH`Z +M,`8<>>()EI>7U9;+S]B"`EY=A$8AVF\AX1JNLX1K+1"W;N);M_"=921<1WMM +M-.J2F'/B)'B/>LDGA9D_2^$Y!:^BW%-^B[GYDY2J5?[]RU^FN;S,[ID9W@.\ +MMS#G@/?MV\>CG_D,BU$OQIBO!P#1YM*:H>,G9D*DOY84<;&!,XF59LH,;HIG +M@J("%#K3$154\I3*NM5=9H6YB55^X_>_R,6O?HU73I]F3Z/!KP&3P$0ZIV=G +M>>!+7^+LE4M49?WED,;W`P`?]5JN9U2]2R)E3`+8D),8N%"A$\U'>H`I=*9Y +M6ZW%S2[-_Y&44E&.!3_`W7V"TJ<_0>V'/X*+%P&8!B:-X=[Y>6:>>HH7%_^; +ML?B:VW/YV7_ZT.E5S7JA+8F=R=(@;]C,P#]UJ"\:PCZX*9#828$A,CNH7^?";WV(F2-'F'..J6:3RK%C7%?ENZLKW,_+C"]^I[>%MB$]$RNZI2S][WS%&M>`[W7AR\2I11!3K>:]G%#G62%Z\I@"[$>3B/ +MBC\H@->"&J.[]:@*NBVEE+)T\!;",$2PE'V(2U\6>S5#!.;_^I*\^'L'X[C; +M*QMUPV??@O/HVP@P9*5%!=`!H9WJ8(2,%-PIJ,2$W0XEZ2,B^:N<5VN'%`"\ +MUW[4[9>MU8)]DGP[,03AS[#O8*8/[(5N]G3NI,J9=MOHUZM+%R>"% +M3C2HV!$"HMJ-NE&C7+&%KTZ*X'>VH)R(%DGDBX6"+JBRTX97))6.,=>F:2>I +MR192D-^+EK%F1`&AZYS'6!V`'?J*>RCD.Q-1TE9[B-GM00]-4`R+E8.T@MUT +M*W?1+M^%B:`]=B_?[CZ!M!?85]DBD%;PT=,KX1"!V&NO&SHL06J56>`+8=^Q +M!H;3)\$^7`>Y*".`B]%VMLI+,Q]G[_[[.'SP$+5:G^[99U]X,R?PXUO=/WT@KORM68LF%=7!=YB%*(ZF +M1KZT_?=TY/-#KK3#:.X^:B8/[C,?.'*,&Y=?UTN+"W0BS^[I*;/O@^]GO%[C +MW@/W\:G//L4_/W-:FK'Y)/`7.8$_?G[YF\!+)/V3W_DUO[!A#ARX/O>%]V[\ +MP\N7KE6.O.]DZ<`C51-'L3\11=IH-"JSNV;+UEC^\\RWW;4;-]KGO_>#%XPQ +M)O\?&@!CS%A*(/Y_)@!0FIV=/?0['W_RR=E=NQZ8F9XZM&O7[GL:C<9DI]-I +MKZRNW-I86[_2W-Q\]=^>>_Z9I:6E"ZKJAPC\,@QC3(7DW%)/9YDDH&$Z>ZJ: +M_U?2_P#\C%BJZ78!1`````!)14Y$KD)@@@`````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````&EC;VYS+S(R>#(R+P`````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````P,#`P-S4U`#`P,#$W-3``,#`P,3@H*8W)E871E9"!W:71H('1H92!'24U0+`IH='1P.B\O=W=W+F=I;7`N +M;W)G%O._%```!`I)1$%4.,N=E5UL4V48QW_GHV=K-U@_<*M5V90M`T)<2(R# +MQ"A&$0C'+YQ^Q4W[SZ/O]?6E92::$"='OW'3LWE@%>Y/M`%[![D7X]^/8" +M/?G[6\!NOAE^EVZO0U3]\2$`>WJ+DMFAV[M/O/KR#@8'!W$ZG<3C<1P.!Z%0 +M"(_'0R*1H*&A@6`PB,?C(1*)X/%XT'6=JU>OXI[<3^?A`2;Z3_'3Z7)S8^OD80Z-1`U#,*`3PV*.-K'AB!9(D,3;F9^#R17:^OFM!@(JBF!H.A_GK +MBY?N0`,QXKXS2BD*M=N[K]GE=+)^W7IT74=55=K;UV$4"_A\(]AL-8M./!J- +MXN_92N?A`8(_]G!E.$PF\*V9;\GQ,[E_<[A<+FPV&]ELEF0RB=5J0[6H-#4U +M+8!.3T_?@?[0PY_79A9!2^`UDB23S^7XY<(%XC,S1#,9K'5+2202:):JQ4X/ +MS4-]$PF2HV?)K?T(>KL6&%`+L]GUQF^#_)K,,+9W+]6%`E9-0UN[EFS'3M.Q +MZ?30`-?[3S)R/4YL^#2.35\2UO]9%)$P?>DTM:D4 +M]4#[MJTL?7P%C8V-]!]\FHX#%PF2)4L( +M!`)DLBG>?Z]+NMNQ#+#ME1W@$`@'V]!9YH>$:$6,YB98/ +M<#J=.)U.6EI:<#@_4-3@6H`N]U.;4TM16&P>O5JA!`((=!U'2$$;P"& +M89C3)TD2A4(!M]O->##-;KJZDP'DB0A25+%D2Z5Q6*AJLJ\ +MYU8@!QB`I&YX_CF7HB@M\'HJQY>5>A;MZR +MZ;.ZI?9LC:W69G?D2:?3)!,I\OD<\?C,(I>5*GTS?0Z8*\4`H$Z'0KN$*'X< +MB\T\*82P%XR"7"P:LW.YN<#I4V<^\?O'4A58I1,K`+-`&LB6[9M/B5Q^0RJ= +M\CW`I77QKCW^`[V#'VTD6Q/F`````$E%3D2N0F""```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````&EC;VYS+S(R>#(R+V%P<',O=VEN92YP +M;F<````````````````````````````````````````````````````````` +M```````````````````````````````````````````P,#`P-C0T`#`P,#$W +M-3``,#`P,3````!ET15AT4V]F='=AP]&+"Z.PF +M=SFPI>Y&1IV1]>>'EY_C\>_L_[OHR($"3#,`P` +M)P$H`,2MXS:`#0#?ZKI^,`\@'D`%P#LW5J7`/P*X,)634<)@>T" +MJ;&QL95,)O-^O5[_L%PN2SS/(Y%(M%55]9:7E_]<7%Q,[01\:&%AX7`VFSW7 +MU]?WERB*Y=7557]F9F9M=G;6FIB8V!>-1K_:%M@PC#@`5==U"X!8+!;KHZ.C +MOP.(A<-AE8B2U6J5CT:CFF$8<5W7S5X['@+P#X`AV[:E>W-S_9EF\SU!DJ(V +M4:NA*)NE4DE+I]//MVH7>P:WUMN/'@P5L'!P=%;7.3[39-"``4(G!$DN_[J+INO/KB!=4& +M!XMD$1Y*`'@`AT9&`$7A&6,_=`*PH)?WY=6K/U;NWS]2 +MOG-'Z9#M1@!.$SY/[]]^+R_(P;M_F +M0@`&`+PQ,H+&\>-X*HIKO"P?#?('=@P`AF$DW9IY4XPH[PX\?LQ"DH1GNW:! +MK(V[7BQ^3-?UZH[``#`U78AP'/\B31(J+\?T&![G_%ZUKRR7>(/`!8ZL70*[CHNJY`Y`-`\?\$EXC\ +MT*M]+X:NPYN:+GP`X+0LRWO;[?8X$3%-TU:;3?NAZSJ_,,:NY'.3K4[>P.%- +M31=.Q&+Q&Y]^- +M0A`$Q@M"TO<\;W?JS;\9N+437YST!P;Z]]3K=9Z(&&-LQU&&P6SE/M3&X`````$E%3D2N0F""```````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````&EC;VYS+S(R>#(R+V%P<',O +M=VEN92UU;FEN`````=T +M24U%!]D(&`D<%D%*`'4```,0241!5#C+[97?:UQ%%,<_,W?N_LC=W23=;&K: +MDH#5F+2T38PH*@&M$?KH2RVI5&F+0?!%95F?6OK4:BT&!&OH'V!!1(6"E()M +M5"+5E&Y_:%/)TFI_;+IQJ;N;[J_LO3-]2&*76.CJHW@>AIG#S&=FSCGS'?C? +M%DW4#T:'91^0;'2QCCV%%WL&I`(5FD':%2G$P7C\W3&U'#IR^!K9U'>4YO*` +M`4`*D'+A#)8`(01""K[X,4=?5PM=G:OY^O#N#K-VQX>NO^T38$S40W<=.D.H^E?&0N'2=[?8I*>0X`8T!:%JY;HS8_C^MY5*ME +MTJ5F'*>%AQ_M036UDOMMDMB:;J:3W[2YMS6-EI7K67V^B\H@)G4)`#K +MGW\=G;T`1F.,QC,:8SPP^B_?4O]&JD#QT\]YI.\)Y)Z]]&M-15FX/8\Q^]+F +M!?")(R,`[-Y_:C%=#S:#(%THTWJGR-50B(CCX)5*>*4*0OE0;Q_5XNA;#VVZ +ME9D]YV$;V=8OZNM0U*'NM=#1=9%C-[\DU-W-=+%(>SY/#.A\>:N>:HI^)NK* +M+0&\WV@-&Q6BO'J8P'B2Z$]GZ`2:7]G.Q+J>3%6Y&Y<_$+-EVSOD4J<:@L^; +M`&?+@P1=B52*HJVR-2NP(9%(W%++)_O\33B1:$-@!Q@,7^#DW+,8H[&DUYN( +M)[(`]P$'(;*B84UP`%U8"'X\OB^[Y%=U.8H`V$$']0_`RV0G"OP):%6W@0W@ +MBZQ"^T(/Q!1*+E/I"B4=`/X`(1@[\O%X+I^?,*YXKSYY_M$=H8]P2R,-*5OO +MFSS^Y"#AH.+BK]>H>E1[U_47C-'A[R>^O2SNL\8&@D`8:`+\BS>REIB`.S3T +MW(K-0T.OMK>O[&MI;G:$E#*7NUU)I],_!/WJ@/@7NFW^FU_37=F^)Y<]#RBF +M`````$E%3D2N0F""```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````&EC;VYS+S(R>#(R +M+V%P<',O=VEN92UW:6YE8V9G+G!N9P`````````````````````````````` +M```````````````````````````````````````````````````````````P +M,#`P-C0T`#`P,#$W-3``,#`P,3````!ET15AT4V]F='=A +MW6(=6UH]WI];3=SGG]`"0.&8+/QS=Y?OF_ +MMX=02C%=N=WNSP&\"$`+0'E[.0<@">"0R^5R3=0`> +M!?`.@+,`WG*[W1W3]2NFC0L4V^UV;WEYN2,>CS\Q.CK**!0*8C*9LAS'37J] +MWBL7+EPH_C]P36]O[Y*ZNKHW32:37RZ7A_Q^OWCDR)%P=W=WJK&Q<;Y>K__T +MH6"WVVT$P+E3CL4#*,7*,TFM-I,,!C4E965W010VM;6E@0@-36]_4&N-C+P0"P\GE*U;(F.(BQ`0!88,!9R0)?:*($``6 +M@+WA6>@+\Y6I9(+T>CR_12,1YXZM+3]..6.693\$P'9TMC_#,(R%$"`MI#"C +MK`S'WO\`:D%`&0`S`",`KG8QV(8UR(DYD8^-']J^M67CW9#:+83F!V600 +M51K5X>U;6UZ9YE7=@@'@RZ\Z'2J6;56IU7-$49242H6RLJK2&AH-@56Q&.B_ +M"+_?CRN7+U.+U?S3_GV=#=.A4^`[M6__9S9*:5RAD"^`3'ETL;TZ+Q:+0<6R +M"(7#N';U:IP04K1]V\[40\%W:K9SS]H\HZ9KP]-YZM+B/)A->L3X.-1JM>3Q +MG/,G$HG&YIWO7IH.ON?8G.W)QJ-%B/7`[S/Y_LU$4^\]-ZNW<)]$S.,LN5YYQ+-B;XA@#%`C/V%DWTC +MDDZ9H;EL$K_T]&0SF:QHM5I075UMM"^R-V@X[0]W._\:0I)$1WR!L4_*4DIOK7VV26:U6 +MY<6+_3C^\W$5I],)T6CT&``+(20'0*"43DPY8T*('("*T15PYOEKZN?GIW55 +M\VS+S";+'(O5/(OC.$TZG0Z&PZ&A&!_S=!TXV,[IN)E#_J'K`'@`*0`Y2BG^ +M!HRG&7N"#U8I`````$E%3D2N0F""```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````:6-O;G,O,C)X,C(O<&QA8V5S+P`````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````#`P,#`W-34`,#`P,3;[CP:```$W$E$051(B6646VA<512&OWTNTTDR.9E$ +MTV)+V[0-1NL%\5(QTD+!"VJKHNB#*&K%)Z%//OK@HT\^!`J^5%2HB.";"%J- +M+43%2Z%MC*VW5DFM23O3)#.GF9FS]U[+AW,RJ>V"??;9F\WZ^?^U_F6FIJ:. +MJ>IV`%4UY&&*!6""(&B(R&L[=^[\J+AC8F+B/N`#8#U0!@+``VW@+/#,_OW[ +M3YLC1XZT=NS848ZB"&-6!%X!2D"/F9R<;(V/CY<[,^_A%O_@ZHB&;J+OMI=86%A@>GK:B4BT +MO+Q,O5YG[]Z]6&NIU6HTFTV2)*%:K4I/3\^E0X<.H:KW1MY[(R*4;WWYFN0K +MX;TG21+&Q\II*I4*2)`!4JU72-"5-4XX>/>_QW@-P[I/7,6K@*JE`_[>=6UY+$G982A9PSC,[,\6EBW7:3HBL#U[=.7S, +MQRG]-.^*1,2L`."%&W8]@`GCU5+_#T-`E)/?763#2!\#VVZC-G>>AD]8:"U# +M%*.](6HZQ'%`V_7U1=[[+H"(Q\0Q=G$&`@43K&974,D!%AN]?/;6^SSXGX++UB&%A,&6LL,P#$[0QM0PM(SU]B?L,(70!%?84"TQ-#;&3Y.31-4J)X.`R%H&@`08#@*&-F^BU/E+(Q')N\AE +MB/.(ZR"=RX67M0!PJ'C4=E#79G0P9?L3C_+C.P=9/SS,IB@BR3(&@0%@Y(47 +M^+._PO8+O]#U@3J+:S?0+$72BR@.50OJ4;'@75%DX?I`N/,&C^Q[D(=^UB[?P\%S=O9EXS[BD=89W,\K>(667@'6!0:]%.48^N$8HV +MU14`1;VPJ31+LUKBI!DEV[:-M)-R?^4XZV06]1X5T:Z3Q69@<@#)[#6##U54 +MR1N@8*)>N"DZSL1Y47%;%0S,RFSK,NCN!%\Y)Q[X]?I8^^,'?\XK`&U<_\6&FGZ +M$"N605+V/?T8PUNV,[3Q1@Y__14-W_NS456,,1%0C0+6!L:D:T*(0V-*89XQ +M#@QQB(D"4YPQ&[>.5G8\]/AK/7W]MU2K@R.52O]:Y^SE>KTVES86?]/&_($W +MWW[W\_\`KFL<'$S?X4X`````245.1*Y"8((````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````&EC;VYS+S,R>#,R+P`````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````P,#`P-S4U`#`P,#$W-3``,#`P,3;[CP:```'>$E$0518A<66:VQ4 +MQQ7'?W-?NXO7NW>]?F`PKV+`M0D$)0WF;9NX)(5&%%$:*10IBAJUT*JD4FE: +MJ5*_I`KD0P(H4D5#0ZB`EE)440K$-88*-R$0&K;8AF`PQO@%ML'>7>_SWCO] +M8.S&@"'`AXPT=X_FSL[YG9FY_W.$E)*OLBE?J7=`&^G%.Z\;O[/2]AI-5W<" +M/*J]_LW4#^\'(`:/8//FS7D>C_N49=GC`:*-/^;E5RMX?UL-P"/;[DEO`V`8 +MKFN)1&+V^O7K.^ZY`ZJJ+ILP<6)^5L`$H.:B)"OH91#P4>WI,Z:#E/3TW,J_ +MWGG]6\#VD8X@Z/&XU1M=-^CN[D((P*$((@$>VSYPYS9@Q8\GT9JI`\,XC +M&`)0%"57TS3%MFT`O*/+V?F'6C+RRD!*/MA>RZB<14@&;$_V`B3PP?9:7,'Y +M0W.,P+RA.9HY!QNP+0M5U82B*+DC`NBZ/CHKD,63,V?A.`ZP"@`IG8'?VX][ +M?[9RN'7'/%55:6V]1EMK>_Z(`$*(7)_/CV$8MQW?[>AQQC(S?0@A1MX!*66. +M81A(*:FJJGK@HE]6P*245%96#@:6?4^`K5NW/@F4[-V[%]NVD5(BA$#3-+Q> +M+Q45%02#P6&+/@CPBV-22G1=1TH9N`M@RY8M+N`TH!87%U-04$!=71VI5(IX +M/$Y?7Q_[]^]GPH0)""&^U$[<.59968FF:41N7@N\\DW?`575GG$9MI=H +MP`Q=USM7K%A1H"@*75U=Y.;F8IHFIFGB=KLY<.``,V;,("5*I/$QXW'AMK86K]<[M.CBQ8L?Z/Q2PR<Y.;U*\Q[:BK?6_(B=J2=OH8&6@,!KH>[J2UV+"'8KP$3 +MA1#'_7Z_C/3VTA0*<:.Y&4?74;Q>I*YC&`9]?7VW]6'DJ.L^K>;PGHW$PIW, +M?[J(F=]>23K22KBY&BL5H[$N2'W],:?]"2NM"+$];1-A&#BZ#KJ.?^5*>DM*J*ZNO@L`).V7SW#Q]#XT&:=LSA-, +M+YY+LK>9\)5JTJDX]2U)+G9(NOO^(O51@=VVPVL[:L+=`)ITG"FNEA8]X'() +M^OJ8TM.#*25Z(H%()$@"T986;A4545%1,2SJLQ\?XA^[WD`CP7/S2RB:\C42 +MMR[3>_E#DLD4YYH3-'8*XI9*Y8J?H)E3^J^VM.U?MVY=]R"^AA"WKBC*Z+9( +MA)98C#HI\>LZ5CI-!`@#4[.R4("C1X\..6\*?4AK_2&6/?L-"B>-(]'32._E +M(_3'+4)-<2YV.MC"P^19+_#2J[_$[?80"H54*5NSOKA_FE"4`SDS9[YRJKI: +M]65G4Z=ID$YC`C[`+P1YA85X)DQ@P<*%`/SKX._IN'"$'VUX'9_/1^?1-^CK +MMSA[.<:5+H$O.);O_.!GE#S][)!V2"EQN]VZE/(.`"%V%"Y9\O)GV[:I^5E9 +M%&@:F99%`/`#DU:MXI+?3U8\3DU-S4#D#56L_OX*A!VGI:F#?_^WGXOM*7S! +M\10M>H'L,47. +M$4BGR3$,_&O6\/FT:93,GLW8L6,Y[Q>-!U?2!23:.MK8VJJJI=&S9L6/W_.P!$H]%H17DY#8I`G3>/ +MO/9V>L:/IU,1N(-!KEZ]RKFSIW%+A^=7_P;#8Z*Y?#BH6):%HBBX7"[B\?C0 +M'=$T;>C"2BEQ'`=-TT@FD\,RH@:03":S"\:-0ZB"3S\YR;7"0J+I),^4EO+U +MHN*AA1S'P;9M;-O&LBS2Z3122E15'=8514%1!@KN0>UP'`?#,$@FD]EW`<1B +ML8"NZTR;6L39T&>@ZK@MA6E3BX:)SV"&5%5UJ&X8;/=*4G>JI:[KQ./Q81EQ +M$,`_6`OX,C.)1*)D>+T/G7;O-\>V;71=)Q:+^>X"Z._O]_K]?E15)1#(HKNG +MAX)Q!61GWU4_/+#=KU"Q+(M().(30N0`82EE4A-">)8N7>IJ;&RDKJZ.<*07 +MQ['I[+C.OGW['AI@I":$H+BXF%@LI@$Y#$A`EP;HJ71*GK_0(%)6`D?:M__B +MD+(2J(I*P=AQ^/WF8T/T]_>32"0DX`'Z`54K*U\H%Y4M"(\:Y?'GY^<3CR4( +MG?L/M2<^0M=UEB]?3FM[*^]M?X_KG3<>"T!1%,=QG(-`[#9`2GON^25)554[ +M`F;`#@2":=NT4ZUMV>;:M>OZ\_+R/*9I>H[6_-/)S\_[Z9[=?_K[8_AW`P*( +MW.X)*>6`$FY\Z[<>(<2O#<.8FS'*6^@9Y]S0_P$(U]%>O2B&]0````!)14Y$KD)@@@``````:6-O;G,O,S)X +M,S(O87!PO0````$ +MH*@\F(TI!:`42/*"( +MIA*($0]1!4A0154JRE,3Q9(E(.!&9\YUO_O.?.;^04K+=<%U7!W``*U+* +MW[BN^XNX7"WNB\#XP,#`V\O+RY]1%"4'++7;[3NV;2.ES"F*DI=2C@P,#%Q= +M65GY0EQHK"UP7=<&2I.3DS^)HNB+01#HON\+W_<5`%W7/4W3?$W3&L#LV;-G +MGP<>[Q\?$L +M,-&9,[U3`D>!*T`"L`'6U]>C;#:;-4TSE4@DDF-C8^GIZ6D,P[#S^?P_A1!' +MXPC$+<)'@*O`("!:K98Z,S,C;-ONR6:S/7U]?7TW;MS(5*O5KMNW;V=U76]V +MYFP:<07V`@M`/HHB4:E4S-G96=6RK&Y=UWM\W^^V+*O7-,W[BL6BU=75E9!2 +M[M\1`==U56`86`0&JVMKZ>*U:P\LO?[ZIQ^M5+YZI%(Y<;#1>/Q!SWNX3U6' +M:K5:)I5*:4*(W9VY_S?BU,`N&47EV>>>>^7WR\M/#.[9DRR_\XY\:'Y>C#:; +M21V(ZO5V*(0?"B&%$*$Q-547^_;=E;`+^->]"NRY^_[[F6%X:J2G![/=)N'[ +MB&:3)&``NI2&*J4!$`%*J=15RN5:3=O>LQ,">ZMW[J@5H&%9A$#9\UC/Y[&' +MALCT]^,+@5>OT_C@`]:+1:)6BW84J6S4SJ5[%2B;O;V-ZY"^.C_/[@,'F< +M>+-4PBR54-BX!#PV+H8D\&0^C]`T'RAO!H]S"BYTCXQD5%WGS8L7"8,`L[N; +MNJ:Q"MSM+)H#=@,/61:/'#M&8%D:<.&>!1S'J2#$E<$C1RKE4HG+Y\^C2$DN +MG6:(C2K;U5E\%_#Y9YZA5"Q&2#GC.$YE,WZL/Z&BJM_<]_33?U*BR*_-S>DW +M%Q;H;S:Q@"R0`=+`T,0$XN!!;E8J531M,@X[=C_@NNZ!R/?_'+[Q1M:^=4MX +MUZ^3:C2P@=[N;H:??9:E?)Z_!D$CU+0CCN- +MIEQ^_MO?^>Q665MI2/X;K89W8JU5OYG0C'2[[2$463>3Z1/;8<5NR?XW"H7" +MAW97]K7!^_/D\CG2F?1KA4+AP^VPMI4!@#`(%UNM9N1Y;:1D<;N<;0L(2%Y?C0\/"P.'SX4MKQFJ*CBAX7O_>"%.-Q8 +M6R"$$"^<.5UX\O%CY50JU5I<7"S7:C4MG4H%HV-CR8'^CY63R:1^_/A3`X:1 +MT,^]\G)!"'%&QOBZN#4@5E=6?W7Y+W^8//KH8_[8V.C]4A*U_7;XY2\=5VW; +M'LYFL^K2TE)T\=*%<&5E]9>``#85B+4%0@@!V!,3GWML=/03$YEL=F]/;\_' +M[:R=$XHBJI7J\NKJRC\:]?K\>^_-34U-3<\`U3@9V%(1"B$4-MI`$TAU1H`F +M4.^,GI0RBLO\-\1P1))/%:YZ`````$E%3D2N0F""```````````````````` +M``````````````````!I8V]N; +M[CP:```%DTE$0518A>V76VQ4QQG'?S-GSF777N\>7[`A#A23A%P`0Y.V0>6% +MMD+M2U5<0:D$3E!;X2C4J2HHM90H4?O4EU2NHJ25VJ0;M0FH0_;L&0K#H15?_Y'?TK9(YLX/FH,O/R4P`A`HRZ`L@9(" +MVP*EJ+4%*`FC[C(\]05*1T[@W[O-E#*OF,KPH#QVZHP9NCC>O_=X_*7N[NY? +M6);U1>`-^2GQ=N5XAU=]\\>ICLYOR&HQP_'#KP@=:;2.T#K$Z*A6S-6B-49K +M,!HP3`B?.CV"=.HH??*ZT/X*>6[H+**2=7"86UN3-"U;179DA/-'WV:DM(R13P:(Q^K=>0U!KRA?.J;C;1-3`.F>1+-R +M8H>;VN^9?^'#(^7W]_]>K>[J0[A)*J5+P%2((80$444("R$DD10@+$""D.1S +M!?ZQ]R^8;V]B]-0I3CS]#'9VE*0%VA(F84DGX9V^_\J]C5<`5+HGD5)._%!8 +M'5^<'3YQ(0S*ASI6?FO#O"5?(1H]C1V/`P9C]%4O&#`&8ZI3]%X0V+^ +M!YWK'B8:/8,)QJ8)SPRCI^JN&^><;3-<*#`\,<&@UOA*40U#BD`.6-K9[O_2D\I!-=U\O/"\/F'XK<88WUUW[./5(0PGK1L3!3. +M(C5S`@O=-A:NVOXL+[_QY3E[(J25\S&JJ!]^$`P?PJU5:7)?&K5LYV=%A*B+'5S!F@E3ZC.U_>S'?\2GQ5`*1LW-G<` +M@(Y8G@\#P/-048GQL6K_-)WK#;:4_9D\,&D).V`LBI!A@<-DQ^K4N>E0AGONNH/VEA25Z@1[ +M!X[Q[E_WA8&5'-FX<8.M362?&_KHX5V['OO3U!(((2QJ2^*\^MYXOS9[?WIT +M_^X%-SI[(RR*[=WDKB00$Y>HE+(D[4JP:7/WV25+5SHM+?/\`Z_O!ZQP)@_X +M0!.0HG9CCFX4`*"QL='9\L#F;C^5O,OW_46)1*(UTE$YG\N=SQ=+)QW+>N;1 +M1Y\X.`W@*H1++6U;0#`7@!G,I3:9$C!N:L!6G +M`9\`````245.1*Y"8((````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````:6-O;G,O,S)X,S(O87!PO0````$4MC(D*4@AJ%516F24&`B&0FQC".%E +M[YJUO5Z\Z]W9G9V9VS],JY#@L*B1>J7Y:V;.^=WS?5?W(XPQ_#\7?S +M!'"14MK%1@4J`)010FH88^6,L1=6KUZ],1==FBLI@"<%08@PQD*$D&%*:=8T +M31MCS$X(,0`D&6,1410CA)"?Y"J:4P)OO_VV'(_'!U>L6'%0T[2)F4R&J*K* +M4JD4**544113412(HJB+HGBUN;GY,8?#X5NV;%GZ3MHY]4`\'J\&T"&*XM.B +M*+YJL]D&`%P%<#$<#NNMK:WJKEV[U(J*"FG.G#E>`!-N_O/)MP(`H)8QU@:` +M`^`!$#8,HY_G^2M6J]4B"()<65GIZ^CHX%TNE\/K]5X@A-1^:P"$D.D`#@$H +M`$!U7:=M;6UPN5P>2JG5Z71:>GM[Q6PV2TI+2QU^OS\.8'HNVCDU(6/L7L98 +M-X!"QAABL9A\_/AQ3A`$MRS+'L,PW!S'>2P6BZ^GI\?J=#H%QEA%+MJY)$`` +M3%04Y0*`A]/IM!B/QY6+QXYY[]6T\3Q@30A".JTH64((W]_?3UPNEW3CQHT) +M`,@;;[QA$V3:HFF9/S2L;3KX-?$[G8(WWWRSR#3-DVUKUFQ:TMBXNJB\W''] +MS!GSS.[=66YXF!<`P@AA9/0Q*"%:>4-#Y++?7\H8JS:9]L[4*=,>Z.KNU$;B +M(T_7US=^,&8"[[WW'A>+19=S`OG35=4N_ZZLM*RFJFHR/W[\>/XO!][?^_JF +M5Q]M>+ZI];8`2Y@AT[FE?N +MV+%#`(!GGOGY58?=51V+#27Z!R)(9Y*86C,-25%`EC'`Y4(/I3@#H`NCMQ`/ +MP`6@6)(@U=9@7$D)M5AD\=-/VQ.]H;YW8>K3OFI^2PD()1LI1Y[=MF=;W7,_ +M?:XG%HLI'`]33:5@F#P"@0!$MQ.G#Q^&NZ``?IL-?#P..P`;``L`"\]#_G4] +M[(%QL%H5=':=2QC`_,:UC<>_%O-7`2@EV?S\_,K(]>N=.W9N;^1XX9`!1%?'#V*8I\/`5V'#,!Q$\#*\QCYY2JX*RI@L6E9765%55"8F1!`@AT(TLBHJ+4+NN +M"5Z?#_YT&H4`B@`4BR*&GE\-5W4U%(N,SJYN%:;Y<'U]T[%O,@>^U(3-.YOG +MRH)X:.'"A19!$*!E-6A:!@#`3!,&,R&*$L*](9QJ/PUO3R\*VT_!ZG#@0'$` +MU.E"45$`_8-1E5$ZKW%M8]N=S&\!`(`]>W:M)Y2NOF]2I<7G\T,W=`P.#L)F +ML\+I47'^PGDD4BEX/6XDDDG5Z78_^MHKK[5^@^?8 +M`/])0N+XEW3#F,J8R0@EGQJZ.>.>B1.5>\HGJ`6HB3A +MTJ5+\'H\L-HL:#WZ<2JCJD>RFOG#AH:&X5P!^M,#WUW$R8$J +M?/3/5H1Z0ZBLK(2:4A&)#&#^O'F6PL+"AREEY]:O?ZDZ5X`[)E!6M^$)299: +M7EA19Y$5!?L/M\/KMB-HGD,@SX&''IR%P<$H!B+]*"TK120286UM;1G39+]J +M:OS-EO\)8/QC&^I$2=S7\+/'+;(LX\#A4W#[\Y%)IE#D`F[TGD70:^![\Q=` +M%`55X#T2!(.+HG#QR[JW>$,TS)I=O###_3>WAXV:=(DJ*H*J\V&'RQ=8BDN +M+IYOR\KGFIJ:`F/YC#D1!1]?/]7G\5HD6<&AU@ZX_05(Q1.P<4F%AV*@E***Y>O8.Z<>32;SWA?@:`"&$`!``B(!=&O?0\L62S5?/3$.V +MZZ&+L\N)4C2NL,3C<>;[CP:```%J$E$0518A>V736A>[J8-V^> +M9-=M,"6;7'CO7N;CG=_Y_^\YEZ=$A$]S>)]J],\`/@,`@MYB<7'Q[\:8$THI +ME%(`[%\#>)[G?-__E8B\,C_-SI5JM$4<3P +M\##EQUN*<0RFE%A<7 +MWSIW[MPKF0+7?_`WUGAH[FLH)8@X$`>DL[,(Z2P.G`.QB+-@$\3UUAHQ"96:QSB. +MY[[^#,'0&(G6)$F"`G`)G7J5/UVY]KZU=C8#P#F4)^BM:[#/RWR6"'V(7F!G +MP3G$&L0YMAN'&/6W\3<64+LCM%?>87OM-LUV@C:PO:711[YYR_?]/H!`MRV% +M`2A(]^V^P!;$H9QT%5&I2@A@000ECD82GB:^M<^CR31[6.BLYHQ04WWE^]=2I1A_`6L"` +METKJ`9[JQDN#JS2`B`,L@DEG"V(0I\%I$F^0UGH-OU3")`G*6L8G)O#*94RA +M0-QJT;&VI`J%0A\@T8A+$&?`2T40E5I@N_X[`R[!60TFQAD-)L$E&FP"UB+6 +M,>37^7ATE)N5"JO&<-E:!C8V2#8VB($B\,R9,QBM5S,`E\2(Z2!&HY3#81!) +MP!E$-+BDN\NM`>NZ>\;VJJ%[]6QY9&B+1Y\^P>6+%SEZX@1QL4@0QXP"9>#0 +M@0,,3TZZ3A#\/@-H;:Y@&__"1+=23]6>(H"N#=T2E'Y`VPO>!YDJW>+&4T^S +MO%KAW0L7>,PY#@*'@-$PY/#\/!\,##2#(/AY!I!$V]A.A.A.V@=R`#T(Z68H +MO6KH0>05L(X!VIP96\*^8+!A2L^^HL/%.0.(W$.%W<0;=+,[V%!"B%99?1`_8^ +MD?_G(5[(ZE/?Y=FI<:+W%XAJ.U1&3O'K7[[)Y.O-C,% +ME%*#P`2@'Q0@#$/UXU?/OS8]??1;3QR=V1DH#MA*96WX\<>G71"$P]6=;;?X +M]I5FL]GXAOI_OIZ_\>;K7P:^)")3(C(%['B>]P_@!G#I1^=?K?\;`4WIU%85 +MB0<`````245.1*Y"8((````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +` +end --- wine1.2-1.1.43.orig/debian/wine1.2.prerm +++ wine1.2-1.1.43/debian/wine1.2.prerm @@ -0,0 +1,9 @@ +#!/bin/sh -e + +if [ "$1" = "remove" ] ; then + if [ -x /usr/sbin/update-binfmts ]; then + /usr/sbin/update-binfmts --package wine --remove wine /usr/bin/wine || true + fi +fi + +#DEBHELPER# --- wine1.2-1.1.43.orig/debian/wine1.2.docs +++ wine1.2-1.1.43/debian/wine1.2.docs @@ -0,0 +1,9 @@ +documentation/README.de +documentation/README.es +documentation/README.fr +documentation/README.it +documentation/README.pt +documentation/README.pt_br +ANNOUNCE +AUTHORS +README --- wine1.2-1.1.43.orig/debian/wine-winemine.desktop +++ wine1.2-1.1.43/debian/wine-winemine.desktop @@ -0,0 +1,26 @@ +[Desktop Entry] +Name=Winemine +Name[fi]=Winemiina +Name[ca]=Buscamines del Wine +Name[it]=Winemine +Name[hu]=AknakeresÅ‘ +Name[ru]=Wine-Сапер +Name[nl]=Wineveger +Name[el]=ÎαÏκαλιευτής +Name[es]=Buscaminas +Name[pt_br]=Campo Minado +Comment=Wine Minesweeper +Comment[fi]=Winen Miinaharava +Comment[ca]=Jugueu a un clon del buscamines del Windows +Comment[pt_br]=Jogo Campo Minado do Windows +Comment[es]=Juego de Buscaminas de Windows +Comment[el]=ÎαÏκαλιευτής Wine +Comment[ru]=Ðналог Windows-Сапера +Comment[hu]=Wine aknakeresÅ‘ +Comment[it]=Gioco «Campo minato» per Wine +Comment[nl]=Wine Mijnenveger +Exec=winemine +Terminal=false +Type=Application +Icon=wine +Categories=Wine;Game;LogicGame; --- wine1.2-1.1.43.orig/debian/wine.binfmt +++ wine1.2-1.1.43/debian/wine.binfmt @@ -0,0 +1,3 @@ +package wine1.2 +interpreter /usr/bin/wine +magic MZ --- wine1.2-1.1.43.orig/debian/wine-Programs-Accessories.directory +++ wine1.2-1.1.43/debian/wine-Programs-Accessories.directory @@ -0,0 +1,16 @@ +[Desktop Entry] +Type=Directory +Name=Accessories +Name[sv]=Tillbehör +Name[da]=Tilbehør +Name[de]=Zubehör +Name[es]=Accesorios +Name[el]=Βοηθήματα +Name[fr]=Accessoires +Name[he]=×¢×–×¨×™× +Name[nl]=Bureau-Accessoires +Name[hu]=Kellékek +Name[pt]=Acessórios +Name[pt_br]=Acessórios +Name[it]=Accessori +Icon=folder --- wine1.2-1.1.43.orig/debian/wine-wine.directory +++ wine1.2-1.1.43/debian/wine-wine.directory @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Directory +Name=Wine +Icon=wine --- wine1.2-1.1.43.orig/debian/wine-winefile.desktop +++ wine1.2-1.1.43/debian/wine-winefile.desktop @@ -0,0 +1,26 @@ +[Desktop Entry] +Name=Wine File +Name[fi]=Wine File +Name[ca]=Explorador d'arxius del Wine +Name[it]=Wine File +Name[hu]=Wine fájlkezelÅ‘ +Name[ru]=Проводник Wine +Name[nl]=Wine Bestandsbeheer +Name[el]=ΑÏχεία Wine +Name[es]=Explorador de Ficheros Wine +Name[pt_br]=Arquivos do Wine +Comment=Wine File Browser +Comment[fi]=Winen tiedostoselain +Comment[ca]=Exploreu les vostres unitats +Comment[pt_br]=Explorar as pastas do Wine +Comment[es]=Explora los ficheros de tu unidad de Wine +Comment[el]=ΠεÏιηγητής αÏχείων Wine +Comment[ru]=Обозреватель файлов Wine +Comment[hu]=A Wine fájlböngészÅ‘je +Comment[it]=Esploratore file di Wine +Comment[nl]=Bestandsbeheerder voor Wine +Exec=winefile +Terminal=false +Type=Application +Icon=wine +Categories=Wine;Utility;Emulator; --- wine1.2-1.1.43.orig/debian/wine1.2.dirs.i386 +++ wine1.2-1.1.43/debian/wine1.2.dirs.i386 @@ -0,0 +1,7 @@ +usr/bin +usr/share +usr/share/man +usr/share/man/man1 +usr/share/man/man5 +usr/lib +usr/lib/wine --- wine1.2-1.1.43.orig/debian/control +++ wine1.2-1.1.43/debian/control @@ -0,0 +1,125 @@ +Source: wine1.2 +Section: otherosfs +Priority: optional +XSBC-Original-Maintainer: Scott Ritchie +Maintainer: Ubuntu MOTU Developers +Uploaders: Arthur Loiret , Scott Ritchie , Stephan Hermann , Jasmine Iwanek +Build-Depends: debhelper (>= 5.0.51~), flex, bison, libx11-dev, libxt-dev, + libncurses5-dev [i386] | libncurses-dev [i386], + lib32ncurses5-dev [amd64], + libcups2-dev, libfontconfig1-dev | libfontconfig-dev, libfreetype6-dev, libgl1-mesa-dev | nvidia-glx-dev | fglrx-driver-dev | libgl-dev, libgif-dev | libungif4-dev, libjack-dev, libaudio-dev, + libasound2-dev [i386], + lib32asound2-dev [amd64], + libglu1-mesa-dev | libglu-dev, libxext-dev, + linux-kernel-headers, + libpulse-dev (>= 1:0.9.15), + libssl-dev, libgnutls-dev, + libcapi20-dev, docbook-utils, docbook-xsl, docbook-to-man, libjpeg62-dev, fontforge, libstdc++6-4.2-dev | libstdc++6-4.1-dev | libstdc++-dev, libldap2-dev, libxml2-dev, libxslt1-dev, libxxf86vm-dev, prelink [i386 amd64], libsane-dev, libhal-dev, libhal-storage-dev, libgphoto2-2-dev, libxrender-dev, libxcursor-dev, libesd0-dev, libxrandr-dev, liblcms1-dev, x11proto-xinerama-dev, libpng12-dev, libxcomposite-dev, libgsm1-dev, + libc6-dev-i386 [amd64], lib32z1-dev [amd64], ia32-libs [amd64], gcc-multilib [amd64], libxi-dev, libxinerama-dev, libgsm1-dev, libopenal-dev, + libmpg123-dev, + lib32v4l-dev [amd64], libv4l-dev [i386], + sharutils, quilt (>= 0.46-7~) +Standards-Version: 3.8.3 + +Package: wine1.2 +Architecture: any +Section: otherosfs +Pre-Depends: dpkg (>= 1.14.12ubuntu3) +Depends: procps, binfmt-support (>= 1.1.2), ${shlibs:Depends}, ${misc:Depends} +Recommends: ttf-symbol-replacement, ttf-liberation, winbind, wine1.2-gecko, ttf-mscorefonts-installer, winetricks +Suggests: xdg-utils +Conflicts: wine (<< 1.1.36-0ubuntu2), wine1.0, binfmt-support (<< 1.1.2), winesetuptk, wine-doc, wine-utils, libwine-alsa, libwine-arts, libwine-capi, libwine-cms, libwine-esd, libwine-gl, libwine-gphoto2, libwine-jack, libwine-ldap, libwine-nas, libwine-print, libwine-sane, libwine-twain, xwine, libwine, ttf-tahoma-replacement +Replaces: wine (<< 1.1.36-0ubuntu2), wine1.0, winesetuptk, wine-doc, wine-utils, libwine-alsa, libwine-arts, libwine-capi, libwine-cms, libwine-esd, libwine-gl, libwine-gphoto2, libwine-jack, libwine-ldap, libwine-nas, libwine-print, libwine-sane, libwine-twain, xwine, ttf-tahoma-replacement +Provides: wine +Homepage: http://www.winehq.org/ +Description: Microsoft Windows Compatibility Layer (Binary Emulator and Library) + Wine is a compatibility layer for running Windows applications on Linux. + Applications are run at full speed without the need of cpu emulation. Wine + does not require Microsoft Windows, however it can use native system dll + files in place of its own if they are available. + . + This package includes a program loader for running unmodified Windows executables + as well as the Wine project's free version of the Windows API for running programs + ported from Windows. + . + This package is based on a recent Wine beta. While many more applications will + work, there may be some loss of functionality compared with the stable release + provided by the regular wine package. + +Package: wine1.2-dev +Architecture: any +Section: libdevel +Pre-Depends: dpkg (>= 1.14.12ubuntu3) +Depends: wine1.2 (= ${binary:Version}), libc6-dev +Conflicts: wine-dev (<< 1.2), wine1.0-dev, libwine-dev +Replaces: wine-dev (<< 1.2), wine1.0-dev, libwine-dev, libwine +Provides: wine-dev +Homepage: http://www.winehq.org/ +Description: Microsoft Windows Compatibility Layer (Development files) + Wine is a compatibility layer for running Windows applications on Linux. + Applications are run at full speed without the need of cpu emulation. Wine + does not require Microsoft Windows, however it can use native system dll + files in place of its own if they are available. + . + This package consists of the development files needed to compile programs + using wine's free version of the Microsoft Windows API. + . + This package is based on a recent Wine beta. While many more applications will + work, there may be some loss of functionality compared with the stable release + provided by the regular wine-dev package. + +Package: ttf-symbol-replacement +Architecture: all +Section: fonts +Pre-Depends: dpkg (>= 1.14.12ubuntu3) +Depends: ${misc:Depends}, defoma +Homepage: http://www.winehq.org/ +Description: Free font with the same metrics as Symbol + A free font from the Wine project with exactly the same metrics as Symbol. + This implies it can serve as a drop-in replacement. + +Package: wine1.2-dbg +Architecture: any +Section: debug +Depends: wine1.2 (= ${binary:Version}) +Priority: extra +Homepage: http://www.winehq.org/ +Description: Microsoft Windows Compatibility Layer (debugging symbols) + Wine is a compatibility layer for running Windows applications on Linux. + Applications are run at full speed without the need of cpu emulation. Wine + does not require Microsoft Windows, however it can use native system dll + files in place of its own if they are available. + . + This package includes debugging symbols useful for reporting crashes and other + failures. + +Package: wine +Architecture: all +Section: otherosfs +Depends: wine1.2 +Priority: extra +Homepage: http://www.winehq.org/ +Description: Microsoft Windows Compatibility Layer (dummy package) + This package is to ease upgrades for users of earlier Wine packages. + It can be safely removed. + +Package: wine-dev +Architecture: all +Section: libdevel +Depends: wine1.2-dev +Priority: extra +Homepage: http://www.winehq.org/ +Description: Microsoft Windows Compatibility Layer (dummy package) + This package is to ease upgrades for users of earlier Wine packages. + It can be safely removed. + +Package: wine-gecko +Architecture: all +Section: otherosfs +Depends: wine1.2-gecko +Priority: extra +Homepage: http://www.winehq.org/ +Description: Microsoft Windows Compatibility Layer (dummy package) + This package is to ease upgrades for users of earlier Wine packages. + It can be safely removed. + --- wine1.2-1.1.43.orig/debian/README.source +++ wine1.2-1.1.43/debian/README.source @@ -0,0 +1,7 @@ +Quilt: +====== +The source package itself uses a mixture of quilt and .diff.gz for the +modifications of the upstream source. If you want to change something it is +best to use the quilt approach as documented in + + /usr/share/doc/quilt/README.source --- wine1.2-1.1.43.orig/debian/wine-winehelp.svg +++ wine1.2-1.1.43/debian/wine-winehelp.svg @@ -0,0 +1,357 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- wine1.2-1.1.43.orig/debian/patches/dibeng-0005.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0005.patch @@ -0,0 +1,512 @@ +DIB Engine: implement AlphaBlend + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/bitblt.c | 88 ++++++++-- + dlls/winedib.drv/dibdrv.h | 2 + dlls/winedib.drv/primitives.c | 12 + + dlls/winedib.drv/primitives_bitblt.c | 287 ++++++++++++++++++++++++++++++++++ + 4 files changed, 370 insertions(+), 19 deletions(-) + + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index 20cdcaa..c0227a0 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -150,34 +150,84 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + xDst, yDst, widthDst, heightDst, + physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", + xSrc, ySrc, widthSrc, heightSrc)); ++ + +- if(physDevDst->hasDIB && physDevSrc->hasDIB) ++ /* if sizes are null or negative, returns false */ ++ if(widthSrc <= 0 || heightSrc <= 0 || widthDst <= 0 || heightDst <= 0) + { +- /* DIB section selected in both source and dest DC, use DIB Engine */ +- ONCE(FIXME("STUB\n")); +- res = TRUE; ++ res = FALSE; ++ goto fin; + } +- else if(!physDevDst->hasDIB && !physDevSrc->hasDIB) ++ ++ /* source sould be a 32 bit DIB */ ++ if(!physDevSrc) + { +- /* DDB selected in noth source and dest DC, use X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, +- blendfn); ++ FIXME("Null source bitmap -- shouldn't happen\n"); ++ res = FALSE; ++ goto fin; + } +- else if(physDevSrc->hasDIB) ++ else if(!physDevSrc->hasDIB) + { +- /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, +- blendfn); ++ FIXME("DDB source bitmap -- shouldn't happen\n"); ++ res = FALSE; ++ goto fin; + } +- else /* if(physDevDst->hasDIB) */ ++ ++ if(physDevDst->hasDIB) + { +- /* DDB on source, DIB on dest -- must convert source DDB to DIB and use the engine for blit */ +- ONCE(FIXME("STUB\n")); +- res = TRUE; ++ /* DIB section selected in dest DC, use DIB Engine */ ++ MAYBE(TRACE("Blending DIB->DIB\n")); ++ res = physDevDst->physBitmap.funcs->AlphaBlend(physDevDst, xDst, yDst, widthDst, heightDst, ++ physDevSrc, xSrc, ySrc, widthSrc, heightSrc, blendfn); ++ } ++ else ++ { ++ /* DDB selected on dest DC -- must double-convert */ ++ HBITMAP tmpDIB, stock; ++ HDC tmpDC; ++ MAYBE(TRACE("Blending DIB->DDB\n")); ++ ++ /* converts dest DDB onto a temporary DIB -- just the needed part */ ++ tmpDIB = _DIBDRV_ConvertDevDDBtoDIB(physDevDst->hdc, physDevSrc->hdc, xDst, yDst, widthDst, heightDst); ++ if(!tmpDIB) ++ { ++ ERR("Couldn't convert dest DDB to DIB\n"); ++ res = FALSE; ++ goto fin; ++ } ++ ++ /* selects the temporary DIB into a temporary DC */ ++ tmpDC = CreateCompatibleDC(physDevDst->hdc); ++ if(!tmpDC) ++ { ++ ERR("Couldn't create temporary DC\n"); ++ DeleteObject(tmpDIB); ++ res = FALSE; ++ goto fin; ++ } ++ stock = SelectObject(tmpDC, tmpDIB); ++ if(!stock) ++ { ++ ERR("Couldn't select temporary DIB into temporary DC\n"); ++ DeleteDC(tmpDC); ++ DeleteObject(tmpDIB); ++ res = FALSE; ++ goto fin; ++ } ++ ++ /* blends source DIB onto temp DIB and re-blits onto dest DC */ ++ res = GdiAlphaBlend(tmpDC, 0, 0, widthDst, heightDst, physDevSrc->hdc, xSrc, ySrc, widthSrc, heightSrc, blendfn); ++ if(!res) ++ MAYBE(TRACE("AlphaBlend failed\n")); ++ else ++ res = BitBlt(physDevDst->hdc, xDst, yDst, widthDst, heightDst, tmpDC, 0, 0, SRCCOPY); ++ ++ /* frees resources */ ++ SelectObject(tmpDC, stock); ++ DeleteDC(tmpDC); ++ DeleteObject(tmpDIB); + } ++fin: + return res; + } + +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 773941e..c801d96 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -94,6 +94,8 @@ typedef struct _DIBDRV_PRIMITIVE_FUNCS + BOOL (* PutLine) ( struct _DIBDRVBITMAP *bmp, int line, int startx, int width, void *buf); + + /* BitBlt primitives */ ++ BOOL (* AlphaBlend) ( struct _DIBDRVPHYSDEV *physDevDst, int xDst, int yDst, int widthDst, int heightDst, ++ const struct _DIBDRVPHYSDEV *physDevSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, BLENDFUNCTION blendFn ); + BOOL (* BitBlt) ( struct _DIBDRVPHYSDEV *physDevDst, int xDst, int yDst, int width, int height, + const struct _DIBDRVPHYSDEV *physDevSrc, int xSrc, int ySrc, DWORD rop ); + BOOL (* StretchBlt) ( struct _DIBDRVPHYSDEV *physDevDst, int xDst, int yDst, int widthDst, int heightDst, +diff --git a/dlls/winedib.drv/primitives.c b/dlls/winedib.drv/primitives.c +index cbad239..a2fa04a 100644 +--- a/dlls/winedib.drv/primitives.c ++++ b/dlls/winedib.drv/primitives.c +@@ -133,6 +133,10 @@ BOOL _DIBDRV_StretchBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + INT widthDst, INT heightDst, const DIBDRVPHYSDEV *physDevSrc, + INT xSrc, INT ySrc, int widthSrc, int heightSrc, DWORD rop); + ++BOOL _DIBDRV_AlphaBlend_generic(DIBDRVPHYSDEV *physDevDst, int xDst, int yDst, ++ int widthDst, int heightDst, const DIBDRVPHYSDEV *physDevSrc, ++ int xSrc, int ySrc, int widthSrc, int heightSrc, BLENDFUNCTION blendFn ); ++ + /* ------------------------------------------------------------*/ + /* FREETYPE FONT BITMAP BLITTING */ + void _DIBDRV_freetype_blit_8888 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +@@ -156,6 +160,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_RGB = + _DIBDRV_SolidVLine32, + _DIBDRV_GetLine32_RGB, + _DIBDRV_PutLine32_RGB, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_32_RGB +@@ -172,6 +177,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_BITFIELDS = + _DIBDRV_SolidVLine32, + _DIBDRV_GetLine32_BITFIELDS, + _DIBDRV_PutLine32_BITFIELDS, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_32_BITFIELDS +@@ -188,6 +194,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB24 = + _DIBDRV_SolidVLine24, + _DIBDRV_GetLine24, + _DIBDRV_PutLine24, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_24 +@@ -204,6 +211,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_RGB = + _DIBDRV_SolidVLine16, + _DIBDRV_GetLine16_RGB, + _DIBDRV_PutLine16_RGB, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_16_RGB +@@ -220,6 +228,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_BITFIELDS = + _DIBDRV_SolidVLine16, + _DIBDRV_GetLine16_BITFIELDS, + _DIBDRV_PutLine16_BITFIELDS, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_16_BITFIELDS +@@ -236,6 +245,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB8 = + _DIBDRV_SolidVLine8, + _DIBDRV_GetLine8, + _DIBDRV_PutLine8, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_8 +@@ -252,6 +262,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB4 = + _DIBDRV_SolidVLine4, + _DIBDRV_GetLine4, + _DIBDRV_PutLine4, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_4 +@@ -268,6 +279,7 @@ DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB1 = + _DIBDRV_SolidVLine1, + _DIBDRV_GetLine1, + _DIBDRV_PutLine1, ++ _DIBDRV_AlphaBlend_generic, + _DIBDRV_BitBlt_generic, + _DIBDRV_StretchBlt_generic, + _DIBDRV_freetype_blit_1 +diff --git a/dlls/winedib.drv/primitives_bitblt.c b/dlls/winedib.drv/primitives_bitblt.c +index da48352..7540dad 100644 +--- a/dlls/winedib.drv/primitives_bitblt.c ++++ b/dlls/winedib.drv/primitives_bitblt.c +@@ -80,6 +80,293 @@ static void StretchLine(DWORD *dst, int dstWidth, DWORD *src, int srcWidth) + memcpy(dst, src, 4 * srcWidth); + } + ++/* premultiply alpha channel on a line by a constant alpha ++ note : it seems that pixels are already premultiplied ++ by alpha channel content */ ++static void PemultiplyLine(DWORD *dst, int width, BYTE constAlpha) ++{ ++ int i = width; ++ BYTE *alphaPnt = (BYTE *)dst + 3; ++ ++ /* small optimization for 0 and 255 values of constAlpha */ ++ ++ /* fully transparent -- just sets all pix to 0 */ ++ if(constAlpha == 0) ++ { ++ while(i--) ++ *dst++ = 0; ++ return; ++ } ++ ++ /* fully opaque, just do nothing */ ++ if(constAlpha == 255) ++ return; ++ ++ /* intermediate -- premultiply alpha values */ ++ while(i--) ++ { ++ *alphaPnt = MulDiv(*alphaPnt, constAlpha, 255); ++ alphaPnt += 4; ++ } ++ return; ++ ++} ++ ++/* alpha blends a source line onto a destination line ++ preconditions : ++ 1) source and dest widths must be the same ++ 2) source line should be already premultiplied by constant alpha */ ++static void BlendLine(DWORD *dst, DWORD *src, int width) ++{ ++ int i = width; ++ BYTE *blueDst = (BYTE *)dst; ++ BYTE *greenDst = blueDst + 1; ++ BYTE *redDst = greenDst + 1; ++ BYTE *blueSrc = (BYTE *)src; ++ BYTE *greenSrc = blueSrc + 1; ++ BYTE *redSrc = greenSrc + 1; ++ BYTE *alphaSrc = redSrc + 1; ++ BYTE alpha; ++ ++ /* still don't know if it must take in account an eventual dest ++ alpha channel..... */ ++ while(i--) ++ { ++ alpha = 255 - *alphaSrc; ++ ++ *blueDst = *blueSrc + MulDiv(*blueDst, alpha, 255); ++ *greenDst = *greenSrc + MulDiv(*greenDst, alpha, 255); ++ *redDst = *redSrc + MulDiv(*redDst, alpha, 255); ++ ++ blueSrc += 4; ++ greenSrc += 4; ++ redSrc += 4; ++ alphaSrc += 4; ++ blueDst += 4; ++ greenDst += 4; ++ redDst += 4; ++ } ++ ++} ++ ++/* ------------------------------------------------------------*/ ++/* ALPHABLEND PRIMITIVES */ ++BOOL _DIBDRV_AlphaBlend_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT widthDst, INT heightDst, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, int widthSrc, int heightSrc, BLENDFUNCTION blendFn) ++{ ++ /* flags indicating wether source should be stretched */ ++ BOOL horStretch = (widthSrc != widthDst); ++ BOOL verStretch = (heightSrc != heightDst); ++ ++ /* constant alpha value */ ++ BYTE constAlpha = blendFn.SourceConstantAlpha; ++ ++ /* source and dest bitmaps */ ++ const DIBDRVBITMAP *srcBmp = &physDevSrc->physBitmap; ++ DIBDRVBITMAP *dstBmp = &physDevDst->physBitmap; ++ ++ /* source and destination line buffers */ ++ DWORD *sBuf = HeapAlloc(GetProcessHeap(), 0, abs(srcBmp->stride)); ++ DWORD *dBuf = HeapAlloc(GetProcessHeap(), 0, abs(dstBmp->stride)); ++ ++ int ys = ySrc; ++ int yd = yDst; ++ int iLine; ++ int delta; ++ ++ /* in order to optimize a bit, we divide the routine in 4 parts, ++ depending on stretching modes */ ++ if(!horStretch && !verStretch) ++ { ++ /* simplest case, no stretching needed */ ++ MAYBE(TRACE("No stretching\n")); ++ for(iLine = 0; iLine < heightSrc; iLine++, ys++, yd++) ++ { ++ /* load source and dest lines */ ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBuf); ++ dstBmp->funcs->GetLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ /* premultiply source by constant and pixel alpha */ ++ PemultiplyLine(sBuf, widthSrc, constAlpha); ++ ++ /* blends source on dest */ ++ BlendLine(dBuf, sBuf, widthSrc); ++ ++ /* puts dest line back */ ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ else if (horStretch && !verStretch) ++ { ++ /* just horizontal stretching needed */ ++ DWORD *strBuf = HeapAlloc(GetProcessHeap(), 0, abs(dstBmp->stride)); ++ MAYBE(TRACE("Horizontal stretching\n")); ++ ++ for(iLine = 0; iLine < heightSrc; iLine++, ys++, yd++) ++ { ++ /* load source and dest lines */ ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBuf); ++ dstBmp->funcs->GetLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ /* stretch source line to match dest one */ ++ StretchLine(strBuf, widthDst, sBuf, widthSrc); ++ ++ /* premultiply source by constant and pixel alpha */ ++ PemultiplyLine(strBuf, widthDst, constAlpha); ++ ++ /* blends source on dest */ ++ BlendLine(dBuf, sBuf, widthDst); ++ ++ /* puts dest line back */ ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ HeapFree(GetProcessHeap(), 0, strBuf); ++ } ++ else if (!horStretch && verStretch) ++ { ++ /* just vertical stretching needed */ ++ MAYBE(TRACE("Vertical stretching\n")); ++ ++ if(heightSrc > heightDst) ++ { ++ iLine = 0; ++ delta = 0; ++ while(iLine < heightDst) ++ { ++ /* load source and dest lines */ ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBuf); ++ dstBmp->funcs->GetLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ /* premultiply source by constant and pixel alpha */ ++ PemultiplyLine(sBuf, widthSrc, constAlpha); ++ ++ /* blends source on dest */ ++ BlendLine(dBuf, sBuf, widthDst); ++ ++ /* puts dest line back */ ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ iLine++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ iLine = 0; ++ delta = 0; ++ while(iLine < heightSrc) ++ { ++ /* load source line */ ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBuf); ++ ++ /* premultiply source by constant and pixel alpha */ ++ PemultiplyLine(sBuf, widthSrc, constAlpha); ++ ++ while(delta < heightDst) ++ { ++ /* load dest line */ ++ dstBmp->funcs->GetLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ /* blends source on dest */ ++ BlendLine(dBuf, sBuf, widthDst); ++ ++ /* puts dest line back */ ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ iLine++; ++ } ++ } ++ } ++ else ++ { ++ DWORD *strBuf = HeapAlloc(GetProcessHeap(), 0, abs(dstBmp->stride)); ++ /* both stretching needed -- generic case */ ++ MAYBE(TRACE("Horizontal and vertical stretching\n")); ++ ++ if(heightSrc > heightDst) ++ { ++ iLine = 0; ++ delta = 0; ++ while(iLine < heightDst) ++ { ++ /* load source and dest lines */ ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBuf); ++ dstBmp->funcs->GetLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ /* stretch source line to match dest one */ ++ StretchLine(strBuf, widthDst, sBuf, widthSrc); ++ ++ /* premultiply source by constant and pixel alpha */ ++ PemultiplyLine(strBuf, widthDst, constAlpha); ++ ++ /* blends source on dest */ ++ BlendLine(dBuf, strBuf, widthDst); ++ ++ /* puts dest line back */ ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ iLine++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ iLine = 0; ++ delta = 0; ++ while(iLine < heightSrc) ++ { ++ /* load source line */ ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBuf); ++ ++ /* stretch source line to match dest one */ ++ StretchLine(strBuf, widthDst, sBuf, widthSrc); ++ ++ /* premultiply source by constant and pixel alpha */ ++ PemultiplyLine(strBuf, widthDst, constAlpha); ++ ++ while(delta < heightDst) ++ { ++ /* load dest line */ ++ dstBmp->funcs->GetLine(dstBmp, yd, xDst, widthDst, dBuf); ++ ++ /* blends source on dest */ ++ BlendLine(dBuf, strBuf, widthDst); ++ ++ /* puts dest line back */ ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ iLine++; ++ } ++ } ++ HeapFree(GetProcessHeap(), 0, strBuf); ++ } ++ ++ HeapFree(GetProcessHeap(), 0, sBuf); ++ HeapFree(GetProcessHeap(), 0, dBuf); ++ return TRUE; ++} ++ + /* ------------------------------------------------------------*/ + /* BLITTING PRIMITIVES */ + BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, --- wine1.2-1.1.43.orig/debian/patches/dibeng-0008.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0008.patch @@ -0,0 +1,1804 @@ +DIB Engine: fixes clipping, text and more + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/bitblt.c | 22 +++ + dlls/winedib.drv/clipping.c | 63 +++++---- + dlls/winedib.drv/dc.c | 16 ++ + dlls/winedib.drv/dib.c | 41 +++++- + dlls/winedib.drv/dibdrv.h | 27 ++++ + dlls/winedib.drv/font.c | 68 ++++++++- + dlls/winedib.drv/freetype.c | 6 + + dlls/winedib.drv/freetype.h | 4 + + dlls/winedib.drv/graphics.c | 204 +++++++++++++++++++++------- + dlls/winedib.drv/palette.c | 16 +- + dlls/winedib.drv/pen_brush.c | 13 ++ + dlls/winedib.drv/primitives.c | 18 +- + dlls/winedib.drv/primitives_bitblt.c | 26 ++-- + dlls/winedib.drv/primitives_convert.c | 24 ++- + dlls/winedib.drv/primitives_font.c | 242 +++++++++++++++++++++++++-------- + dlls/winedib.drv/primitives_rop3.c | 2 + dlls/winedib.drv/text.c | 239 +++++++++++++++++++-------------- + 17 files changed, 738 insertions(+), 293 deletions(-) + + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index 05c9392..db66142 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -261,6 +261,12 @@ BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + SIZE szSrc, szDst; + int iRec; + RECT dstClip, srcClip; ++ ++ /* converts to device spaces */ ++ _DIBDRV_Position_ws2ds(physDevDst, &xDst, &yDst); ++ _DIBDRV_Sizes_ws2ds(physDevDst, &widthDst, &heightDst); ++ _DIBDRV_Position_ws2ds(physDevSrc, &xSrc, &ySrc); ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &widthSrc, &heightSrc); + + /* first clip on physical DC sizes */ + setPoint(&pd, xDst, yDst); +@@ -320,7 +326,6 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + xDst, yDst, widthDst, heightDst, + physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", + xSrc, ySrc, widthSrc, heightSrc)); +- + + /* if sizes are null or negative, returns false */ + if(widthSrc <= 0 || heightSrc <= 0 || widthDst <= 0 || heightDst <= 0) +@@ -422,6 +427,12 @@ BOOL _DIBDRV_InternalBitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + int iRec; + RECT dstClip, srcClip; + ++ /* converts to device spaces */ ++ _DIBDRV_Position_ws2ds(physDevDst, &xDst, &yDst); ++ _DIBDRV_Sizes_ws2ds(physDevDst, &width, &height); ++ if(physDevSrc) ++ _DIBDRV_Position_ws2ds(physDevSrc, &xSrc, &ySrc); ++ + /* first clip on physical DC sizes */ + setPoint(&pd, xDst, yDst); + setPoint(&ps, xSrc, ySrc); +@@ -633,6 +644,15 @@ BOOL _DIBDRV_InternalStretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + int iRec; + RECT dstClip, srcClip; + ++ /* converts to device spaces */ ++ _DIBDRV_Position_ws2ds(physDevDst, &xDst, &yDst); ++ _DIBDRV_Sizes_ws2ds(physDevDst, &widthDst, &heightDst); ++ if(physDevSrc) ++ { ++ _DIBDRV_Position_ws2ds(physDevSrc, &xSrc, &ySrc); ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &widthSrc, &heightSrc); ++ } ++ + /* first clip on physical DC sizes */ + setPoint(&pd, xDst, yDst); + setPoint(&ps, xSrc, ySrc); +diff --git a/dlls/winedib.drv/clipping.c b/dlls/winedib.drv/clipping.c +index ed10b92..ada1f7f 100644 +--- a/dlls/winedib.drv/clipping.c ++++ b/dlls/winedib.drv/clipping.c +@@ -36,39 +36,44 @@ void DIBDRV_SetDeviceClipping( DIBDRVPHYSDEV *physDev, HRGN vis_rgn, HRGN clip_r + + MAYBE(TRACE("physDev:%p, vis_rgn:%p, clip_rgn:%p\n", physDev, vis_rgn, clip_rgn)); + +- /* sets the region for X11 driver anyways... we may change bitmap later on */ +- _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); +- +- /* then we set the region for DIB engine, same reason */ ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ + +- CombineRgn( physDev->region, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); ++ CombineRgn( physDev->region, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); + +- /* get region rectangles */ +- if(!(size = GetRegionData(physDev->region, 0, NULL))) +- return; +- data = HeapAlloc(GetProcessHeap(), 0, size); +- if (!GetRegionData(physDev->region, size, data)) +- { +- HeapFree( GetProcessHeap(), 0, data ); +- return; +- } +- +- /* frees any previous regions rectangles in DC */ +- if(physDev->regionData) +- HeapFree(GetProcessHeap(), 0, physDev->regionData); ++ /* get region rectangles */ ++ if(!(size = GetRegionData(physDev->region, 0, NULL))) ++ return; ++ data = HeapAlloc(GetProcessHeap(), 0, size); ++ if (!GetRegionData(physDev->region, size, data)) ++ { ++ HeapFree( GetProcessHeap(), 0, data ); ++ return; ++ } + +- /* sets the rectangles on physDev */ +- physDev->regionData = data; +- physDev->regionRects = (RECT *)data->Buffer; +- physDev->regionRectCount = data->rdh.nCount; +- +- if(TRACE_ON(dibdrv)) +- { +- TRACE("Region dump : %d rectangles\n", physDev->regionRectCount); +- for(iRect = 0; iRect < physDev->regionRectCount; iRect++) ++ /* frees any previous regions rectangles in DC */ ++ if(physDev->regionData) ++ HeapFree(GetProcessHeap(), 0, physDev->regionData); ++ ++ /* sets the rectangles on physDev */ ++ physDev->regionData = data; ++ physDev->regionRects = (RECT *)data->Buffer; ++ physDev->regionRectCount = data->rdh.nCount; ++ ++ if(TRACE_ON(dibdrv)) + { +- RECT *r = physDev->regionRects + iRect; +- TRACE("Rect #%03d, x1:%4d, y1:%4d, x2:%4d, y2:%4d\n", iRect, r->left, r->top, r->right, r->bottom); ++ TRACE("Region dump : %d rectangles\n", physDev->regionRectCount); ++ for(iRect = 0; iRect < physDev->regionRectCount; iRect++) ++ { ++ RECT *r = physDev->regionRects + iRect; ++ TRACE("Rect #%03d, x1:%4d, y1:%4d, x2:%4d, y2:%4d\n", iRect, r->left, r->top, r->right, r->bottom); ++ } + } + } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++ } + } +diff --git a/dlls/winedib.drv/dc.c b/dlls/winedib.drv/dc.c +index 8212d42..9ffceee 100644 +--- a/dlls/winedib.drv/dc.c ++++ b/dlls/winedib.drv/dc.c +@@ -43,11 +43,12 @@ static int device_init_done; + + /* NOTE : + Removing TC_RA_ABLE avoids bitmapped fonts, so FT_Face is always non-NULL ++ UPDATE : remove TC_RA_ABLE seems unneeded + Adding TC_VA_ABLE forces to use gdi fonts always, so we can get an FT_Face + */ + unsigned int text_caps = (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE | + TC_CR_ANY | TC_SA_DOUBLE | TC_SA_INTEGER | +- TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE /* | TC_RA_ABLE */ | TC_VA_ABLE); ++ TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE | TC_VA_ABLE); + /* X11R6 adds TC_SF_X_YINDEP, Xrender adds TC_VA_ABLE */ + + +@@ -119,6 +120,10 @@ static void device_init(void) + device_init_done = TRUE; + } + ++/* dummy null function for pen and brush */ ++static void dummy3(DIBDRVPHYSDEV *p, int a, int b, int c) {} ++static void dummy4(DIBDRVPHYSDEV *p, int a, int b, int c, int d) {} ++ + /********************************************************************** + * DIBDRV_CreateDC + */ +@@ -178,12 +183,19 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + physDev->penColor = 0; + _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->penAnd, &physDev->penXor); + ++ physDev->penStyle = PS_NULL; ++ physDev->penHLine = dummy3; ++ physDev->penVLine = dummy3; ++ physDev->penLine = dummy4; ++ physDev->penPattern = NULL; ++ + physDev->brushColor = 0; + _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->brushAnd, &physDev->brushXor); + physDev->brushAnds = NULL; + physDev->brushXors = NULL; + + physDev->brushStyle = BS_NULL; ++ physDev->brushHLine = dummy3; + + physDev->isBrushBitmap = FALSE; + _DIBDRVBITMAP_Clear(&physDev->brushBitmap); +@@ -193,8 +205,10 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + physDev->textColor = 0; + physDev->textBackground = 0; + ++#ifdef DIBDRV_ANTIALIASED_FONTS + /* text color table for antialiased fonts */ + memset(physDev->textColorTable, 0, 256); ++#endif + + /* freetype face associated to current DC HFONT */ + physDev->face = NULL; +diff --git a/dlls/winedib.drv/dib.c b/dlls/winedib.drv/dib.c +index b72c34a..653148d 100644 +--- a/dlls/winedib.drv/dib.c ++++ b/dlls/winedib.drv/dib.c +@@ -65,15 +65,46 @@ INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + const RGBQUAD *colors ) + { +- UINT res; ++ DIBDRVBITMAP *dib = &physDev->physBitmap; + + MAYBE(TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors)); + + /* SetDIBColorTable operates on a DIB, so we use the engine */ +- ONCE(FIXME("STUB\n")); +- res = 0; +- +- return res; ++ ++ /* if bpp > 8, some error occurred... */ ++ if(dib->bitCount > 8) ++ { ++ ERR("Called for BPP > 8\n"); ++ return 0; ++ } ++ ++ /* if dib hasn't a color table, or has a small one, we must before ++ create/extend it */ ++ if(!(dib->colorTable)) ++ { ++ dib->colorTableSize = (1 << dib->bitCount); ++ dib->colorTable = HeapAlloc(GetProcessHeap(), 0, sizeof(RGBQUAD) * dib->colorTableSize); ++ } ++ else if(dib->colorTableSize < (1 << dib->bitCount)) ++ { ++ int newSize = (1 << dib->bitCount); ++ RGBQUAD *newTable = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RGBQUAD) * newSize); ++ memcpy(newTable, dib->colorTable, sizeof(RGBQUAD) * dib->colorTableSize); ++ HeapFree(GetProcessHeap(), 0, dib->colorTable); ++ dib->colorTable = newTable; ++ dib->colorTableSize = newSize; ++ } ++ ++ /* sanity check */ ++ if(start + count > dib->colorTableSize) ++ { ++ ERR("Out of range setting color table, size is %d, requested is %d\n", dib->colorTableSize, start+count); ++ return 0; ++ } ++ memcpy(dib->colorTable + start, colors, sizeof(RGBQUAD) * count); ++ dib->colorTableGrabbed = TRUE; ++ ++ return TRUE; + } + + /*********************************************************************** +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index b0f128e..66cc114 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -44,6 +44,9 @@ + /* enable this if you want debugging (i.e. TRACEs) output */ + #define DIBDRV_ENABLE_MAYBE + ++/* enable this if you want antialiased fonts */ ++#define DIBDRV_ANTIALIASED_FONTS ++ + /* provide a way to make debugging output appear + only once. Usage example: + ONCE(FIXME("Some message\n")); */ +@@ -102,7 +105,7 @@ typedef struct _DIBDRV_PRIMITIVE_FUNCS + const struct _DIBDRVPHYSDEV *physDevSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, DWORD rop ); + + /* font drawing helper */ +- void (* FreetypeBlit) ( struct _DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp); ++ void (* FreetypeBlit) ( struct _DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp); + + } DIBDRV_PRIMITIVE_FUNCS; + +@@ -225,6 +228,9 @@ typedef struct _DIBDRVPHYSDEV + DWORD curDash, leftInDash; + enum MARKSPACE { mark, space } markSpace; + ++ /* pen style */ ++ UINT penStyle; ++ + /* pen drawing functions */ + void (* penHLine) (struct _DIBDRVPHYSDEV *physDev, int x1, int x2, int y); + void (* penVLine) (struct _DIBDRVPHYSDEV *physDev, int x, int y1, int y2); +@@ -250,8 +256,10 @@ typedef struct _DIBDRVPHYSDEV + COLORREF textColor; + COLORREF textBackground; + ++#ifdef DIBDRV_ANTIALIASED_FONTS + /* text color table for antialiased fonts */ + COLORREF textColorTable[256]; ++#endif + + /* freetype face associated to current DC HFONT */ + FT_Face face; +@@ -388,4 +396,21 @@ HBITMAP _DIBDRV_ConvertDevDDBtoDIB( HDC hdcSrc, HDC hdcDst, int xSrc, int ySrc, + * DIBDRV_GetDeviceCaps */ + INT DIBDRV_GetDeviceCaps( DIBDRVPHYSDEV *physDev, INT cap ); + ++/* ********************************************************************* ++ * GEOMETRIC UTILITIES ++ * ********************************************************************/ ++ ++/* intersect 2 rectangles (just to not use USER32 one...) */ ++BOOL _DIBDRV_IntersectRect(RECT *d, const RECT *s1, const RECT *s2); ++ ++/* converts positions from Word space to Device space */ ++void _DIBDRV_Position_ws2ds(DIBDRVPHYSDEV *physDev, int *x, int *y); ++void _DIBDRV_Positions_ws2ds(DIBDRVPHYSDEV *physDev, int *x1, int *y1, int *x2, int *y2); ++ ++/* converts sizes from Word space to Device space */ ++void _DIBDRV_Sizes_ws2ds(DIBDRVPHYSDEV *physDev, int *w, int *h); ++ ++/* converts a rectangle form Word space to Device space */ ++void _DIBDRV_Rect_ws2ds(DIBDRVPHYSDEV *physDev, const RECT *src, RECT *dst); ++ + #endif +diff --git a/dlls/winedib.drv/font.c b/dlls/winedib.drv/font.c +index 215b27d..f7ea8dc 100644 +--- a/dlls/winedib.drv/font.c ++++ b/dlls/winedib.drv/font.c +@@ -26,14 +26,56 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++ ++#if 0 ++/* prints out some info about face */ ++void PrintFaceInfo(FT_Face face) ++{ ++ int i; ++ ++ fprintf(stderr, "----------------------------------------------------------\n"); ++ fprintf(stderr, "Family name :%s\n", face->family_name); ++ fprintf(stderr, "Style name :%s\n", face->style_name); ++ fprintf(stderr, "Num fixed sizes : %d\n", face->num_fixed_sizes); ++ if(face->num_fixed_sizes) ++ { ++ fprintf(stderr, "Fixed sizes :"); ++ for(i = 0; i < face->num_fixed_sizes; i++) ++ fprintf(stderr, " (%d, %d)", face->available_sizes[i].width, face->available_sizes[i].height); ++ fprintf(stderr, "\n"); ++ } ++ fprintf(stderr, "Face flags: "); ++ if(face->face_flags & FT_FACE_FLAG_SCALABLE ) fprintf(stderr, "FT_FACE_FLAG_SCALABLE "); ++ if(face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) fprintf(stderr, "FT_FACE_FLAG_FIXED_SIZES "); ++ if(face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) fprintf(stderr, "FT_FACE_FLAG_FIXED_WIDTH "); ++ if(face->face_flags & FT_FACE_FLAG_SFNT ) fprintf(stderr, "FT_FACE_FLAG_SFNT "); ++ if(face->face_flags & FT_FACE_FLAG_HORIZONTAL ) fprintf(stderr, "FT_FACE_FLAG_HORIZONTAL "); ++ if(face->face_flags & FT_FACE_FLAG_VERTICAL ) fprintf(stderr, "FT_FACE_FLAG_VERTICAL "); ++ if(face->face_flags & FT_FACE_FLAG_KERNING ) fprintf(stderr, "FT_FACE_FLAG_KERNING "); ++ if(face->face_flags & FT_FACE_FLAG_FAST_GLYPHS ) fprintf(stderr, "FT_FACE_FLAG_FAST_GLYPHS "); ++ if(face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) fprintf(stderr, "FT_FACE_FLAG_MULTIPLE_MASTERS "); ++ if(face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) fprintf(stderr, "FT_FACE_FLAG_GLYPH_NAMES "); ++ if(face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) fprintf(stderr, "FT_FACE_FLAG_EXTERNAL_STREAM "); ++ if(face->face_flags & FT_FACE_FLAG_HINTER ) fprintf(stderr, "FT_FACE_FLAG_HINTER "); ++ if(face->face_flags & FT_FACE_FLAG_CID_KEYED ) fprintf(stderr, "FT_FACE_FLAG_CID_KEYED "); ++ if(face->face_flags & FT_FACE_FLAG_TRICKY ) fprintf(stderr, "FT_FACE_FLAG_TRICKY "); ++ fprintf(stderr, "\n"); ++ ++ fprintf(stderr, "Style flags: "); ++ if(face->style_flags & FT_STYLE_FLAG_ITALIC) fprintf(stderr, "FT_STYLE_FLAG_ITALIC "); ++ if(face->style_flags & FT_STYLE_FLAG_BOLD) fprintf(stderr, "FT_STYLE_FLAG_BOLD "); ++ fprintf(stderr, "\n"); ++ fprintf(stderr, "----------------------------------------------------------\n"); ++} ++#endif ++ ++ + /********************************************************************** + * DIBDRV_SetTextColor + */ + COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + { + COLORREF res; +- INT r, g, b; +- INT i; + + MAYBE(TRACE("physDev:%p, color:%08x\n", physDev, color)); + +@@ -45,24 +87,30 @@ COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + if(color == physDev->textColor) + return color; + +- /* stores old color */ ++ /* stores old color and sets new one */ + res = physDev->textColor; +- ++ physDev->textColor = color; ++ ++#ifdef DIBDRV_ANTIALIASED_FONTS + /* fills the text color table used on antialiased font display */ + if(physDev->physBitmap.funcs) + { ++ BYTE r, g, b; ++ INT i; ++ + r = GetRValue(color); + g = GetGValue(color); + b = GetBValue(color); + for(i = 0; i < 256; i++) + { + physDev->textColorTable[i] = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, RGB( +- MulDiv(r, i, 256), +- MulDiv(g, i, 256), +- MulDiv(b, i, 256) ++ MulDiv(r, i, 255), ++ MulDiv(g, i, 255), ++ MulDiv(b, i, 255) + )); + } + } ++#endif + + /* returns previous text color */ + return res; +@@ -111,7 +159,11 @@ HFONT DIBDRV_SelectFont( DIBDRVPHYSDEV *physDev, HFONT hfont, GdiFont *gdiFont ) + FIXME("Error, null Ft_Face\n"); + return hfont; + } +- ++ ++#if 0 ++ /* prints out some info about face */ ++ if(TRACE_ON(dibdrv)) MAYBE(PrintFaceInfo(physDev->face)); ++#endif + /* setup the correct charmap.... maybe */ + for (i = 0; i < physDev->face->num_charmaps; ++i) + { +diff --git a/dlls/winedib.drv/freetype.c b/dlls/winedib.drv/freetype.c +index 111a18b..f1cd7b4 100644 +--- a/dlls/winedib.drv/freetype.c ++++ b/dlls/winedib.drv/freetype.c +@@ -46,6 +46,9 @@ MAKE_FUNCPTR(FT_Set_Pixel_Sizes) + MAKE_FUNCPTR(FT_Get_First_Char) + MAKE_FUNCPTR(FT_Render_Glyph) + MAKE_FUNCPTR(FT_Glyph_Transform) ++MAKE_FUNCPTR(FT_Bitmap_New) ++MAKE_FUNCPTR(FT_Bitmap_Done) ++MAKE_FUNCPTR(FT_Bitmap_Convert) + #undef MAKE_FUNCPTR + + /* freetype initialization flag */ +@@ -95,6 +98,9 @@ BOOL _DIBDRV_FreeType_Init(void) + LOAD_FUNCPTR(FT_Get_First_Char) + LOAD_FUNCPTR(FT_Render_Glyph) + LOAD_FUNCPTR(FT_Glyph_Transform) ++ LOAD_FUNCPTR(FT_Bitmap_New) ++ LOAD_FUNCPTR(FT_Bitmap_Done) ++ LOAD_FUNCPTR(FT_Bitmap_Convert) + #undef LOAD_FUNCPTR + + error = pFT_Init_FreeType(&DIBDRV_ftLibrary); +diff --git a/dlls/winedib.drv/freetype.h b/dlls/winedib.drv/freetype.h +index 93619ff..3517af5 100644 +--- a/dlls/winedib.drv/freetype.h ++++ b/dlls/winedib.drv/freetype.h +@@ -28,6 +28,7 @@ + #include FT_TRUETYPE_TABLES_H + #include FT_SFNT_NAMES_H + #include FT_TRUETYPE_IDS_H ++#include FT_BITMAP_H + + /* freetype library handle */ + extern FT_Library DIBDRV_ftLibrary; +@@ -179,6 +180,9 @@ MAKE_FUNCPTR(FT_Set_Pixel_Sizes) + MAKE_FUNCPTR(FT_Get_First_Char) + MAKE_FUNCPTR(FT_Render_Glyph) + MAKE_FUNCPTR(FT_Glyph_Transform) ++MAKE_FUNCPTR(FT_Bitmap_New) ++MAKE_FUNCPTR(FT_Bitmap_Done) ++MAKE_FUNCPTR(FT_Bitmap_Convert) + #undef MAKE_FUNCPTR + + #endif /* HAVE_FREETYPE */ +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +index fba34f5..f62149c 100644 +--- a/dlls/winedib.drv/graphics.c ++++ b/dlls/winedib.drv/graphics.c +@@ -295,7 +295,7 @@ static BOOL ScanPolygon(const POINT *pt, int count, int ys, POINT **scans, int * + } + + /* gets bounding box of a polygon */ +-void PolygonBoundingBox(const POINT *pt, int count, RECT *bBox) ++static void PolygonBoundingBox(const POINT *pt, int count, RECT *bBox) + { + const POINT *p; + int iPoint; +@@ -311,6 +311,76 @@ void PolygonBoundingBox(const POINT *pt, int count, RECT *bBox) + } + } + ++/* intersect 2 rectangles (just to not use USER32 one...) ++ bottom and tight sides are considered OUTSIDE */ ++BOOL _DIBDRV_IntersectRect(RECT *d, const RECT *s1, const RECT *s2) ++{ ++ if(s1->right <= s2->left || ++ s2->right <= s1->left || ++ s1->bottom <= s2->top || ++ s2->bottom <= s1->top ++ ) ++ return FALSE; ++ d->left = s1->left > s2->left ? s1->left : s2->left; ++ d->top = s1->top > s2->top ? s1->top : s2->top; ++ d->right = s1->right < s2->right ? s1->right : s2->right; ++ d->bottom = s1->bottom < s2->bottom ? s1->bottom : s2->bottom; ++ return TRUE; ++} ++ ++/* converts a rectangle form Word space to Device space */ ++void _DIBDRV_Rect_ws2ds(DIBDRVPHYSDEV *physDev, const RECT *src, RECT *dst) ++{ ++ POINT pts[2]; ++ pts[0].x = src->left; ++ pts[0].y = src->top; ++ pts[1].x = src->right; ++ pts[1].y = src->bottom; ++ LPtoDP(physDev->hdc, pts, 2); ++ dst->left = pts[0].x; ++ dst->top = pts[0].y; ++ dst->right = pts[1].x; ++ dst->bottom = pts[1].y; ++} ++ ++/* converts positions from Word space to Device space */ ++void _DIBDRV_Position_ws2ds(DIBDRVPHYSDEV *physDev, int *x, int *y) ++{ ++ POINT p; ++ p.x = *x; ++ p.y = *y; ++ LPtoDP(physDev->hdc, &p, 1); ++ *x = p.x; ++ *y = p.y; ++} ++ ++void _DIBDRV_Positions_ws2ds(DIBDRVPHYSDEV *physDev, int *x1, int *y1, int *x2, int *y2) ++{ ++ POINT pts[2]; ++ pts[0].x = *x1; ++ pts[0].y = *y1; ++ pts[1].x = *x2; ++ pts[1].y = *y2; ++ LPtoDP(physDev->hdc, pts, 2); ++ *x1 = pts[0].x; ++ *y1 = pts[0].y; ++ *x2 = pts[1].x; ++ *y2 = pts[1].y; ++} ++ ++/* converts sizes from Word space to Device space */ ++void _DIBDRV_Sizes_ws2ds(DIBDRVPHYSDEV *physDev, int *w, int *h) ++{ ++ POINT pts[2]; ++ pts[0].x = 0; ++ pts[0].y = 0; ++ pts[1].x = *w; ++ pts[1].y = *h; ++ LPtoDP(physDev->hdc, pts, 2); ++ *w = pts[1].x - pts[0].x; ++ *h = pts[1].y - pts[0].y; ++} ++ + /*********************************************************************** + * DIBDRV_Arc + */ +@@ -446,6 +516,7 @@ COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, int x, int y ) + + if(physDev->hasDIB) + { ++ _DIBDRV_Position_ws2ds(physDev, &x, &y); + res = physDev->physBitmap.funcs->GetPixel(&physDev->physBitmap, x, y); + } + else +@@ -463,22 +534,44 @@ BOOL DIBDRV_LineTo( DIBDRVPHYSDEV *physDev, int x, int y ) + { + BOOL res; + POINT curPos; ++ RECT *r; ++ int iRec; ++ POINT p1, p2, pc1, pc2; + + MAYBE(TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y)); + + if(physDev->hasDIB) + { ++ res = FALSE; + GetCurrentPositionEx(physDev->hdc, &curPos); + +- _DIBDRV_ResetDashOrigin(physDev); ++ /* converts position to device space */ ++ p1.x = curPos.x; p1.y = curPos.y; ++ p2.x = x; p2.y = y; ++ LPtoDP(physDev->hdc, &p1, 1); ++ LPtoDP(physDev->hdc, &p2, 1); + +- if(curPos.y == y) +- physDev->penHLine(physDev, curPos.x, x, y); +- else if(curPos.x == x) +- physDev->penVLine(physDev, x, curPos.y, y); +- else +- physDev->penLine(physDev, curPos.x, curPos.y, x, y); +- res = TRUE; ++ /* cycle on all current clipping rectangles */ ++ r = physDev->regionRects; ++ for(iRec = 0; iRec < physDev->regionRectCount; iRec++, r++) ++ { ++ _DIBDRV_ResetDashOrigin(physDev); ++ ++ /* clipe line on current region area */ ++ if(ClipLine(&p1, &p2, r, &pc1, &pc2)) ++ { ++ if(pc1.y == pc2.y) ++ physDev->penHLine(physDev, pc1.x, pc2.x, pc1.y); ++ else if(pc1.x == pc2.x) ++ physDev->penVLine(physDev, pc1.x, pc1.y, pc2.y); ++ else ++ physDev->penLine(physDev, pc1.x, pc1.y, pc2.x, pc2.y); ++ res = TRUE; ++ } ++ } ++ ++ /* moves current position to next point */ ++ MoveToEx(physDev->hdc, x, y, NULL); + } + else + { +@@ -583,7 +676,7 @@ BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* ptw, int count ) + POINT pc1, pc2; + + MAYBE(TRACE("physDev:%p, pt:%p, count:%d\n", physDev, ptw, count)); +- ++ + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +@@ -771,58 +864,67 @@ BOOL DIBDRV_PolyPolyline( DIBDRVPHYSDEV *physDev, const POINT* pt, const DWORD* + */ + BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2) + { +- BOOL res = TRUE; ++ BOOL res; + int i; +- DIBDRVBITMAP *bmp = &physDev->physBitmap; ++ RECT rWorld, rDevice, rClipped; ++ RECT *r; ++ int iRec; + + MAYBE(TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", physDev, x1, y1, x2, y2)); + + if(physDev->hasDIB) + { ++ res = FALSE; ++ + OrderInt(&x1, &x2); + OrderInt(&y1, &y2); + +- /* temporary fix.... should be done by clipping */ +- if(x1 < 0) x1 = 0; +- if(x2 < 0) x2 = 0; +- if(y1 < 0) y1 = 0; +- if(y2 < 0) y2 = 0; +- if(x1 >= bmp->width) x1 = bmp->width - 1; +- if(y1 >= bmp->height) y1 = bmp->height - 1; +- if(x2 > bmp->width) x2 = bmp->width; +- if(y2 > bmp->height) y2 = bmp->height ; +- if(x1 >= x2 || y1 >= y2) +- goto fin; ++ /* converts to device space */ ++ rWorld.left = x1; rWorld.top = y1; rWorld.right = x2; rWorld.bottom = y2; ++ _DIBDRV_Rect_ws2ds(physDev, &rWorld, &rDevice); + +- _DIBDRV_ResetDashOrigin(physDev); +- +- /* particular case where the rectangle +- degenerates to a line or a point */ +- if(x1 >= x2 - 1) +- { +- physDev->penVLine(physDev, x1, y1, y2); +- goto fin; +- } +- else if (y1 >= y2 -1) ++ /* loop on all clip region rectangles */ ++ r = physDev->regionRects; ++ for(iRec = 0; iRec < physDev->regionRectCount; iRec++, r++) + { +- physDev->penHLine(physDev, x1, x2, y1); +- goto fin; +- } +- +- /* Draw the perimeter */ +- physDev->penHLine(physDev, x1 , x2 , y1 ); +- physDev->penHLine(physDev, x1 , x2 , y2 - 1); +- physDev->penVLine(physDev, x1 , y1 + 1, y2 - 1); +- physDev->penVLine(physDev, x2 - 1, y1 + 1, y2 - 1); +- +- /* fill the inside */ +- if(x2 >= x1 + 2) +- for (i = y1 + 1; i < y2 - 1; i++) +- physDev->brushHLine(physDev, x1 + 1, x2 - 1, i); ++ /* clips rectangle to current region */ ++ if(_DIBDRV_IntersectRect(&rClipped, &rDevice, r)) ++ { ++ x1 = rClipped.left; y1 = rClipped.top; ++ x2 = rClipped.right; y2 = rClipped.bottom; ++ ++ _DIBDRV_ResetDashOrigin(physDev); ++ ++ /* fill the inside, if not null brush */ ++ if(physDev->brushStyle != BS_NULL) ++ { ++ if(x2 > x1) ++ for (i = y1; i < y2; i++) ++ physDev->brushHLine(physDev, x1, x2, i); ++ } + +- res = TRUE; +-fin: +- ; ++ /* draw perimeter, if not null pen */ ++ if(physDev->penStyle != PS_NULL) ++ { ++ ++ /* particular case where the rectangle ++ degenerates to a line or a point */ ++ if(x1 >= x2 - 1) ++ physDev->penVLine(physDev, x1, y1, y2); ++ else if (y1 >= y2 -1) ++ physDev->penHLine(physDev, x1, x2, y1); ++ else ++ { ++ /* Draw the perimeter */ ++ physDev->penHLine(physDev, x1 , x2 , y1 ); ++ physDev->penHLine(physDev, x1 , x2 , y2 - 1); ++ physDev->penVLine(physDev, x1 , y1 + 1, y2 - 1); ++ physDev->penVLine(physDev, x2 - 1, y1 + 1, y2 - 1); ++ } ++ } ++ res = TRUE; ++ } ++ } + } + else + { +@@ -870,6 +972,8 @@ COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, int x, int y, COLORREF color ) + + if(physDev->hasDIB) + { ++ _DIBDRV_Position_ws2ds(physDev, &x, &y); ++ + /* gets previous pixel */ + res = physDev->physBitmap.funcs->GetPixel(&physDev->physBitmap, x, y); + +diff --git a/dlls/winedib.drv/palette.c b/dlls/winedib.drv/palette.c +index 148a6d5..a1aa648 100644 +--- a/dlls/winedib.drv/palette.c ++++ b/dlls/winedib.drv/palette.c +@@ -30,18 +30,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + */ + UINT DIBDRV_RealizePalette( DIBDRVPHYSDEV *physDev, HPALETTE hpal, BOOL primary ) + { +- UINT res; ++ UINT res = 0; + + MAYBE(TRACE("physDev:%p, hpal:%p, primary:%s\n", physDev, hpal, (primary ? "TRUE" : "FALSE"))); + +- /* we should in any case call X11 function, as UnrealizePalette() doesn't +- * take a physDev parameter */ +- res = _DIBDRV_GetDisplayDriver()->pRealizePalette(physDev->X11PhysDev, hpal, primary); +- +- if(physDev->hasDIB) ++ if(physDev && physDev->hasDIB) + { + /* DIB section selected in, additional (if needed) engine code */ + ONCE(FIXME("STUB\n")); ++ res = 0; ++ } ++ else ++ { ++ /* we should in any case call X11 function, as UnrealizePalette() doesn't ++ * take a physDev parameter */ ++ res = _DIBDRV_GetDisplayDriver()->pRealizePalette(physDev ? physDev->X11PhysDev : NULL, hpal, primary); ++ + } + + return res; +diff --git a/dlls/winedib.drv/pen_brush.c b/dlls/winedib.drv/pen_brush.c +index 31c9cd2..7b15ece 100644 +--- a/dlls/winedib.drv/pen_brush.c ++++ b/dlls/winedib.drv/pen_brush.c +@@ -290,6 +290,12 @@ static void PatternBrushHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + physDev->physBitmap.funcs->PatternHLine(&physDev->physBitmap, x1, x2, y, and, xor, physDev->brushBitmap.width, x1 % physDev->brushBitmap.width); + } + ++/* null function for PS_NULL and BS_NULL pen and brush styles */ ++void NullPenHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) {} ++void NullPenVLine(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) {} ++void NullPenLine(DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2) {} ++void NullBrushHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) {} ++ + /*********************************************************************** + * DIBDRV_SelectPen + */ +@@ -335,6 +341,12 @@ HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen ) + physDev->penPattern = &dashPatterns[logpen.lopnStyle - PS_DASH]; + _DIBDRV_ResetDashOrigin(physDev); + break; ++ case PS_NULL: ++ physDev->penHLine = NullPenHLine; ++ physDev->penVLine = NullPenVLine; ++ physDev->penLine = NullPenLine; ++ physDev->penPattern = NULL; ++ break; + } + res = hpen; + } +@@ -484,6 +496,7 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + { + MAYBE(TRACE("NULL Pattern\n")); + physDev->brushColorref = 0; ++ physDev->brushHLine = NullBrushHLine; + goto solid; + } + +diff --git a/dlls/winedib.drv/primitives.c b/dlls/winedib.drv/primitives.c +index a2fa04a..2b0fc6e 100644 +--- a/dlls/winedib.drv/primitives.c ++++ b/dlls/winedib.drv/primitives.c +@@ -139,15 +139,15 @@ BOOL _DIBDRV_AlphaBlend_generic(DIBDRVPHYSDEV *physDevDst, int xDst, int yDst, + + /* ------------------------------------------------------------*/ + /* FREETYPE FONT BITMAP BLITTING */ +-void _DIBDRV_freetype_blit_8888 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_32_RGB (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_24 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_16_RGB (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_8 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_4 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); +-void _DIBDRV_freetype_blit_1 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_8888 (DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_32_RGB (DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_24 (DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_16_RGB (DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_8 (DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_4 (DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_1 (DIBDRVPHYSDEV *dib, int x, int y, RECT *clipRec, FT_Bitmap *bmp); + + DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_RGB = + { +diff --git a/dlls/winedib.drv/primitives_bitblt.c b/dlls/winedib.drv/primitives_bitblt.c +index 7540dad..7feeb49 100644 +--- a/dlls/winedib.drv/primitives_bitblt.c ++++ b/dlls/winedib.drv/primitives_bitblt.c +@@ -216,7 +216,7 @@ BOOL _DIBDRV_AlphaBlend_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + PemultiplyLine(strBuf, widthDst, constAlpha); + + /* blends source on dest */ +- BlendLine(dBuf, sBuf, widthDst); ++ BlendLine(dBuf, strBuf, widthDst); + + /* puts dest line back */ + dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); +@@ -391,6 +391,10 @@ BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000)); + useDst = (((rop >> 1) & 0x550000) != (rop & 0x550000)); + ++ /* sanity check -- MSN messenger crashes without */ ++ if(useSrc && !physDevSrc) ++ return FALSE; ++ + /* gets source, dest and pattern bitmaps, if available */ + if(usePat && physDevDst->isBrushBitmap) + patBmp = &physDevDst->brushBmpCache; +@@ -501,8 +505,8 @@ BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + { + srcBmp->funcs->GetLine(srcBmp, ys, xSrc, width, dBuf); + patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, width, pBuf); +- wDstPnt = sBuf; +- wSrcPnt = sBuf; ++ wDstPnt = dBuf; ++ wSrcPnt = dBuf; + wPatPnt = pBuf; + for(i = width; i > 0 ; i--) + { +@@ -521,8 +525,8 @@ BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) + { + srcBmp->funcs->GetLine(srcBmp, ys, xSrc, width, dBuf); +- wDstPnt = sBuf; +- wSrcPnt = sBuf; ++ wDstPnt = dBuf; ++ wSrcPnt = dBuf; + for(i = width; i > 0 ; i--) + { + *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, 0, rop); +@@ -538,9 +542,9 @@ BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + goto error; + for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) + { +- dstBmp->funcs->GetLine(srcBmp, ys, xDst, width, dBuf); ++ dstBmp->funcs->GetLine(dstBmp, ys, xDst, width, dBuf); + patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, width, pBuf); +- wDstPnt = sBuf; ++ wDstPnt = dBuf; + wPatPnt = pBuf; + for(i = width; i > 0 ; i--) + { +@@ -558,8 +562,8 @@ BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + MAYBE(TRACE("BitBlt use: dst\n")); + for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) + { +- dstBmp->funcs->GetLine(srcBmp, ys, xDst, width, dBuf); +- wDstPnt = sBuf; ++ dstBmp->funcs->GetLine(dstBmp, ys, xDst, width, dBuf); ++ wDstPnt = dBuf; + for(i = width; i > 0 ; i--) + { + *wDstPnt = _DIBDRV_ROP3(patColor, 0, *wDstPnt, rop); +@@ -638,6 +642,10 @@ BOOL _DIBDRV_StretchBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000)); + useDst = (((rop >> 1) & 0x550000) != (rop & 0x550000)); + ++ /* sanity check -- MSN messenger crashes without */ ++ if(useSrc && !physDevSrc) ++ return FALSE; ++ + /* gets source, dest and pattern bitmaps, if available */ + if(usePat && physDevDst->isBrushBitmap) + patBmp = &physDevDst->brushBmpCache; +diff --git a/dlls/winedib.drv/primitives_convert.c b/dlls/winedib.drv/primitives_convert.c +index 800e3fd..f8f87ce 100644 +--- a/dlls/winedib.drv/primitives_convert.c ++++ b/dlls/winedib.drv/primitives_convert.c +@@ -292,7 +292,7 @@ BOOL _DIBDRV_GetLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + + src = ((BYTE *)bmp->bits + line * bmp->stride + (startx >> 3)); + /* get first partial byte, if any */ +- startx = (8 - (startx & 0x03)) & 0x03; ++ startx = (8 - (startx & 0x07)) & 0x07; + width -= startx; + if(startx) + { +@@ -322,7 +322,7 @@ BOOL _DIBDRV_GetLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + } + + /* last partial byte, if any */ +- if(width) ++ if(width > 0) + { + b = *src; + while(width--) +@@ -398,13 +398,17 @@ BOOL _DIBDRV_PutLine16_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, + DWORD *dwBuf = (DWORD *)buf; + WORD *dst = (WORD *)((BYTE *)bmp->bits + line * bmp->stride + 2 * startx); + DWORD c; ++ ++ BYTE bShift = 8 - bmp->blueLen; ++ BYTE gShift = 16 - bmp->greenLen; ++ BYTE rShift = 24 - bmp->redLen; + for(; width; width--) + { + c = *dwBuf++; + *dst++ = +- ((( c & 0x000000ff) << bmp->blueShift) & bmp->blueMask) | +- ((((c & 0x0000ff00) >> 8) << bmp->greenShift) & bmp->greenMask) | +- ((((c & 0x00ff0000) >> 16) << bmp->redShift) & bmp->redMask); ++ ((((c & 0x000000ff) >> bShift) << bmp->blueShift) & bmp->blueMask) | ++ ((((c & 0x0000ff00) >> gShift) << bmp->greenShift) & bmp->greenMask) | ++ ((((c & 0x00ff0000) >> rShift) << bmp->redShift) & bmp->redMask); + } + return TRUE; + } +@@ -480,7 +484,7 @@ BOOL _DIBDRV_PutLine4(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + } + + /* last nibble, if any */ +- if(width) ++ if(width > 0) + { + c = *dwBuf; + +@@ -500,14 +504,14 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + BYTE b, mask; + char i; + DWORD c; +- ++ + /* get foreground color */ + DWORD fore = *((DWORD *)bmp->colorTable + 1) & 0x00ffffff; + + /* put first partial byte, if any */ +- startx &= 0x03; ++ startx &= 0x07; + mask = 0x80 >> startx; +- startx = (8 - startx) & 0x03; ++ startx = (8 - startx) & 0x07; + if(startx) + { + width -= startx; +@@ -540,7 +544,7 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + } + + /* last partial byte, if any */ +- if(width) ++ if(width > 0) + { + b = *dst; + mask = 0x80; +diff --git a/dlls/winedib.drv/primitives_font.c b/dlls/winedib.drv/primitives_font.c +index dd1d64b..e604a39 100644 +--- a/dlls/winedib.drv/primitives_font.c ++++ b/dlls/winedib.drv/primitives_font.c +@@ -27,7 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + + /* ------------------------------------------------------------*/ + /* FREETYPE FONT BITMAP BLITTING */ +-void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -35,13 +35,20 @@ void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; +- DWORD c; ++ int xMin, xMax, yMin, yMax; + DWORD *ptr; ++#ifdef DIBDRV_ANTIALIASED_FONTS ++ DWORD c; ++ BYTE r, g, b, negColor; ++#else ++ DWORD c = dib->funcs->ColorToPixel(dib, physDev->textColor); ++#endif + +- /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ /* gets clip limits */ ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -50,9 +57,21 @@ void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap + ptr = (DWORD *)((BYTE *)dib->bits + (dibY * dib->stride) + x * 4); + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + { ++#ifdef DIBDRV_ANTIALIASED_FONTS + c = physDev->textColorTable[*buf]; ++ if(*buf < 255) ++ { ++ negColor = 255 - *buf; ++ r = (*ptr >> 16) & 0xff; ++ g = (*ptr >> 8) & 0xff; ++ b = *ptr & 0xff; ++ c += MulDiv(r, 255 - *buf, 255) << 16 | ++ MulDiv(g, 255 - *buf, 255) << 8 | ++ MulDiv(r, 255 - *buf, 255); ++ } ++#endif + *ptr = c; + } + buf++; +@@ -61,7 +80,7 @@ void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap + } + } + +-void _DIBDRV_freetype_blit_32_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_32_RGB(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -69,30 +88,52 @@ void _DIBDRV_freetype_blit_32_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitma + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; ++ int xMin, xMax, yMin, yMax; ++ DWORD *ptr; ++#ifdef DIBDRV_ANTIALIASED_FONTS + DWORD c; ++ BYTE r, g, b, negColor; ++#else ++ DWORD c = dib->funcs->ColorToPixel(dib, physDev->textColor); ++#endif + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; + for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) + { ++ ptr = (DWORD *)((BYTE *)dib->bits + (dibY * dib->stride) + x * 4); + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + { ++#ifdef DIBDRV_ANTIALIASED_FONTS + c = physDev->textColorTable[*buf]; +- dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ if(*buf < 255) ++ { ++ negColor = 255 - *buf; ++ r = (*ptr >> 16) & 0xff; ++ g = (*ptr >> 8) & 0xff; ++ b = *ptr & 0xff; ++ c += MulDiv(r, 255 - *buf, 255) << 16 | ++ MulDiv(g, 255 - *buf, 255) << 8 | ++ MulDiv(r, 255 - *buf, 255); ++ } ++#endif ++ *ptr = c; + } + buf++; ++ ptr++; + } + } + } + +-void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -100,12 +141,20 @@ void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; ++ int xMin, xMax, yMin, yMax; ++#ifdef DIBDRV_ANTIALIASED_FONTS + DWORD c; ++ COLORREF pix; ++ BYTE r, g, b, negColor; ++#else ++ DWORD c = dib->funcs->ColorToPixel(dib, physDev->textColor); ++#endif + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -113,9 +162,22 @@ void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT + { + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + { ++#ifdef DIBDRV_ANTIALIASED_FONTS + c = physDev->textColorTable[*buf]; ++ if(*buf < 255) ++ { ++ negColor = 255 - *buf; ++ pix = dib->funcs->GetPixel(dib, dibX, dibY); ++ r = pix & 0xff; ++ g = (pix >> 8) & 0xff; ++ b = (pix >> 16) & 0xff; ++ c += MulDiv(r, 255 - *buf, 255) << 16 | ++ MulDiv(g, 255 - *buf, 255) << 8 | ++ MulDiv(r, 255 - *buf, 255); ++ } ++#endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); + } + buf++; +@@ -123,7 +185,7 @@ void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT + } + } + +-void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -131,12 +193,20 @@ void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *b + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; ++ int xMin, xMax, yMin, yMax; ++#ifdef DIBDRV_ANTIALIASED_FONTS + DWORD c; ++ COLORREF pix; ++ BYTE r, g, b, negColor; ++#else ++ DWORD c = dib->funcs->ColorToPixel(dib, physDev->textColor); ++#endif + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -144,9 +214,22 @@ void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *b + { + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + { ++#ifdef DIBDRV_ANTIALIASED_FONTS + c = physDev->textColorTable[*buf]; ++ if(*buf < 255) ++ { ++ negColor = 255 - *buf; ++ pix = dib->funcs->GetPixel(dib, dibX, dibY); ++ r = pix & 0xff; ++ g = (pix >> 8) & 0xff; ++ b = (pix >> 16) & 0xff; ++ c += MulDiv(r, 255 - *buf, 255) << 16 | ++ MulDiv(g, 255 - *buf, 255) << 8 | ++ MulDiv(r, 255 - *buf, 255); ++ } ++#endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); + } + buf++; +@@ -154,7 +237,7 @@ void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *b + } + } + +-void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -162,12 +245,20 @@ void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitma + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; ++ int xMin, xMax, yMin, yMax; ++#ifdef DIBDRV_ANTIALIASED_FONTS + DWORD c; ++ COLORREF pix; ++ BYTE r, g, b, negColor; ++#else ++ DWORD c = dib->funcs->ColorToPixel(dib, physDev->textColor); ++#endif + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -175,9 +266,22 @@ void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitma + { + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + { ++#ifdef DIBDRV_ANTIALIASED_FONTS + c = physDev->textColorTable[*buf]; ++ if(*buf < 255) ++ { ++ negColor = 255 - *buf; ++ pix = dib->funcs->GetPixel(dib, dibX, dibY); ++ r = pix & 0xff; ++ g = (pix >> 8) & 0xff; ++ b = (pix >> 16) & 0xff; ++ c += MulDiv(r, 255 - *buf, 255) << 16 | ++ MulDiv(g, 255 - *buf, 255) << 8 | ++ MulDiv(r, 255 - *buf, 255); ++ } ++#endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); + } + buf++; +@@ -185,7 +289,7 @@ void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitma + } + } + +-void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -193,12 +297,20 @@ void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; ++ int xMin, xMax, yMin, yMax; ++#ifdef DIBDRV_ANTIALIASED_FONTS + DWORD c; ++ COLORREF pix; ++ BYTE r, g, b, negColor; ++#else ++ DWORD c = dib->funcs->ColorToPixel(dib, physDev->textColor); ++#endif + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -206,9 +318,22 @@ void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT + { + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + { ++#ifdef DIBDRV_ANTIALIASED_FONTS + c = physDev->textColorTable[*buf]; ++ if(*buf < 255) ++ { ++ negColor = 255 - *buf; ++ pix = dib->funcs->GetPixel(dib, dibX, dibY); ++ r = pix & 0xff; ++ g = (pix >> 8) & 0xff; ++ b = (pix >> 16) & 0xff; ++ c += MulDiv(r, 255 - *buf, 255) << 16 | ++ MulDiv(g, 255 - *buf, 255) << 8 | ++ MulDiv(r, 255 - *buf, 255); ++ } ++#endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); + } + buf++; +@@ -216,7 +341,7 @@ void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT + } + } + +-void _DIBDRV_freetype_blit_8(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_8(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -224,12 +349,14 @@ void _DIBDRV_freetype_blit_8(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bm + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; +- DWORD c; ++ int xMin, xMax, yMin, yMax; ++ DWORD c = physDev->textColor; + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -237,17 +364,14 @@ void _DIBDRV_freetype_blit_8(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bm + { + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) +- { +- c = physDev->textColorTable[*buf]; ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); +- } + buf++; + } + } + } + +-void _DIBDRV_freetype_blit_4(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_4(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -255,12 +379,14 @@ void _DIBDRV_freetype_blit_4(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bm + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; +- DWORD c; ++ int xMin, xMax, yMin, yMax; ++ DWORD c = physDev->textColor; + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -268,17 +394,14 @@ void _DIBDRV_freetype_blit_4(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bm + { + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) +- { +- c = physDev->textColorTable[*buf]; ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); +- } + buf++; + } + } + } + +-void _DIBDRV_freetype_blit_1(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++void _DIBDRV_freetype_blit_1(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec, FT_Bitmap *bmp) + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +@@ -286,12 +409,14 @@ void _DIBDRV_freetype_blit_1(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bm + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +- int DIBX, DIBY; +- DWORD c; ++ int xMin, xMax, yMin, yMax; ++ DWORD c = physDev->textColor; + + /* gets DIB limits */ +- DIBX = dib->width; +- DIBY = dib->height; ++ xMin = clipRec->left; ++ yMin = clipRec->top; ++ xMax = clipRec->right; ++ yMax = clipRec->bottom; + + /* loop for every pixel in bitmap */ + buf = bmp->buffer; +@@ -299,11 +424,8 @@ void _DIBDRV_freetype_blit_1(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bm + { + for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) + { +- if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) +- { +- c = physDev->textColorTable[*buf]; ++ if(dibX < xMax && dibY < yMax && dibX >= xMin && dibY >= yMin && *buf) + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); +- } + buf++; + } + } +diff --git a/dlls/winedib.drv/primitives_rop3.c b/dlls/winedib.drv/primitives_rop3.c +index 398258b..05ce494 100644 +--- a/dlls/winedib.drv/primitives_rop3.c ++++ b/dlls/winedib.drv/primitives_rop3.c +@@ -413,7 +413,7 @@ DWORD _DIBDRV_ROP3(DWORD p, DWORD s, DWORD d, BYTE rop) + return (0x123456) & 0x00ffffff; + + case 0x85: /* PDSPnoaxn */ +- return (0x123456) & 0x00ffffff; ++ return (~(p ^ (d & (s | ~p)))) & 0x00ffffff; + + case 0x86: /* DSPDSoaxx */ + return (0x123456) & 0x00ffffff; +diff --git a/dlls/winedib.drv/text.c b/dlls/winedib.drv/text.c +index e2cea0c..0ae3575 100644 +--- a/dlls/winedib.drv/text.c ++++ b/dlls/winedib.drv/text.c +@@ -25,19 +25,6 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + +-/* converts font sizes from Word space to Device space */ +-static void FontSizes_ws2ds(DIBDRVPHYSDEV *physDev, int *w, int *h) +-{ +- POINT pts[2]; +- pts[0].x = 0; +- pts[0].y = 0; +- pts[1].x = abs(*w); +- pts[1].y = abs(*h); +- LPtoDP(physDev->hdc, pts, 2); +- *w = pts[1].x - pts[0].x; +- *h = pts[1].y - pts[0].y; +-} +- + /*********************************************************************** + * DIBDRV_ExtTextOut + */ +@@ -57,12 +44,17 @@ BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + LPCWSTR wstrPnt; + + FT_Glyph glyph; +- FT_BitmapGlyph bitmap; ++ FT_BitmapGlyph bitmapGlyph; ++ FT_Bitmap *bitmap, bitmap8; + double cosEsc, sinEsc; + FT_Matrix matrix; + FT_Vector start; + int dx, dy; + ++ RECT *r; ++ int iRec; ++ RECT clipRec; ++ DWORD backPixel; + + MAYBE(TRACE("physDev:%p, x:%d, y:%d, flags:%x, lprect:%p, wstr:%s, count:%d, lpDx:%p\n", + physDev, x, y, flags, lprect, debugstr_w(wstr), count, lpDx)); +@@ -94,114 +86,155 @@ BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + HeapFree(GetProcessHeap(), 0, str); + } + ++ /* gets background pixel value for opaque text */ ++ backPixel = physDev->backgroundColor; ++ + /* gets font data, etc */ + GetObjectW(GetCurrentObject(physDev->hdc, OBJ_FONT), sizeof(lf), &lf); + + /* convert sizes to device space */ +- w = lf.lfWidth; h = lf.lfHeight; +- FontSizes_ws2ds(physDev, &w, &h); +- +- /* if opaque, paint the font background */ +-/* +- if(flags | ETO_OPAQUE) +- { +- int iLine; +- for(iLine = lprect->top; iLine < lprect->bottom; iLine++) +- physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, +- lprect->left, lprect->right-1, iLine, 0, physDev->backgroundColor); +- } +-*/ +- /* sets character pixel size */ +- error = pFT_Set_Pixel_Sizes( +- face, +- MulDiv(w, 96, DIBDRV_GetDeviceCaps(physDev, LOGPIXELSX)), +- MulDiv(h, 96, DIBDRV_GetDeviceCaps(physDev, LOGPIXELSY)) +- ); +- if(error) +- ERR("Couldn't set char size to (%d,%d)\n", lf.lfWidth, lf.lfHeight); +- +- /* transformation matrix and vector */ +- start.x = 0; +- start.y = 0; +- if(lf.lfEscapement != 0) ++ w = abs(lf.lfWidth); h = abs(lf.lfHeight); ++ _DIBDRV_Sizes_ws2ds(physDev, &w, &h); ++ ++ /* loop on all clip region rectangles */ ++ r = physDev->regionRects; ++ for(iRec = 0; iRec < physDev->regionRectCount; iRec++, r++) + { +- cosEsc = cos(lf.lfEscapement * M_PI / 1800); +- sinEsc = sin(lf.lfEscapement * M_PI / 1800); +- } +- else +- { +- cosEsc = 1; +- sinEsc = 0; +- } +- matrix.xx = (FT_Fixed)( cosEsc * 0x10000L ); +- matrix.xy = (FT_Fixed)(-sinEsc * 0x10000L ); +- matrix.yx = (FT_Fixed)( sinEsc * 0x10000L ); +- matrix.yy = (FT_Fixed)( cosEsc * 0x10000L ); +- +- /* outputs characters one by one */ +- wstrPnt = wstr; +- for ( n = 0; n < count; n++ ) +- { +- /* retrieve glyph index from character code */ +- if(flags & ETO_GLYPH_INDEX) +- glyph_index = *wstrPnt++; ++ /* if clipped on text rect, intersect with current region */ ++ if(flags & ETO_CLIPPED) ++ { ++ if(!_DIBDRV_IntersectRect(&clipRec, r, lprect)) ++ continue; ++ } + else +- glyph_index = pFT_Get_Char_Index( face, *wstrPnt++); ++ memcpy(&clipRec, r, sizeof(RECT)); ++ ++ /* if opaque, paint the font background */ ++ if(flags & ETO_OPAQUE) ++ { ++ int iLine; ++ RECT tr; ++ ++ /* clips text rectangle */ ++ if(_DIBDRV_IntersectRect(&tr, r, lprect)) ++ { ++ /* paints the backgound */ ++ for(iLine = tr.top; iLine < tr.bottom; iLine++) ++ physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, ++ tr.left, tr.right-1, iLine, 0, backPixel); ++ } ++ } + +- /* load glyph image into the slot (erase previous one) */ +- error = pFT_Load_Glyph( face, glyph_index, FT_LOAD_DEFAULT ); ++ /* sets character pixel size */ ++ error = pFT_Set_Pixel_Sizes(face, w, h); + if(error) ++ ONCE(ERR("Couldn't set char size to (%d,%d), code %d\n", lf.lfWidth, lf.lfHeight, error)); ++ ++ /* transformation matrix and vector */ ++ start.x = 0; ++ start.y = 0; ++ if(lf.lfEscapement != 0) + { +- ERR("Couldn't load glyph at index %d\n", glyph_index); +- /* ignore errors */ +- continue; ++ cosEsc = cos(lf.lfEscapement * M_PI / 1800); ++ sinEsc = sin(lf.lfEscapement * M_PI / 1800); + } +- error = pFT_Get_Glyph(face->glyph, &glyph); +- if ( error ) ++ else + { +- FIXME("Couldn't get glyph\n"); +- continue; ++ cosEsc = 1; ++ sinEsc = 0; + } +- +- /* apply transformation to glyph */ +- if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) +- pFT_Glyph_Transform(glyph, &matrix, &start ); +- +- /* gets advance BEFORE transforming... */ +- dx = glyph->advance.x; +- dy = glyph->advance.y; +- +- /* convert to an anti-aliased bitmap, if needed */ +- if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) ++ matrix.xx = (FT_Fixed)( cosEsc * 0x10000L ); ++ matrix.xy = (FT_Fixed)(-sinEsc * 0x10000L ); ++ matrix.yx = (FT_Fixed)( sinEsc * 0x10000L ); ++ matrix.yy = (FT_Fixed)( cosEsc * 0x10000L ); ++ ++ /* outputs characters one by one */ ++ wstrPnt = wstr; ++ for ( n = 0; n < count; n++ ) + { +- error = pFT_Glyph_To_Bitmap( +- &glyph, +- FT_RENDER_MODE_NORMAL, +- 0, /* no additional translation */ +- 1 /* destroy copy in "image" */ +- ); +- +- /* ignore errors */ +- if ( error ) ++ /* retrieve glyph index from character code */ ++ if(flags & ETO_GLYPH_INDEX) ++ glyph_index = *wstrPnt++; ++ else ++ glyph_index = pFT_Get_Char_Index( face, *wstrPnt++); ++ ++ /* load glyph image into the slot (erase previous one) */ ++ error = pFT_Load_Glyph( face, glyph_index, FT_LOAD_DEFAULT ); ++ if(error) + { +- FIXME("Couldn't render glyph\n"); +- pFT_Done_Glyph(glyph); ++ ERR("Couldn't load glyph at index %d\n", glyph_index); ++ /* ignore errors */ + continue; + } +- } ++ error = pFT_Get_Glyph(face->glyph, &glyph); ++ if ( error ) ++ { ++ FIXME("Couldn't get glyph\n"); ++ continue; ++ } ++ ++ /* apply transformation to glyph */ ++ if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) ++ pFT_Glyph_Transform(glyph, &matrix, &start ); ++ ++ /* gets advance BEFORE transforming... */ ++ dx = glyph->advance.x; ++ dy = glyph->advance.y; ++ ++ /* convert to an anti-aliased bitmap, if needed */ ++ if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) ++ { ++ error = pFT_Glyph_To_Bitmap( ++ &glyph, ++ #ifdef DIBDRV_ANTIALIASED_FONTS ++ physDev->physBitmap.bitCount > 8 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, ++ #else ++ FT_RENDER_MODE_MONO, ++ #endif ++ 0, /* no additional translation */ ++ 1 /* destroy copy in "image" */ ++ ); ++ ++ /* ignore errors */ ++ if ( error ) ++ { ++ FIXME("Couldn't render glyph\n"); ++ pFT_Done_Glyph(glyph); ++ continue; ++ } ++ } ++ bitmapGlyph = (FT_BitmapGlyph)glyph; ++ ++ /* convert the bitmap in an 8bpp 1 byte aligned one if needed */ ++ bitmap = &bitmapGlyph->bitmap; ++ if(bitmap->pixel_mode != FT_PIXEL_MODE_GRAY) ++ { ++ pFT_Bitmap_New(&bitmap8); ++ if(pFT_Bitmap_Convert(glyph->library, bitmap, &bitmap8, 1)) ++ { ++ FIXME("Couldn't convert bitmap to 8 bit grayscale\n"); ++ pFT_Done_Glyph(glyph); ++ continue; ++ } ++ bitmap = &bitmap8; ++ } + +- /* now, draw to our target surface */ +- bitmap = (FT_BitmapGlyph)glyph; +- physDev->physBitmap.funcs->FreetypeBlit(physDev, x+bitmap->left, y-bitmap->top, &bitmap->bitmap); ++ /* now, draw to our target surface */ ++ physDev->physBitmap.funcs->FreetypeBlit(physDev, x+bitmapGlyph->left, y-bitmapGlyph->top, &clipRec, bitmap); ++ ++ /* frees converted bitmap, if any */ ++ if(bitmap != &bitmapGlyph->bitmap) ++ pFT_Bitmap_Done(glyph->library, bitmap); + +- /* increment pen position */ +- x += dx>>16; +- y -= dy>>16; ++ /* increment pen position */ ++ x += dx>>16; ++ y -= dy>>16; + +- pFT_Done_Glyph(glyph); +- +- res = TRUE; +- } ++ pFT_Done_Glyph(glyph); ++ ++ res = TRUE; ++ } ++ } /* end region rects loop */ + } + else + { --- wine1.2-1.1.43.orig/debian/patches/dibeng-0001.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0001.patch @@ -0,0 +1,185 @@ +DIB Engine: Hook the engine between GDI32 and Display driver + +From: Massimo Del Fedele + + +--- + + dlls/gdi32/driver.c | 139 +++++++++++++++++++++++++++++++++++++++++++++------ + 1 files changed, 123 insertions(+), 16 deletions(-) + + +diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c +index 635eeb8..0d1fdb5 100644 +--- a/dlls/gdi32/driver.c ++++ b/dlls/gdi32/driver.c +@@ -3,6 +3,7 @@ + * + * Copyright 1994 Bob Amstadt + * Copyright 1996, 2001 Alexandre Julliard ++ * Copyright 2009 Massimo Del Fedele + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -25,6 +26,7 @@ + #include + #include + #include ++#include + #include "windef.h" + #include "winbase.h" + #include "winreg.h" +@@ -222,6 +224,104 @@ static struct graphics_driver *create_driver( HMODULE module ) + + + /********************************************************************** ++ * Load_Dib_Driver ++ * ++ * Check if we want the DIB engine and try to load it ++ */ ++static HMODULE Load_Dib_Driver(void) ++{ ++ HMODULE module; ++ ++ static const char *winedib_drv = "winedib.drv"; ++ ++ /* we do want use DIB Engine ? */ ++ BOOL driverRequired = TRUE; ++ ++ /* already checked env/registry for DIB driver ? */ ++ BOOL envChecked = FALSE; ++ ++ char *winedib; ++ char buffer[10]; ++ ++ /* environment variable WINEDIB takes precedence */ ++ if( (winedib = getenv("WINEDIB")) != NULL) ++ { ++ if(!strcasecmp(winedib, "ON") || ++ !strcasecmp(winedib, "TRUE") || ++ !strcasecmp(winedib, "ENABLE") || ++ !strcasecmp(winedib, "ENABLED") ++ ) ++ { ++ TRACE("DIB Engine enabled by environment\n"); ++ envChecked = TRUE; ++ driverRequired = TRUE; ++ } ++ else if(!strcasecmp(winedib, "OFF") || ++ !strcasecmp(winedib, "FALSE") || ++ !strcasecmp(winedib, "DISABLE") || ++ !strcasecmp(winedib, "DISABLED") ++ ) ++ { ++ TRACE("DIB Engine disabled by environment\n"); ++ envChecked = TRUE; ++ driverRequired = FALSE; ++ } ++ else ++ ERR("Bad WINEDIB environment variable\n"); ++ } ++ ++ /* no WINEDIB environment var found or wrong value, we check registry */ ++ if(!envChecked) ++ { ++ HKEY hkey; ++ buffer[0] = 0; ++ if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\DIB Engine", &hkey )) ++ { ++ DWORD type, count = sizeof(buffer); ++ RegQueryValueExA( hkey, "Enable", 0, &type, (LPBYTE) buffer, &count ); ++ RegCloseKey( hkey ); ++ } ++ if(*buffer) ++ { ++ /* registry value found, must be Y or y to enable driver, N or n to disable */ ++ if(!strncasecmp(buffer, "Y", 1)) ++ { ++ TRACE("DIB Engine enabled by registry\n"); ++ envChecked = TRUE; ++ driverRequired = TRUE; ++ } ++ else if(!strncasecmp(buffer, "N", 1)) ++ { ++ TRACE("DIB Engine disabled by registry\n"); ++ envChecked = TRUE; ++ driverRequired = FALSE; ++ } ++ } ++ } ++ ++ /* none of above, we assume we don't want to use engine */ ++ if(!envChecked) ++ { ++ TRACE("DIB Engine disabled by default\n"); ++ envChecked = TRUE; ++ driverRequired = FALSE; ++ } ++ ++ /* if DIB Engine is required, try to load it ++ * otherwise just return NULL module */ ++ if(driverRequired) ++ { ++ if( (module = LoadLibraryA( winedib_drv )) != 0) ++ TRACE("Succesfully loaded DIB Engine\n"); ++ else ++ ERR("Couldn't load DIB Engine\n"); ++ return module; ++ } ++ else ++ return 0; ++} ++ ++/********************************************************************** + * load_display_driver + * + * Special case for loading the display driver: get the name from the config file +@@ -237,25 +337,32 @@ static struct graphics_driver *load_display_driver(void) + display_driver->count++; + return display_driver; + } +- +- strcpy( buffer, "x11" ); /* default value */ +- /* @@ Wine registry key: HKCU\Software\Wine\Drivers */ +- if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey )) ++ ++ /* check at first if DIB engine is present and if we want ++ * to use it */ ++ if( (module = Load_Dib_Driver()) == 0) + { +- DWORD type, count = sizeof(buffer); +- RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count ); +- RegCloseKey( hkey ); +- } ++ /* no DIB Engine loaded, just load normal display driver */ ++ ++ strcpy( buffer, "x11" ); /* default value */ ++ /* @@ Wine registry key: HKCU\Software\Wine\Drivers */ ++ if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey )) ++ { ++ DWORD type, count = sizeof(buffer); ++ RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count ); ++ RegCloseKey( hkey ); ++ } + +- name = buffer; +- while (name) +- { +- next = strchr( name, ',' ); +- if (next) *next++ = 0; ++ name = buffer; ++ while (name) ++ { ++ next = strchr( name, ',' ); ++ if (next) *next++ = 0; + +- snprintf( libname, sizeof(libname), "wine%s.drv", name ); +- if ((module = LoadLibraryA( libname )) != 0) break; +- name = next; ++ snprintf( libname, sizeof(libname), "wine%s.drv", name ); ++ if ((module = LoadLibraryA( libname )) != 0) break; ++ name = next; ++ } + } + + if (!(display_driver = create_driver( module ))) --- wine1.2-1.1.43.orig/debian/patches/winepulse-0.36.patch +++ wine1.2-1.1.43/debian/patches/winepulse-0.36.patch @@ -0,0 +1,2667 @@ +diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in +new file mode 100644 +index 0000000..ed48381 +--- /dev/null ++++ b/dlls/winepulse.drv/Makefile.in +@@ -0,0 +1,14 @@ ++TOPSRCDIR = @top_srcdir@ ++TOPOBJDIR = ../.. ++SRCDIR = @srcdir@ ++VPATH = @srcdir@ ++MODULE = winepulse.drv ++IMPORTS = winmm user32 kernel32 ++EXTRALIBS = @PULSELIBS@ ++EXTRACFLAGS = @PULSEINCL@ ++ ++C_SRCS = waveout.c \ ++ wavein.c \ ++ pulse.c ++ ++@MAKE_DLL_RULES@ +diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c +new file mode 100644 +index 0000000..9dd1f80 +--- /dev/null ++++ b/dlls/winepulse.drv/pulse.c +@@ -0,0 +1,805 @@ ++/* ++ * Wine Driver for PulseAudio ++ * http://pulseaudio.org/ ++ * ++ * Copyright 2009 Arthur Taylor ++ * ++ * Contains code from other wine sound drivers. ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++ ++#include "windef.h" ++#include "winbase.h" ++#include "wingdi.h" ++#include "winuser.h" ++#include "winreg.h" ++#include "mmddk.h" ++#include "ks.h" ++#include "ksguid.h" ++#include "ksmedia.h" ++ ++#ifdef HAVE_UNISTD_H ++# include ++#endif ++#include ++ ++#ifdef HAVE_PULSEAUDIO ++ ++#include "wine/unicode.h" ++#include "wine/debug.h" ++#include "wine/library.h" ++ ++#include ++#include ++WINE_DEFAULT_DEBUG_CHANNEL(wave); ++ ++/* These strings used only for tracing */ ++const char * PULSE_getCmdString(enum win_wm_message msg) { ++ static char unknown[32]; ++#define MSG_TO_STR(x) case x: return #x ++ switch(msg) { ++ MSG_TO_STR(WINE_WM_PAUSING); ++ MSG_TO_STR(WINE_WM_RESTARTING); ++ MSG_TO_STR(WINE_WM_RESETTING); ++ MSG_TO_STR(WINE_WM_HEADER); ++ MSG_TO_STR(WINE_WM_BREAKLOOP); ++ MSG_TO_STR(WINE_WM_CLOSING); ++ MSG_TO_STR(WINE_WM_STARTING); ++ MSG_TO_STR(WINE_WM_STOPPING); ++ MSG_TO_STR(WINE_WM_XRUN); ++ MSG_TO_STR(WINE_WM_FEED); ++ } ++#undef MSG_TO_STR ++ sprintf(unknown, "UNKNOWN(0x%08x)", msg); ++ return unknown; ++} ++ ++/*======================================================================* ++ * Ring Buffer Functions - copied from winealsa.drv * ++ *======================================================================*/ ++ ++/* unless someone makes a wineserver kernel module, Unix pipes are faster than win32 events */ ++#define USE_PIPE_SYNC ++ ++#ifdef USE_PIPE_SYNC ++#define INIT_OMR(omr) do { if (pipe(omr->msg_pipe) < 0) { omr->msg_pipe[0] = omr->msg_pipe[1] = -1; } } while (0) ++#define CLOSE_OMR(omr) do { close(omr->msg_pipe[0]); close(omr->msg_pipe[1]); } while (0) ++#define SIGNAL_OMR(omr) do { int x = 0; write((omr)->msg_pipe[1], &x, sizeof(x)); } while (0) ++#define CLEAR_OMR(omr) do { int x = 0; read((omr)->msg_pipe[0], &x, sizeof(x)); } while (0) ++#define RESET_OMR(omr) do { } while (0) ++#define WAIT_OMR(omr, sleep) \ ++ do { struct pollfd pfd; pfd.fd = (omr)->msg_pipe[0]; \ ++ pfd.events = POLLIN; poll(&pfd, 1, sleep); } while (0) ++#else ++#define INIT_OMR(omr) do { omr->msg_event = CreateEventW(NULL, FALSE, FALSE, NULL); } while (0) ++#define CLOSE_OMR(omr) do { CloseHandle(omr->msg_event); } while (0) ++#define SIGNAL_OMR(omr) do { SetEvent((omr)->msg_event); } while (0) ++#define CLEAR_OMR(omr) do { } while (0) ++#define RESET_OMR(omr) do { ResetEvent((omr)->msg_event); } while (0) ++#define WAIT_OMR(omr, sleep) \ ++ do { WaitForSingleObject((omr)->msg_event, sleep); } while (0) ++#endif ++ ++#define PULSE_RING_BUFFER_INCREMENT 64 ++ ++/****************************************************************** ++ * PULSE_InitRingMessage ++ * ++ * Initialize the ring of messages for passing between driver's caller ++ * and playback/record thread ++ */ ++int PULSE_InitRingMessage(PULSE_MSG_RING* omr) ++{ ++ omr->msg_toget = 0; ++ omr->msg_tosave = 0; ++ INIT_OMR(omr); ++ omr->ring_buffer_size = PULSE_RING_BUFFER_INCREMENT; ++ omr->messages = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,omr->ring_buffer_size * sizeof(PULSE_MSG)); ++ ++ InitializeCriticalSection(&omr->msg_crst); ++ omr->msg_crst.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PULSE_MSG_RING.msg_crst"); ++ return 0; ++} ++ ++/****************************************************************** ++ * PULSE_DestroyRingMessage ++ * ++ */ ++int PULSE_DestroyRingMessage(PULSE_MSG_RING* omr) ++{ ++ CLOSE_OMR(omr); ++ HeapFree(GetProcessHeap(),0,omr->messages); ++ omr->messages = NULL; ++ omr->ring_buffer_size = PULSE_RING_BUFFER_INCREMENT; ++ omr->msg_crst.DebugInfo->Spare[0] = 0; ++ DeleteCriticalSection(&omr->msg_crst); ++ return 0; ++} ++/****************************************************************** ++ * PULSE_ResetRingMessage ++ * ++ */ ++void PULSE_ResetRingMessage(PULSE_MSG_RING* omr) ++{ ++ RESET_OMR(omr); ++} ++ ++/****************************************************************** ++ * PULSE_WaitRingMessage ++ * ++ */ ++void PULSE_WaitRingMessage(PULSE_MSG_RING* omr, DWORD sleep) ++{ ++ WAIT_OMR(omr, sleep); ++} ++ ++/****************************************************************** ++ * PULSE_AddRingMessage ++ * ++ * Inserts a new message into the ring (should be called from DriverProc derived routines) ++ */ ++int PULSE_AddRingMessage(PULSE_MSG_RING* omr, enum win_wm_message msg, DWORD param, BOOL wait) ++{ ++ HANDLE hEvent = INVALID_HANDLE_VALUE; ++ ++ EnterCriticalSection(&omr->msg_crst); ++ if ((omr->msg_toget == ((omr->msg_tosave + 1) % omr->ring_buffer_size))) ++ { ++ int old_ring_buffer_size = omr->ring_buffer_size; ++ omr->ring_buffer_size += PULSE_RING_BUFFER_INCREMENT; ++ omr->messages = HeapReAlloc(GetProcessHeap(),0,omr->messages, omr->ring_buffer_size * sizeof(PULSE_MSG)); ++ /* Now we need to rearrange the ring buffer so that the new ++ buffers just allocated are in between omr->msg_tosave and ++ omr->msg_toget. ++ */ ++ if (omr->msg_tosave < omr->msg_toget) ++ { ++ memmove(&(omr->messages[omr->msg_toget + PULSE_RING_BUFFER_INCREMENT]), ++ &(omr->messages[omr->msg_toget]), ++ sizeof(PULSE_MSG)*(old_ring_buffer_size - omr->msg_toget) ++ ); ++ omr->msg_toget += PULSE_RING_BUFFER_INCREMENT; ++ } ++ } ++ if (wait) ++ { ++ hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); ++ if (hEvent == INVALID_HANDLE_VALUE) ++ { ++ ERR("can't create event !?\n"); ++ LeaveCriticalSection(&omr->msg_crst); ++ return 0; ++ } ++ /* fast messages have to be added at the start of the queue */ ++ omr->msg_toget = (omr->msg_toget + omr->ring_buffer_size - 1) % omr->ring_buffer_size; ++ ++ omr->messages[omr->msg_toget].msg = msg; ++ omr->messages[omr->msg_toget].param = param; ++ omr->messages[omr->msg_toget].hEvent = hEvent; ++ } ++ else ++ { ++ omr->messages[omr->msg_tosave].msg = msg; ++ omr->messages[omr->msg_tosave].param = param; ++ omr->messages[omr->msg_tosave].hEvent = INVALID_HANDLE_VALUE; ++ omr->msg_tosave = (omr->msg_tosave + 1) % omr->ring_buffer_size; ++ } ++ LeaveCriticalSection(&omr->msg_crst); ++ /* signal a new message */ ++ SIGNAL_OMR(omr); ++ if (wait) ++ { ++ /* wait for playback/record thread to have processed the message */ ++ WaitForSingleObject(hEvent, INFINITE); ++ CloseHandle(hEvent); ++ } ++ return 1; ++} ++ ++/****************************************************************** ++ * PULSE_RetrieveRingMessage ++ * ++ * Get a message from the ring. Should be called by the playback/record thread. ++ */ ++int PULSE_RetrieveRingMessage(PULSE_MSG_RING* omr, ++ enum win_wm_message *msg, DWORD *param, HANDLE *hEvent) ++{ ++ EnterCriticalSection(&omr->msg_crst); ++ ++ if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */ ++ { ++ LeaveCriticalSection(&omr->msg_crst); ++ return 0; ++ } ++ ++ *msg = omr->messages[omr->msg_toget].msg; ++ omr->messages[omr->msg_toget].msg = 0; ++ *param = omr->messages[omr->msg_toget].param; ++ *hEvent = omr->messages[omr->msg_toget].hEvent; ++ omr->msg_toget = (omr->msg_toget + 1) % omr->ring_buffer_size; ++ CLEAR_OMR(omr); ++ LeaveCriticalSection(&omr->msg_crst); ++ return 1; ++} ++ ++/************************************************************************** ++ * Utility Functions ++ *************************************************************************/ ++ ++/****************************************************************** ++ * PULSE_SetupFormat ++ * ++ * Checks to see if the audio format in wf is supported, and if so set up the ++ * pa_sample_spec at ss to that format. ++ */ ++BOOL PULSE_SetupFormat(LPWAVEFORMATEX wf, pa_sample_spec *ss) { ++ WAVEFORMATEXTENSIBLE *wfex; ++ ++ ss->channels = wf->nChannels; ++ ss->rate = wf->nSamplesPerSec; ++ ss->format = PA_SAMPLE_INVALID; ++ ++ if (ss->rate < DSBFREQUENCY_MIN || ss->rate > DSBFREQUENCY_MAX) return FALSE; ++ ++ switch (wf->wFormatTag) { ++ case WAVE_FORMAT_PCM: ++ /* MSDN says that for WAVE_FORMAT_PCM, nChannels must be 1 or 2 and ++ * wBitsPerSample must be 8 or 16, yet other values are used by some ++ * applications in the wild for surround. */ ++ if (ss->channels > 6 || ss->channels < 1) return FALSE; ++ ss->format = wf->wBitsPerSample == 8 ? PA_SAMPLE_U8 ++ : wf->wBitsPerSample == 16 ? PA_SAMPLE_S16NE ++ : wf->wBitsPerSample == 32 ? PA_SAMPLE_S32NE ++ : PA_SAMPLE_INVALID; ++ break; ++ ++ case WAVE_FORMAT_MULAW: ++ if (wf->wBitsPerSample == 8) ss->format = PA_SAMPLE_ULAW; ++ break; ++ ++ case WAVE_FORMAT_ALAW: ++ if (wf->wBitsPerSample == 8) ss->format = PA_SAMPLE_ALAW; ++ break; ++ ++ case WAVE_FORMAT_EXTENSIBLE: ++ if (wf->cbSize > 22) return FALSE; ++ if (ss->channels < 1 || ss->channels > 6) return FALSE; ++ wfex = (WAVEFORMATEXTENSIBLE *)wf; ++ if (IsEqualGUID(&wfex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM)) { ++ if (wf->wBitsPerSample == wfex->Samples.wValidBitsPerSample) { ++ ss->format = wf->wBitsPerSample == 8 ? PA_SAMPLE_U8 ++ : wf->wBitsPerSample == 16 ? PA_SAMPLE_S16NE ++ : wf->wBitsPerSample == 32 ? PA_SAMPLE_S32NE ++ : PA_SAMPLE_INVALID; ++ } else { ++ return FALSE; ++ } ++ } else if (wf->wBitsPerSample != wfex->Samples.wValidBitsPerSample) { ++ return FALSE; ++ } else if ((IsEqualGUID(&wfex->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) { ++ ss->format = PA_SAMPLE_FLOAT32NE; ++ } else { ++ WARN("only KSDATAFORMAT_SUBTYPE_PCM and KSDATAFORMAT_SUBTYPE_IEEE_FLOAT of WAVE_FORMAT_EXTENSIBLE supported\n"); ++ return FALSE; ++ } ++ break; ++ ++ default: ++ WARN("only WAVE_FORMAT_PCM, WAVE_FORMAT_MULAW, WAVE_FORMAT_ALAW and WAVE_FORMAT_EXTENSIBLE supported\n"); ++ return FALSE; ++ } ++ ++ if (!pa_sample_spec_valid(ss)) return FALSE; ++ if (wf->nBlockAlign != pa_frame_size(ss)) { ++ ERR("wf->nBlockAlign != the format frame size!\n"); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++/****************************************************************** ++ * PULSE_SetupFormat ++ * ++ * Converts the current time to a MMTIME structure. lpTime shold be validated ++ * before calling. ++ */ ++HRESULT PULSE_UsecToMMTime(pa_usec_t time, LPMMTIME lpTime, const pa_sample_spec *ss) { ++ pa_usec_t temp; ++ size_t bytes; ++ ++ /* Convert to milliseconds */ ++ time /= 1000; ++ ++ bytes = time * pa_bytes_per_second(ss) / 1000; ++ /* Align to frame size */ ++ bytes -= bytes % pa_frame_size(ss); ++ ++ switch (lpTime->wType) { ++ case TIME_SAMPLES: ++ lpTime->u.sample = bytes / pa_frame_size(ss); ++ TRACE("TIME_SAMPLES=%u\n", lpTime->u.sample); ++ break; ++ case TIME_MS: ++ lpTime->u.ms = time; ++ TRACE("TIME_MS=%u\n", lpTime->u.ms); ++ break; ++ case TIME_SMPTE: ++ lpTime->u.smpte.fps = 30; ++ temp = bytes / pa_frame_size(ss); ++ temp += ss->rate / lpTime->u.smpte.fps - 1; ++ lpTime->u.smpte.sec = time/1000; ++ temp -= lpTime->u.smpte.sec * ss->rate; ++ lpTime->u.smpte.min = lpTime->u.smpte.sec / 60; ++ lpTime->u.smpte.sec -= 60 * lpTime->u.smpte.min; ++ lpTime->u.smpte.hour = lpTime->u.smpte.min / 60; ++ lpTime->u.smpte.min -= 60 * lpTime->u.smpte.hour; ++ lpTime->u.smpte.frame = temp * lpTime->u.smpte.fps / ss->rate; ++ TRACE("TIME_SMPTE=%02u:%02u:%02u:%02u\n", ++ lpTime->u.smpte.hour, lpTime->u.smpte.min, ++ lpTime->u.smpte.sec, lpTime->u.smpte.frame); ++ break; ++ default: ++ WARN("Format %d not supported, using TIME_BYTES !\n", lpTime->wType); ++ lpTime->wType = TIME_BYTES; ++ /* fall through */ ++ case TIME_BYTES: ++ lpTime->u.cb = bytes; ++ TRACE("TIME_BYTES=%u\n", lpTime->u.cb); ++ break; ++ } ++ ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * PULSE_WaitForOperation ++ * ++ * Waits for pa operations to complete, and dereferences the operation. ++ */ ++void PULSE_WaitForOperation(pa_operation *o) { ++ if (!o) return; ++ ++ for (;;) { ++ if (pa_operation_get_state(o) != PA_OPERATION_RUNNING) ++ break; ++ pa_threaded_mainloop_wait(PULSE_ml); ++ } ++ pa_operation_unref(o); ++} ++ ++/************************************************************************** ++ * Common Callbacks ++ */ ++ ++/************************************************************************** ++ * PULSE_StreamRequestCallback ++ * ++ * Called by the pulse mainloop whenever it wants/has audio data. ++ */ ++void PULSE_StreamRequestCallback(pa_stream *s, size_t nbytes, void *userdata) { ++ WINE_WAVEINST *ww = (WINE_WAVEINST*)userdata; ++ ++ TRACE("Server has %u bytes\n", nbytes); ++ ++ /* Make sure that the player/recorder is running */ ++ if (ww->hThread != INVALID_HANDLE_VALUE && ww->msgRing.messages) { ++ PULSE_AddRingMessage(&ww->msgRing, WINE_WM_FEED, (DWORD)nbytes, FALSE); ++ } ++} ++ ++ ++/************************************************************************** ++ * PULSE_StreamSuspendedCallback [internal] ++ * ++ * Called by the pulse mainloop any time stream playback is intentionally ++ * suspended or resumed from being suspended. ++ */ ++void PULSE_StreamSuspendedCallback(pa_stream *s, void *userdata) { ++ WINE_WAVEINST *wwo = (WINE_WAVEINST*)userdata; ++ assert(s && wwo); ++ ++ /* Currently we handle this kinda like an underrun. Perhaps we should ++ * tell the client somehow so it doesn't just hang? */ ++ ++ if (!pa_stream_is_suspended(s) && wwo->hThread != INVALID_HANDLE_VALUE && wwo->msgRing.ring_buffer_size > 0) ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_XRUN, 0, FALSE); ++} ++ ++/************************************************************************** ++ * PULSE_StreamUnderflowCallback [internal] ++ * ++ * Called by the pulse mainloop when the prebuf runs out of data. ++ */ ++void PULSE_StreamUnderflowCallback(pa_stream *s, void *userdata) { ++ WINE_WAVEINST *wwo = (WINE_WAVEINST*)userdata; ++ assert(s && wwo); ++ ++ /* If we aren't playing, don't care ^_^ */ ++ if (wwo->state != WINE_WS_PLAYING) return; ++ ++ TRACE("Underrun occurred.\n"); ++ ++ if (wwo->hThread != INVALID_HANDLE_VALUE && wwo->msgRing.ring_buffer_size > 0); ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_XRUN, 0, FALSE); ++} ++ ++/************************************************************************** ++ * PULSE_StreamMovedCallback [internal] ++ * ++ * Called by the pulse mainloop when the stream gets moved, resulting in ++ * possibly different metrics. ++ */ ++void PULSE_StreamMovedCallback(pa_stream *s, void *userdata) { ++ FIXME("stub"); ++} ++ ++ ++/****************************************************************** ++ * PULSE_StreamStateCallback ++ * ++ * Called by pulse whenever the state of the stream changes. ++ */ ++void PULSE_StreamStateCallback(pa_stream *s, void *userdata) { ++ assert(s); ++ ++ switch (pa_stream_get_state(s)) { ++ case PA_STREAM_READY: ++ TRACE("Stream %p ready\n", userdata); ++ break; ++ ++ case PA_STREAM_TERMINATED: /* Stream closed normally */ ++ TRACE("Stream %p terminated\n", userdata); ++ break; ++ ++ case PA_STREAM_FAILED: /* Stream closed not-normally */ ++ ERR("Stream %p failed!\n", userdata); ++ break; ++ ++ case PA_STREAM_UNCONNECTED: ++ case PA_STREAM_CREATING: ++ return; ++ } ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++} ++ ++/************************************************************************** ++ * PULSE_StreamSucessCallback ++ */ ++void PULSE_StreamSuccessCallback(pa_stream *s, int success, void *userdata) { ++ if (!success) ++ WARN("Stream %p operation failed: %s\n", userdata, pa_strerror(pa_context_errno(PULSE_context))); ++ ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++} ++ ++/************************************************************************** ++ * PULSE_ContextSuccessCallback ++ */ ++void PULSE_ContextSuccessCallback(pa_context *c, int success, void *userdata) { ++ if (!success) ERR("Context operation failed: %s\n", pa_strerror(pa_context_errno(c))); ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++} ++ ++/************************************************************************** ++ * Connection management and sink / source management. ++ */ ++ ++/************************************************************************** ++ * PULSE_ContextStateCallback [internal] ++ */ ++static void PULSE_ContextStateCallback(pa_context *c, void *userdata) { ++ assert(c); ++ ++ switch (pa_context_get_state(c)) { ++ case PA_CONTEXT_CONNECTING: ++ case PA_CONTEXT_UNCONNECTED: ++ case PA_CONTEXT_AUTHORIZING: ++ case PA_CONTEXT_SETTING_NAME: ++ break; ++ ++ case PA_CONTEXT_READY: ++ case PA_CONTEXT_TERMINATED: ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++ break; ++ ++ case PA_CONTEXT_FAILED: ++ ERR("Context failed: %s\n", pa_strerror(pa_context_errno(c))); ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++ break; ++ } ++} ++ ++/************************************************************************** ++ * PULSE_AllocateWaveinDevice [internal] ++ * ++ * Creates or adds a device to WInDev based on the pa_source_info. ++ */ ++static void PULSE_AllocateWaveinDevice(const char *name, const char *device, const char *description, const pa_cvolume *v) { ++ WINE_WAVEDEV *wdi; ++ ++ if (WInDev) ++ wdi = HeapReAlloc(GetProcessHeap(), 0, WInDev, sizeof(WINE_WAVEDEV) * (PULSE_WidNumDevs + 1)); ++ else ++ wdi = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_WAVEDEV)); ++ ++ if (!wdi) return; ++ ++ WInDev = wdi; ++ wdi = &WInDev[PULSE_WidNumDevs++]; ++ memset(wdi, 0, sizeof(WINE_WAVEDEV)); ++ memset(&(wdi->caps.in), 0, sizeof(wdi->caps.in)); ++ snprintf(wdi->interface_name, MAXPNAMELEN * 2, "winepulse: %s", name); ++ wdi->device_name = pa_xstrdup(device); ++ MultiByteToWideChar(CP_UTF8, 0, description, -1, wdi->caps.in.szPname, sizeof(wdi->caps.in.szPname)/sizeof(WCHAR)); ++ wdi->caps.in.szPname[sizeof(wdi->caps.in.szPname)/sizeof(WCHAR) - 1] = '\0'; ++ wdi->caps.in.wMid = MM_CREATIVE; ++ wdi->caps.in.wPid = MM_CREATIVE_SBP16_WAVEOUT; ++ wdi->caps.in.vDriverVersion = 0x0100; ++ wdi->caps.in.wChannels = v->channels == 1 ? 1 : 2; ++ wdi->caps.in.dwFormats = PULSE_ALL_FORMATS; ++ memset(&wdi->ds_desc, 0, sizeof(DSDRIVERDESC)); ++ memcpy(wdi->ds_desc.szDesc, description, min(sizeof(wdi->ds_desc.szDesc) - 1, strlen(description))); ++ memcpy(wdi->ds_desc.szDrvname, "winepulse.drv", 14); ++ wdi->ds_caps.dwMinSecondarySampleRate = DSBFREQUENCY_MIN; ++ wdi->ds_caps.dwMaxSecondarySampleRate = DSBFREQUENCY_MAX; ++ wdi->ds_caps.dwPrimaryBuffers = 1; ++ wdi->ds_caps.dwFlags = \ ++ DSCAPS_PRIMARYMONO | ++ DSCAPS_PRIMARYSTEREO | ++ DSCAPS_PRIMARY8BIT | ++ DSCAPS_PRIMARY16BIT | ++ DSCAPS_SECONDARYMONO | ++ DSCAPS_SECONDARYSTEREO | ++ DSCAPS_SECONDARY8BIT | ++ DSCAPS_SECONDARY16BIT | ++ DSCCAPS_MULTIPLECAPTURE; ++} ++ ++/************************************************************************** ++ * PULSE_AllocateWaveoutDevice [internal] ++ * ++ * Creates or adds a sink to the WOutDev array. ++ */ ++static void PULSE_AllocateWaveoutDevice(const char *name, const char *device, const char *description, const pa_cvolume *v) { ++ WINE_WAVEDEV *wdo; ++ int x; ++ ++ if (WOutDev) ++ wdo = HeapReAlloc(GetProcessHeap(), 0, WOutDev, sizeof(WINE_WAVEDEV) * (PULSE_WodNumDevs + 1)); ++ else ++ wdo = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_WAVEDEV)); ++ ++ if (!wdo) return; ++ ++ WOutDev = wdo; ++ wdo = &WOutDev[PULSE_WodNumDevs++]; ++ memset(wdo, 0, sizeof(WINE_WAVEDEV)); ++ ++ wdo->device_name = pa_xstrdup(device); ++ wdo->volume.channels = v->channels; ++ for (x = 0; x < v->channels; x++) wdo->volume.values[x] = v->values[x]; ++ snprintf(wdo->interface_name, MAXPNAMELEN * 2, "winepulse: %s", name); ++ MultiByteToWideChar(CP_UTF8, 0, description, -1, wdo->caps.out.szPname, sizeof(wdo->caps.out.szPname)/sizeof(WCHAR)); ++ wdo->caps.out.szPname[sizeof(wdo->caps.out.szPname)/sizeof(WCHAR) - 1] = '\0'; ++ wdo->caps.out.wMid = MM_CREATIVE; ++ wdo->caps.out.wPid = MM_CREATIVE_SBP16_WAVEOUT; ++ wdo->caps.out.vDriverVersion = 0x0100; ++ wdo->caps.out.dwSupport = WAVECAPS_VOLUME | WAVECAPS_SAMPLEACCURATE;// | WAVECAPS_DIRECTSOUND; ++ if (v->channels >= 2) { ++ wdo->caps.out.wChannels = 2; ++ wdo->caps.out.dwSupport |= WAVECAPS_LRVOLUME; ++ } else ++ wdo->caps.out.wChannels = 1; ++ wdo->caps.out.dwFormats = PULSE_ALL_FORMATS; ++ memset(&wdo->ds_desc, 0, sizeof(DSDRIVERDESC)); ++ memcpy(wdo->ds_desc.szDesc, description, min(sizeof(wdo->ds_desc.szDesc) - 1, strlen(description))); ++ memcpy(wdo->ds_desc.szDrvname, "winepulse.drv", 14); ++ wdo->ds_caps.dwMinSecondarySampleRate = DSBFREQUENCY_MIN; ++ wdo->ds_caps.dwMaxSecondarySampleRate = DSBFREQUENCY_MAX; ++ wdo->ds_caps.dwPrimaryBuffers = 1; ++ wdo->ds_caps.dwFlags = \ ++ DSCAPS_PRIMARYMONO | ++ DSCAPS_PRIMARYSTEREO | ++ DSCAPS_PRIMARY8BIT | ++ DSCAPS_PRIMARY16BIT | ++ DSCAPS_SECONDARYMONO | ++ DSCAPS_SECONDARYSTEREO | ++ DSCAPS_SECONDARY8BIT | ++ DSCAPS_SECONDARY16BIT | ++ DSCAPS_CONTINUOUSRATE; ++} ++ ++/************************************************************************** ++ * PULSE_SourceInfoCallback [internal] ++ */ ++static void PULSE_SourceInfoCallback(pa_context *c, const pa_source_info *i, int eol, void *userdata) { ++ ++ if (!eol && i) ++ PULSE_AllocateWaveinDevice(i->name, i->name, i->description, &i->volume); ++ ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++} ++ ++/************************************************************************** ++ * PULSE_SinkInfoCallback [internal] ++ */ ++static void PULSE_SinkInfoCallback(pa_context *c, const pa_sink_info *i, int eol, void *userdata) { ++ ++ if (!eol && i) ++ PULSE_AllocateWaveoutDevice(i->name, i->name, i->description, &i->volume); ++ ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++} ++ ++/************************************************************************** ++ * PULSE_ContextNotifyCallback [internal] ++ */ ++static void PULSE_ContextNotifyCallback(pa_context *c, void *userdata) { ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++} ++ ++/************************************************************************** ++ * PULSE_WaveClose [internal] ++ * ++ * Disconnect from the server, deallocated the WaveIn/WaveOut devices, stop and ++ * free the mainloop. ++ */ ++static LONG PULSE_WaveClose(void) { ++ int x; ++ TRACE("()\n"); ++ if (!PULSE_ml) return DRV_FAILURE; ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ /* device_name is allocated with pa_xstrdup, free with pa_xfree */ ++ for (x = 0; x < PULSE_WodNumDevs; x++) pa_xfree(WOutDev[x].device_name); ++ for (x = 0; x < PULSE_WidNumDevs; x++) pa_xfree(WInDev[x].device_name); ++ HeapFree(GetProcessHeap(), 0, WOutDev); ++ HeapFree(GetProcessHeap(), 0, WInDev); ++ if (PULSE_context) { ++ PULSE_WaitForOperation(pa_context_drain(PULSE_context, PULSE_ContextNotifyCallback, NULL)); ++ pa_context_disconnect(PULSE_context); ++ pa_context_unref(PULSE_context); ++ PULSE_context = NULL; ++ } ++ ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ pa_threaded_mainloop_stop(PULSE_ml); ++ pa_threaded_mainloop_free(PULSE_ml); ++ PULSE_ml = NULL; ++ ++ return DRV_SUCCESS; ++} ++ ++/************************************************************************** ++ * PULSE_WaveInit [internal] ++ * ++ * Connects to the pulseaudio server, tries to discover sinks and sources and ++ * allocates the WaveIn/WaveOut devices. ++ */ ++static LONG PULSE_WaveInit(void) { ++ char *app_name; ++ char path[PATH_MAX]; ++ char *offset = NULL; ++ pa_cvolume fake_cvolume; ++ ++ WOutDev = NULL; ++ WInDev = NULL; ++ PULSE_WodNumDevs = 0; ++ PULSE_WidNumDevs = 0; ++ PULSE_context = NULL; ++ PULSE_ml = NULL; ++ ++ if (!(PULSE_ml = pa_threaded_mainloop_new())) { ++ ERR("Failed to create mainloop object."); ++ return DRV_FAILURE; ++ } ++ ++ /* Application name giving to pulse should be unique to the binary so that ++ * pulse-*-restore can be useful */ ++ ++ /* Get binary path, and remove path a-la strrchr */ ++ if (GetModuleFileNameA(NULL, path, PATH_MAX)) ++ offset = strrchr(path, '\\'); ++ ++ if (offset && ++offset && offset < path + PATH_MAX) { ++ app_name = pa_xmalloc(strlen(offset) + 8); ++ snprintf(app_name, strlen(offset) + 8, "WINE [%s]", offset); ++ } else ++ app_name = pa_xstrdup("WINE Application"); ++ ++ TRACE("App name is \"%s\"\n", app_name); ++ ++ pa_threaded_mainloop_start(PULSE_ml); ++ PULSE_context = pa_context_new(pa_threaded_mainloop_get_api(PULSE_ml), app_name); ++ assert(PULSE_context); ++ pa_xfree(app_name); ++ ++ pa_context_set_state_callback(PULSE_context, PULSE_ContextStateCallback, NULL); ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ ++ TRACE("libpulse protocol version: %u. API Version %u\n", pa_context_get_protocol_version(PULSE_context), PA_API_VERSION); ++ if (pa_context_connect(PULSE_context, NULL, 0, NULL) < 0) ++ goto fail; ++ ++ /* Wait for connection */ ++ for (;;) { ++ pa_context_state_t state = pa_context_get_state(PULSE_context); ++ ++ if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED) ++ goto fail; ++ ++ if (state == PA_CONTEXT_READY) ++ break; ++ ++ pa_threaded_mainloop_wait(PULSE_ml); ++ } ++ ++ TRACE("Connected to server %s with protocol version: %i.\n", ++ pa_context_get_server(PULSE_context), ++ pa_context_get_server_protocol_version(PULSE_context)); ++ ++ fake_cvolume.channels = 2; ++ pa_cvolume_reset(&fake_cvolume, 2); ++ /* FIXME Translations? */ ++ PULSE_AllocateWaveoutDevice("default", NULL, "Default", &fake_cvolume); ++ PULSE_AllocateWaveinDevice("default", NULL, "Default", &fake_cvolume); ++ PULSE_WaitForOperation(pa_context_get_sink_info_list(PULSE_context, PULSE_SinkInfoCallback, &PULSE_WodNumDevs)); ++ PULSE_WaitForOperation(pa_context_get_source_info_list(PULSE_context, PULSE_SourceInfoCallback, &PULSE_WidNumDevs)); ++ TRACE("Found %u output and %u input device(s).\n", PULSE_WodNumDevs - 1, PULSE_WidNumDevs - 1); ++ ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ return DRV_SUCCESS; ++ ++fail: ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ /* Only warn, because if we failed wine may still choose the next driver */ ++ WARN("Failed to connect to server\n"); ++ return DRV_FAILURE; ++} ++ ++#endif /* HAVE_PULSEAUDIO */ ++ ++/************************************************************************** ++ * DriverProc (WINEPULSE.@) ++ */ ++LRESULT CALLBACK PULSE_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, ++ LPARAM dwParam1, LPARAM dwParam2) { ++ ++ switch(wMsg) { ++#ifdef HAVE_PULSEAUDIO ++ case DRV_LOAD: return PULSE_WaveInit(); ++ case DRV_FREE: return PULSE_WaveClose(); ++ case DRV_OPEN: return 1; ++ case DRV_CLOSE: return 1; ++ case DRV_ENABLE: return 1; ++ case DRV_DISABLE: return 1; ++ case DRV_QUERYCONFIGURE: return 1; ++ case DRV_CONFIGURE: MessageBoxA(0, "PulseAudio MultiMedia Driver !", "PulseAudio Driver", MB_OK); return 1; ++ case DRV_INSTALL: return DRVCNF_RESTART; ++ case DRV_REMOVE: return DRVCNF_RESTART; ++#endif ++ default: ++ return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); ++ } ++} +diff --git a/dlls/winepulse.drv/wavein.c b/dlls/winepulse.drv/wavein.c +new file mode 100644 +index 0000000..8aea538 +--- /dev/null ++++ b/dlls/winepulse.drv/wavein.c +@@ -0,0 +1,588 @@ ++/* ++ * Wine Driver for PulseAudio - WaveIn Functionality ++ * http://pulseaudio.org/ ++ * ++ * Copyright 2009 Arthur Taylor ++ * ++ * Contains code from other wine multimedia drivers. ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++ ++#include ++ ++#include "windef.h" ++#include "winbase.h" ++#include "wingdi.h" ++#include "winuser.h" ++#include "winnls.h" ++#include "mmddk.h" ++ ++#include ++ ++#include "wine/debug.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(wave); ++ ++#if HAVE_PULSEAUDIO ++ ++/*======================================================================* ++ * WAVE IN specific PulseAudio Callbacks * ++ *======================================================================*/ ++ ++/************************************************************************** ++ * widNotifyClient [internal] ++*/ ++static DWORD widNotifyClient(WINE_WAVEINST* wwi, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { ++ TRACE("wMsg = 0x%04x dwParm1 = %04X dwParam2 = %04X\n", wMsg, dwParam1, dwParam2); ++ ++ switch (wMsg) { ++ case WIM_OPEN: ++ case WIM_CLOSE: ++ case WIM_DATA: ++ if (wwi->wFlags != DCB_NULL && ++ !DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags, (HDRVR)wwi->waveDesc.hWave, ++ wMsg, wwi->waveDesc.dwInstance, dwParam1, dwParam2)) { ++ WARN("can't notify client !\n"); ++ return MMSYSERR_ERROR; ++ } ++ break; ++ default: ++ FIXME("Unknown callback message %u\n", wMsg); ++ return MMSYSERR_INVALPARAM; ++ } ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * widRecorder_CopyData [internal] ++ * ++ * Copys data from the fragments pulse returns to queued buffers. ++ */ ++static void widRecorder_CopyData(WINE_WAVEINST *wwi) { ++ LPWAVEHDR lpWaveHdr = wwi->lpQueuePtr; ++ size_t bytes_avail; ++ ++ /* Get this value once and trust it. Note that the total available is made ++ * of one _or more_ fragments. These fragments will probably not align with ++ * the wavehdr buffer sizes. */ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ bytes_avail = pa_stream_readable_size(wwi->stream); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ if (bytes_avail == -1) { ++ ERR("pa_stream_readable_size() returned -1, record stream has failed.\n"); ++ return; ++ } ++ ++ /* If there is an already peeked buffer, add it to the total */ ++ if (wwi->buffer) ++ bytes_avail += wwi->buffer_length - wwi->buffer_read_offset; ++ ++ for (;bytes_avail && lpWaveHdr; lpWaveHdr = wwi->lpQueuePtr) { ++ size_t peek_avail; ++ ++ if (!wwi->buffer) { ++ pa_threaded_mainloop_lock(PULSE_ml); ++ pa_stream_peek(wwi->stream, &wwi->buffer, &wwi->buffer_length); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ wwi->buffer_read_offset = 0; ++ ++ if (!wwi->buffer || !wwi->buffer_length) { ++ WARN("pa_stream_peek failed\n"); ++ break; ++ } ++ } ++ ++ peek_avail = min(wwi->buffer_length - wwi->buffer_read_offset, ++ lpWaveHdr->dwBufferLength - lpWaveHdr->dwBytesRecorded); ++ ++ memcpy(lpWaveHdr->lpData + lpWaveHdr->dwBytesRecorded, ++ (PBYTE)wwi->buffer + wwi->buffer_read_offset, ++ peek_avail); ++ ++ wwi->buffer_read_offset += peek_avail; ++ lpWaveHdr->dwBytesRecorded += peek_avail; ++ bytes_avail -= peek_avail; ++ ++ if (lpWaveHdr->dwBytesRecorded == lpWaveHdr->dwBufferLength) { ++ lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; ++ lpWaveHdr->dwFlags |= WHDR_DONE; ++ wwi->lpQueuePtr = lpWaveHdr->lpNext; ++ widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); ++ } ++ ++ if (wwi->buffer_read_offset == wwi->buffer_length) { ++ pa_threaded_mainloop_lock(PULSE_ml); ++ pa_stream_drop(wwi->stream); ++ wwi->buffer = NULL; ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ } ++ } /* for(bytes_avail && lpWaveHdr) */ ++ ++ return; ++} ++ ++static void widRecorder_ProcessMessages(WINE_WAVEINST* wwi) { ++ LPWAVEHDR lpWaveHdr; ++ enum win_wm_message msg; ++ DWORD param; ++ HANDLE ev; ++ ++ ++ while (PULSE_RetrieveRingMessage(&wwi->msgRing, &msg, ¶m, &ev)) { ++ TRACE("Received %s %x\n", PULSE_getCmdString(msg), param); ++ ++ switch (msg) { ++ case WINE_WM_FEED: ++ /* Spin the loop in widRecorder */ ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_STARTING: ++ wwi->dwLastReset = wwi->timing_info->read_index; ++ pa_threaded_mainloop_lock(PULSE_ml); ++ PULSE_WaitForOperation(pa_stream_cork(wwi->stream, 0, PULSE_StreamSuccessCallback, NULL)); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ wwi->state = WINE_WS_PLAYING; ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_HEADER: ++ lpWaveHdr = (LPWAVEHDR)param; ++ lpWaveHdr->lpNext = 0; ++ /* insert buffer at the end of queue */ ++ { ++ LPWAVEHDR *wh; ++ for (wh = &(wwi->lpQueuePtr); *wh; wh = &((*wh)->lpNext)); ++ *wh = lpWaveHdr; ++ } ++ break; ++ ++ case WINE_WM_STOPPING: ++ if (wwi->state != WINE_WS_STOPPED) { ++ wwi->state = WINE_WS_STOPPED; ++ pa_threaded_mainloop_lock(PULSE_ml); ++ PULSE_WaitForOperation(pa_stream_cork(wwi->stream, 1, PULSE_StreamSuccessCallback, NULL)); ++ if (wwi->buffer) { ++ pa_stream_drop(wwi->stream); ++ wwi->buffer = NULL; ++ } ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ /* return only the current buffer to app */ ++ if ((lpWaveHdr = wwi->lpQueuePtr)) { ++ LPWAVEHDR lpNext = lpWaveHdr->lpNext; ++ TRACE("stop %p %p\n", lpWaveHdr, lpWaveHdr->lpNext); ++ lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; ++ lpWaveHdr->dwFlags |= WHDR_DONE; ++ wwi->lpQueuePtr = lpNext; ++ widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); ++ } ++ } ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_RESETTING: ++ if (wwi->state != WINE_WS_STOPPED) { ++ wwi->state = WINE_WS_STOPPED; ++ pa_threaded_mainloop_lock(PULSE_ml); ++ PULSE_WaitForOperation(pa_stream_cork(wwi->stream, 1, PULSE_StreamSuccessCallback, NULL)); ++ if (wwi->buffer) { ++ pa_stream_drop(wwi->stream); ++ wwi->buffer = NULL; ++ } ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ } ++ ++ /* return all the buffers to the app */ ++ lpWaveHdr = wwi->lpPlayPtr ? wwi->lpPlayPtr : wwi->lpQueuePtr; ++ for (; lpWaveHdr; lpWaveHdr = wwi->lpQueuePtr) { ++ lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; ++ lpWaveHdr->dwFlags |= WHDR_DONE; ++ wwi->lpQueuePtr = lpWaveHdr->lpNext; ++ widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); ++ } ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_CLOSING: ++ wwi->hThread = 0; ++ wwi->state = WINE_WS_CLOSED; ++ SetEvent(ev); ++ ExitThread(0); ++ /* shouldn't go here */ ++ ++ default: ++ FIXME("unknown message %d\n", msg); ++ break; ++ } ++ } ++} ++ ++/************************************************************************** ++ * widRecorder [internal] ++ */ ++static DWORD CALLBACK widRecorder(LPVOID lpParam) { ++ WINE_WAVEINST *wwi = (WINE_WAVEINST*)lpParam; ++ ++ wwi->state = WINE_WS_STOPPED; ++ SetEvent(wwi->hStartUpEvent); ++ ++ for (;;) { ++ PULSE_WaitRingMessage(&wwi->msgRing, INFINITE); ++ widRecorder_ProcessMessages(wwi); ++ if (wwi->state == WINE_WS_PLAYING && wwi->lpQueuePtr) ++ widRecorder_CopyData(wwi); ++ } ++ ++ return 0; ++} ++ ++/************************************************************************** ++ * widOpen [internal] ++ */ ++static DWORD widOpen(WORD wDevID, DWORD_PTR *lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) { ++ WINE_WAVEDEV *wdi; ++ WINE_WAVEINST *wwi = NULL; ++ DWORD ret = MMSYSERR_NOERROR; ++ ++ TRACE("(%u, %p, %08X);\n", wDevID, lpDesc, dwFlags); ++ if (lpDesc == NULL) { ++ WARN("Invalid Parameter !\n"); ++ return MMSYSERR_INVALPARAM; ++ } ++ ++ if (wDevID >= PULSE_WidNumDevs) { ++ TRACE("Asked for device %d, but only %d known!\n", wDevID, PULSE_WidNumDevs); ++ return MMSYSERR_BADDEVICEID; ++ } ++ wdi = &WInDev[wDevID]; ++ ++ wwi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_WAVEINST)); ++ if (!wwi) return MMSYSERR_NOMEM; ++ *lpdwUser = (DWORD_PTR)wwi; ++ ++ /* check to see if format is supported and make pa_sample_spec struct */ ++ if (!PULSE_SetupFormat(lpDesc->lpFormat, &wwi->sample_spec)) { ++ WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%d !\n", ++ lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, ++ lpDesc->lpFormat->nSamplesPerSec); ++ ret = WAVERR_BADFORMAT; ++ goto exit; ++ } ++ ++ if (TRACE_ON(wave)) { ++ char t[PA_SAMPLE_SPEC_SNPRINT_MAX]; ++ pa_sample_spec_snprint(t, sizeof(t), &wwi->sample_spec); ++ TRACE("Sample spec '%s'\n", t); ++ } ++ ++ if (dwFlags & WAVE_FORMAT_QUERY) { ++ TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%d !\n", ++ lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, ++ lpDesc->lpFormat->nSamplesPerSec); ++ ret = MMSYSERR_NOERROR; ++ goto exit; ++ } ++ ++ wwi->wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); ++ wwi->waveDesc = *lpDesc; ++ PULSE_InitRingMessage(&wwi->msgRing); ++ ++ wwi->stream = pa_stream_new(PULSE_context, "WaveIn", &wwi->sample_spec, NULL); ++ if (!wwi->stream) { ++ ret = WAVERR_BADFORMAT; ++ goto exit; ++ } ++ ++ pa_stream_set_state_callback(wwi->stream, PULSE_StreamStateCallback, wwi); ++ pa_stream_set_read_callback (wwi->stream, PULSE_StreamRequestCallback, wwi); ++ ++ wwi->buffer_attr.maxlength = (uint32_t)-1; ++ wwi->buffer_attr.fragsize = pa_bytes_per_second(&wwi->sample_spec) / 100; ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ TRACE("Asking to open %s for recording.\n", wdi->device_name); ++ pa_stream_connect_record(wwi->stream, wdi->device_name, &wwi->buffer_attr, ++ PA_STREAM_START_CORKED | ++ PA_STREAM_AUTO_TIMING_UPDATE); ++ ++ for (;;) { ++ pa_context_state_t cstate = pa_context_get_state(PULSE_context); ++ pa_stream_state_t sstate = pa_stream_get_state(wwi->stream); ++ ++ if (cstate == PA_CONTEXT_FAILED || cstate == PA_CONTEXT_TERMINATED || ++ sstate == PA_STREAM_FAILED || sstate == PA_STREAM_TERMINATED) { ++ ERR("Failed to connect context object: %s\n", pa_strerror(pa_context_errno(PULSE_context))); ++ ret = MMSYSERR_NODRIVER; ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ goto exit; ++ } ++ ++ if (sstate == PA_STREAM_READY) ++ break; ++ ++ pa_threaded_mainloop_wait(PULSE_ml); ++ } ++ TRACE("(%p)->stream connected for recording.\n", wwi); ++ ++ PULSE_WaitForOperation(pa_stream_update_timing_info(wwi->stream, PULSE_StreamSuccessCallback, wwi)); ++ ++ wwi->timing_info = pa_stream_get_timing_info(wwi->stream); ++ assert(wwi->timing_info); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ wwi->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); ++ wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)wwi, 0, &(wwi->dwThreadID)); ++ if (wwi->hThread) ++ SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL); ++ else { ++ ERR("Thread creation for the widRecorder failed!\n"); ++ ret = MMSYSERR_NOMEM; ++ goto exit; ++ } ++ WaitForSingleObject(wwi->hStartUpEvent, INFINITE); ++ CloseHandle(wwi->hStartUpEvent); ++ wwi->hStartUpEvent = INVALID_HANDLE_VALUE; ++ ++ return widNotifyClient(wwi, WIM_OPEN, 0L, 0L); ++ ++exit: ++ if (!wwi) ++ return ret; ++ ++ if (wwi->hStartUpEvent != INVALID_HANDLE_VALUE) ++ CloseHandle(wwi->hStartUpEvent); ++ ++ if (wwi->msgRing.ring_buffer_size > 0) ++ PULSE_DestroyRingMessage(&wwi->msgRing); ++ ++ if (wwi->stream) { ++ if (pa_stream_get_state(wwi->stream) == PA_STREAM_READY) ++ pa_stream_disconnect(wwi->stream); ++ pa_stream_unref(wwi->stream); ++ } ++ HeapFree(GetProcessHeap(), 0, wwi); ++ ++ return ret; ++} ++/************************************************************************** ++ * widClose [internal] ++ */ ++static DWORD widClose(WORD wDevID, WINE_WAVEINST *wwi) { ++ DWORD ret; ++ ++ TRACE("(%u, %p);\n", wDevID, wwi); ++ if (wDevID >= PULSE_WidNumDevs) { ++ WARN("Asked for device %d, but only %d known!\n", wDevID, PULSE_WodNumDevs); ++ return MMSYSERR_INVALHANDLE; ++ } else if (!wwi) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ if (wwi->state != WINE_WS_FAILED) { ++ if (wwi->lpQueuePtr) { ++ WARN("buffers recording recording !\n"); ++ return WAVERR_STILLPLAYING; ++ } ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ if (pa_stream_get_state(wwi->stream) == PA_STREAM_READY) ++ pa_stream_drop(wwi->stream); ++ pa_stream_disconnect(wwi->stream); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ if (wwi->hThread != INVALID_HANDLE_VALUE) ++ PULSE_AddRingMessage(&wwi->msgRing, WINE_WM_CLOSING, 0, TRUE); ++ ++ PULSE_DestroyRingMessage(&wwi->msgRing); ++ } ++ ret = widNotifyClient(wwi, WIM_CLOSE, 0L, 0L); ++ ++ pa_stream_unref(wwi->stream); ++ TRACE("Deallocating record instance.\n"); ++ HeapFree(GetProcessHeap(), 0, wwi); ++ return ret; ++} ++ ++/************************************************************************** ++ * widAddBuffer [internal] ++ * ++ */ ++static DWORD widAddBuffer(WINE_WAVEINST* wwi, LPWAVEHDR lpWaveHdr, DWORD dwSize) { ++ TRACE("(%p, %p, %08X);\n", wwi, lpWaveHdr, dwSize); ++ ++ if (!wwi || wwi->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ if (lpWaveHdr->lpData == NULL || !(lpWaveHdr->dwFlags & WHDR_PREPARED)) ++ return WAVERR_UNPREPARED; ++ ++ if (lpWaveHdr->dwFlags & WHDR_INQUEUE) ++ return WAVERR_STILLPLAYING; ++ ++ lpWaveHdr->dwFlags &= ~WHDR_DONE; ++ lpWaveHdr->dwFlags |= WHDR_INQUEUE; ++ lpWaveHdr->dwBytesRecorded = 0; ++ lpWaveHdr->lpNext = 0; ++ ++ PULSE_AddRingMessage(&wwi->msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE); ++ ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * widRecorderMessage [internal] ++ */ ++static DWORD widRecorderMessage(WINE_WAVEINST *wwi, enum win_wm_message message) { ++ if (!wwi || wwi->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ PULSE_AddRingMessage(&wwi->msgRing, message, 0, TRUE); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * widGetPosition [internal] ++ */ ++static DWORD widGetPosition(WINE_WAVEINST *wwi, LPMMTIME lpTime, DWORD uSize) { ++ ++ if (!wwi || wwi->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ if (lpTime == NULL) return MMSYSERR_INVALPARAM; ++ ++ return PULSE_UsecToMMTime(pa_bytes_to_usec(wwi->timing_info->read_index - wwi->dwLastReset, &wwi->sample_spec), lpTime, &wwi->sample_spec); ++} ++ ++/************************************************************************** ++ * widGetDevCaps [internal] ++ */ ++static DWORD widGetDevCaps(DWORD wDevID, LPWAVEINCAPSW lpCaps, DWORD dwSize) { ++ TRACE("(%u, %p, %u);\n", wDevID, lpCaps, dwSize); ++ ++ if (lpCaps == NULL) return MMSYSERR_NOTENABLED; ++ ++ if (wDevID >= PULSE_WidNumDevs) { ++ TRACE("Asked for device %d, but only %d known!\n", wDevID, PULSE_WidNumDevs); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ memcpy(lpCaps, &(WInDev[wDevID].caps.in), min(dwSize, sizeof(*lpCaps))); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * widGetNumDevs [internal] ++ * Context-sanity check here, as if we respond with 0, WINE will move on ++ * to the next wavein driver. ++ */ ++static DWORD widGetNumDevs(void) { ++ if (pa_context_get_state(PULSE_context) != PA_CONTEXT_READY) ++ return 0; ++ ++ return PULSE_WidNumDevs; ++} ++ ++/************************************************************************** ++ * widDevInterfaceSize [internal] ++ */ ++static DWORD widDevInterfaceSize(UINT wDevID, LPDWORD dwParam1) { ++ TRACE("(%u, %p)\n", wDevID, dwParam1); ++ ++ *dwParam1 = MultiByteToWideChar(CP_UTF8, 0, WInDev[wDevID].interface_name, -1, ++ NULL, 0 ) * sizeof(WCHAR); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * widDevInterface [internal] ++ */ ++static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2) { ++ if (dwParam2 >= MultiByteToWideChar(CP_UTF8, 0, WInDev[wDevID].interface_name, -1, ++ NULL, 0 ) * sizeof(WCHAR)) ++ { ++ MultiByteToWideChar(CP_UTF8, 0, WInDev[wDevID].interface_name, -1, ++ dwParam1, dwParam2 / sizeof(WCHAR)); ++ return MMSYSERR_NOERROR; ++ } ++ return MMSYSERR_INVALPARAM; ++} ++ ++/************************************************************************** ++ * widDsDesc [internal] ++ */ ++DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc) ++{ ++ *desc = WInDev[wDevID].ds_desc; ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * widMessage (WINEPULSE.@) ++ */ ++DWORD WINAPI PULSE_widMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, ++ DWORD_PTR dwParam1, DWORD_PTR dwParam2) { ++ ++ switch (wMsg) { ++ case DRVM_INIT: ++ case DRVM_EXIT: ++ case DRVM_ENABLE: ++ case DRVM_DISABLE: ++ /* FIXME: Pretend this is supported */ ++ return 0; ++ case WIDM_OPEN: return widOpen (wDevID, (DWORD_PTR*)dwUser, (LPWAVEOPENDESC)dwParam1, dwParam2); ++ case WIDM_CLOSE: return widClose (wDevID, (WINE_WAVEINST*)dwUser); ++ case WIDM_ADDBUFFER: return widAddBuffer ((WINE_WAVEINST*)dwUser, (LPWAVEHDR)dwParam1, dwParam2); ++ case WIDM_PREPARE: return MMSYSERR_NOTSUPPORTED; ++ case WIDM_UNPREPARE: return MMSYSERR_NOTSUPPORTED; ++ case WIDM_GETDEVCAPS: return widGetDevCaps(wDevID, (LPWAVEINCAPSW)dwParam1, dwParam2); ++ case WIDM_GETNUMDEVS: return widGetNumDevs(); ++ case WIDM_GETPOS: return widGetPosition ((WINE_WAVEINST*)dwUser, (LPMMTIME)dwParam1, dwParam2); ++ case WIDM_RESET: return widRecorderMessage((WINE_WAVEINST*)dwUser, WINE_WM_RESETTING); ++ case WIDM_START: return widRecorderMessage((WINE_WAVEINST*)dwUser, WINE_WM_STARTING); ++ case WIDM_STOP: return widRecorderMessage((WINE_WAVEINST*)dwUser, WINE_WM_STOPPING); ++ case DRV_QUERYDEVICEINTERFACESIZE: return widDevInterfaceSize(wDevID, (LPDWORD)dwParam1); ++ case DRV_QUERYDEVICEINTERFACE: return widDevInterface(wDevID, (PWCHAR)dwParam1, dwParam2); ++ case DRV_QUERYDSOUNDIFACE: return MMSYSERR_NOTSUPPORTED; /* Use emulation, as there is no advantage */ ++ case DRV_QUERYDSOUNDDESC: return widDsDesc(wDevID, (PDSDRIVERDESC)dwParam1); ++ default: ++ FIXME("unknown message %d!\n", wMsg); ++ } ++ return MMSYSERR_NOTSUPPORTED; ++} ++ ++#else /* HAVE_PULSEAUDIO */ ++ ++/************************************************************************** ++ * widMessage (WINEPULSE.@) ++ */ ++DWORD WINAPI PULSE_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, ++ DWORD dwParam1, DWORD dwParam2) { ++ FIXME("(%u, %04X, %08X, %08X, %08X):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); ++ return MMSYSERR_NOTENABLED; ++} ++ ++#endif /* HAVE_PULSEAUDIO */ +diff --git a/dlls/winepulse.drv/waveout.c b/dlls/winepulse.drv/waveout.c +new file mode 100644 +index 0000000..989dff5 +--- /dev/null ++++ b/dlls/winepulse.drv/waveout.c +@@ -0,0 +1,1024 @@ ++/* ++ * Wine Driver for PulseAudio - WaveOut Functionality ++ * http://pulseaudio.org/ ++ * ++ * Copyright 2009 Arthur Taylor ++ * ++ * Contains code from other wine multimedia drivers. ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++ ++#include ++ ++#include "windef.h" ++#include "winbase.h" ++#include "wingdi.h" ++#include "winuser.h" ++#include "winnls.h" ++#include "winerror.h" ++#include "mmddk.h" ++ ++#include ++ ++#include "wine/debug.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(wave); ++ ++#if HAVE_PULSEAUDIO ++ ++/* state diagram for waveOut writing: ++ * ++ * +---------+-------------+---------------+---------------------------------+ ++ * | state | function | event | new state | ++ * +---------+-------------+---------------+---------------------------------+ ++ * | | open() | | STOPPED | ++ * | PAUSED | write() | | PAUSED | ++ * | STOPPED | write() | | PLAYING | ++ * | PLAYING | write() | HEADER | PLAYING | ++ * | (other) | write() | | | ++ * | (any) | pause() | PAUSING | PAUSED | ++ * | PAUSED | restart() | RESTARTING | PLAYING (if no thrd => STOPPED) | ++ * | PAUSED | reset() | RESETTING | PAUSED | ++ * | (other) | reset() | RESETTING | STOPPED | ++ * | (any) | close() | CLOSING | CLOSED | ++ * +---------+-------------+---------------+---------------------------------+ ++ */ ++ ++/* ++ * - It is currently unknown if pausing in a loop works the same as expected. ++ */ ++ ++/*======================================================================* ++ * WAVE OUT specific PulseAudio Callbacks * ++ *======================================================================*/ ++ ++/************************************************************************** ++ * WAVEOUT_SinkInputInfoCallback [internal] ++ * ++ * Called by the pulse thread. Used for wodGetVolume. ++ */ ++static void WAVEOUT_SinkInputInfoCallback(pa_context *c, const pa_sink_input_info *i, int eol, void *userdata) { ++ WINE_WAVEINST* wwo = (WINE_WAVEINST*)userdata; ++ if (!eol && i) { ++ for (wwo->volume.channels = 0; wwo->volume.channels != i->volume.channels; wwo->volume.channels++) ++ wwo->volume.values[wwo->volume.channels] = i->volume.values[wwo->volume.channels]; ++ pa_threaded_mainloop_signal(PULSE_ml, 0); ++ } ++} ++ ++/*======================================================================* ++ * "Low level" WAVE OUT implementation * ++ *======================================================================*/ ++ ++/************************************************************************** ++ * wodPlayer_NotifyClient [internal] ++ */ ++static DWORD wodPlayer_NotifyClient(WINE_WAVEINST* wwo, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { ++ /* TRACE("wMsg = 0x%04x dwParm1 = %04X dwParam2 = %04X\n", wMsg, dwParam1, dwParam2); */ ++ ++ switch (wMsg) { ++ case WOM_OPEN: ++ case WOM_CLOSE: ++ case WOM_DONE: ++ if (wwo->wFlags != DCB_NULL && ++ !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, (HDRVR)wwo->waveDesc.hWave, ++ wMsg, wwo->waveDesc.dwInstance, dwParam1, dwParam2)) { ++ WARN("can't notify client !\n"); ++ return MMSYSERR_ERROR; ++ } ++ break; ++ default: ++ FIXME("Unknown callback message %u\n", wMsg); ++ return MMSYSERR_INVALPARAM; ++ } ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodPlayer_BeginWaveHdr [internal] ++ * ++ * Makes the specified lpWaveHdr the currently playing wave header. ++ * If the specified wave header is a begin loop and we're not already in ++ * a loop, setup the loop. ++ */ ++static void wodPlayer_BeginWaveHdr(WINE_WAVEINST* wwo, LPWAVEHDR lpWaveHdr) { ++ wwo->lpPlayPtr = lpWaveHdr; ++ ++ if (!lpWaveHdr) return; ++ ++ if (lpWaveHdr->dwFlags & WHDR_BEGINLOOP) { ++ if (wwo->lpLoopPtr) { ++ WARN("Already in a loop. Discarding loop on this header (%p)\n", lpWaveHdr); ++ } else { ++ TRACE("Starting loop (%dx) with %p\n", lpWaveHdr->dwLoops, lpWaveHdr); ++ wwo->lpLoopPtr = lpWaveHdr; ++ /* Windows does not touch WAVEHDR.dwLoops, ++ * so we need to make an internal copy */ ++ wwo->dwLoops = lpWaveHdr->dwLoops; ++ } ++ } ++ wwo->dwPartialOffset = 0; ++} ++ ++/************************************************************************** ++ * wodPlayer_PlayPtrNext [internal] ++ * ++ * Advance the play pointer to the next waveheader, looping if required. ++ */ ++static LPWAVEHDR wodPlayer_PlayPtrNext(WINE_WAVEINST* wwo) { ++ LPWAVEHDR lpWaveHdr = wwo->lpPlayPtr; ++ ++ wwo->dwPartialOffset = 0; ++ if ((lpWaveHdr->dwFlags & WHDR_ENDLOOP) && wwo->lpLoopPtr) { ++ /* We're at the end of a loop, loop if required */ ++ if (--wwo->dwLoops > 0) { ++ wwo->lpPlayPtr = wwo->lpLoopPtr; ++ } else { ++ /* Handle overlapping loops correctly */ ++ if (wwo->lpLoopPtr != lpWaveHdr && (lpWaveHdr->dwFlags & WHDR_BEGINLOOP)) { ++ FIXME("Correctly handled case ? (ending loop buffer also starts a new loop)\n"); ++ /* shall we consider the END flag for the closing loop or for ++ * the opening one or for both ??? ++ * code assumes for closing loop only ++ */ ++ } else { ++ lpWaveHdr = lpWaveHdr->lpNext; ++ } ++ wwo->lpLoopPtr = NULL; ++ wodPlayer_BeginWaveHdr(wwo, lpWaveHdr); ++ } ++ } else { ++ /* We're not in a loop. Advance to the next wave header */ ++ wodPlayer_BeginWaveHdr(wwo, lpWaveHdr = lpWaveHdr->lpNext); ++ } ++ ++ return lpWaveHdr; ++} ++ ++/************************************************************************** ++ * wodPlayer_CheckReleasing [internal] ++ * ++ * Check to make sure that playback has not stalled. If stalled ask to reduce ++ * the size of the buffer on the pulse server side. ++ */ ++static void wodPlayer_CheckReleasing(WINE_WAVEINST *wwo) { ++ LPWAVEHDR lpWaveHdr; ++ ++ if (wwo->buffer_attr.tlength == -1) { ++ pa_threaded_mainloop_lock(PULSE_ml); ++ if (!wwo->timing_info->playing) { ++ ++ /* Calculate how large a buffer the application has made so far */ ++ wwo->buffer_attr.tlength = 0; ++ wwo->buffer_attr.minreq = wwo->lpQueuePtr->dwBufferLength; ++ for (lpWaveHdr = wwo->lpQueuePtr; lpWaveHdr; lpWaveHdr = lpWaveHdr->lpNext) ++ wwo->buffer_attr.tlength += lpWaveHdr->dwBufferLength; ++ ++ WARN("Asking for new buffer target length of %llums (%u bytes)\n", ++ pa_bytes_to_usec(wwo->buffer_attr.tlength, &wwo->sample_spec) / 1000, ++ wwo->buffer_attr.tlength); ++ ++ /* Try and adjust the buffer attributes so that playback can start. ++ * Because of bugs pa_stream_set_buffer_attr() does not work on started ++ * streams for server version 0.9.11 to 0.9.14 */ ++ PULSE_WaitForOperation(pa_stream_set_buffer_attr(wwo->stream, &wwo->buffer_attr, PULSE_StreamSuccessCallback, wwo)); ++ } ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ } ++} ++ ++/************************************************************************** ++ * wodPlayer_NotifyCompletions [internal] ++ * ++ * Notifies the client of wavehdr completion starting from lpQueuePtr and ++ * stopping when hitting an unwritten wavehdr, the beginning of a loop or a ++ * wavehdr that has not been played, when referenced to the time parameter. ++ */ ++static DWORD wodPlayer_NotifyCompletions(WINE_WAVEINST* wwo, BOOL force, pa_usec_t time) { ++ LPWAVEHDR lpWaveHdr = wwo->lpQueuePtr; ++ pa_usec_t wait; ++ ++ while (lpWaveHdr) { ++ if (!force) { ++ /* Start from lpQueuePtr and keep notifying until: ++ * - we hit an unwritten wavehdr ++ * - we hit the beginning of a running loop ++ * - we hit a wavehdr which hasn't finished playing ++ */ ++ if (lpWaveHdr == wwo->lpLoopPtr) { TRACE("loop %p\n", lpWaveHdr); return INFINITE; } ++ if (lpWaveHdr == wwo->lpPlayPtr) { TRACE("play %p\n", lpWaveHdr); return INFINITE; } ++ ++ /* See if this data has been played, and if not, return when it will have been */ ++ wait = pa_bytes_to_usec(lpWaveHdr->reserved + lpWaveHdr->dwBufferLength, &wwo->sample_spec); ++ if (wait >= time) { ++ wait = ((wait - time) + (pa_usec_t)999) / (pa_usec_t)1000; ++ return wait ?: 1; ++ } ++ } ++ TRACE("Returning %p.[%i]\n", lpWaveHdr, (DWORD)lpWaveHdr->reserved); ++ ++ /* return the wavehdr */ ++ wwo->lpQueuePtr = lpWaveHdr->lpNext; ++ lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; ++ lpWaveHdr->dwFlags |= WHDR_DONE; ++ ++ wodPlayer_NotifyClient(wwo, WOM_DONE, (DWORD)lpWaveHdr, 0); ++ lpWaveHdr = wwo->lpQueuePtr; ++ } ++ /* No more wavehdrs */ ++ TRACE("Empty queue\n"); ++ return INFINITE; ++} ++ ++/************************************************************************** ++ * wodPlayer_WriteMax [internal] ++ * ++ * Write either how much free space or how much data we have, depending on ++ * which is less ++ */ ++static DWORD wodPlayer_WriteMax(WINE_WAVEINST *wwo, size_t *space) { ++ LPWAVEHDR lpWaveHdr = wwo->lpPlayPtr; ++ size_t nbytes; ++ ++ nbytes = min(lpWaveHdr->dwBufferLength - wwo->dwPartialOffset, *space); ++ ++ TRACE("Writing wavehdr %p.%u[%u]\n", lpWaveHdr, wwo->dwPartialOffset, lpWaveHdr->dwBufferLength); ++ pa_stream_write(wwo->stream, lpWaveHdr->lpData + wwo->dwPartialOffset, nbytes, NULL, 0, PA_SEEK_RELATIVE); ++ ++ /* Check to see if we wrote all of the wavehdr */ ++ if ((wwo->dwPartialOffset += nbytes) >= lpWaveHdr->dwBufferLength) ++ wodPlayer_PlayPtrNext(wwo); ++ ++ *space -= nbytes; ++ ++ return nbytes; ++} ++ ++/************************************************************************** ++ * wodPlayer_Feed [internal] ++ * ++ * Feed as much sound data as we can into pulse using wodPlayer_WriteMax. ++ * size_t space _must_ have come from either pa_stream_writable_size() or ++ * the value from a stream write callback, as if it isn't you run the risk ++ * of a buffer overflow in which audio data will be lost. ++ */ ++static void wodPlayer_Feed(WINE_WAVEINST* wwo, size_t space) { ++ ++ if (!space || !wwo->stream || !PULSE_context || ++ pa_context_get_state(PULSE_context) != PA_CONTEXT_READY || ++ pa_stream_get_state(wwo->stream) != PA_STREAM_READY) ++ return; ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ /* Feed from a partial wavehdr */ ++ if (wwo->lpPlayPtr && wwo->dwPartialOffset != 0) ++ wodPlayer_WriteMax(wwo, &space); ++ ++ /* Feed wavehdrs until we run out of wavehdrs or buffer space */ ++ if (wwo->dwPartialOffset == 0 && wwo->lpPlayPtr) { ++ do { ++ wwo->lpPlayPtr->reserved = wwo->timing_info->write_index; ++ } while (wodPlayer_WriteMax(wwo, &space) && wwo->lpPlayPtr && space > 0); ++ } ++ ++ pa_threaded_mainloop_unlock(PULSE_ml); ++} ++ ++/************************************************************************** ++ * wodPlayer_Reset [internal] ++ * ++ * wodPlayer helper. Resets current output stream. ++ */ ++static void wodPlayer_Reset(WINE_WAVEINST* wwo) { ++ enum win_wm_message msg; ++ DWORD param; ++ HANDLE ev; ++ ++ TRACE("(%p)\n", wwo); ++ ++ /* Remove any buffer */ ++ wodPlayer_NotifyCompletions(wwo, TRUE, 0); ++ ++ wwo->lpPlayPtr = wwo->lpQueuePtr = wwo->lpLoopPtr = NULL; ++ if (wwo->state != WINE_WS_PAUSED) ++ wwo->state = WINE_WS_STOPPED; ++ ++ wwo->dwPartialOffset = 0; ++ ++ if (!wwo->stream || ++ !PULSE_context || ++ pa_context_get_state(PULSE_context) != PA_CONTEXT_READY || ++ pa_stream_get_state(wwo->stream) != PA_STREAM_READY) { ++ return; ++ } ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ ++ /* Flush the output buffer of written data*/ ++ PULSE_WaitForOperation(pa_stream_flush(wwo->stream, PULSE_StreamSuccessCallback, NULL)); ++ ++ /* Reset the written byte count as some data may have been flushed */ ++ if (wwo->timing_info->write_index_corrupt) ++ PULSE_WaitForOperation(pa_stream_update_timing_info(wwo->stream, PULSE_StreamSuccessCallback, wwo)); ++ ++ wwo->dwLastReset = wwo->timing_info->write_index; ++ ++ /* Return all pending headers in queue */ ++ EnterCriticalSection(&wwo->msgRing.msg_crst); ++ while (PULSE_RetrieveRingMessage(&wwo->msgRing, &msg, ¶m, &ev)) { ++ if (msg != WINE_WM_HEADER) { ++ SetEvent(ev); ++ continue; ++ } ++ ((LPWAVEHDR)param)->dwFlags &= ~WHDR_INQUEUE; ++ ((LPWAVEHDR)param)->dwFlags |= WHDR_DONE; ++ wodPlayer_NotifyClient(wwo, WOM_DONE, param, 0); ++ } ++ PULSE_ResetRingMessage(&wwo->msgRing); ++ LeaveCriticalSection(&wwo->msgRing.msg_crst); ++ ++ pa_threaded_mainloop_unlock(PULSE_ml); ++} ++ ++/************************************************************************** ++ * wodPlayer_GetStreamTime [internal] ++ * ++ * Returns how many microseconds into the playback the audio stream is. Does ++ * not reset to 0 on Reset() calls. Better than pa_stream_get_time() as it is ++ * more constant. ++ */ ++static pa_usec_t wodPlayer_GetStreamTime(WINE_WAVEINST *wwo) { ++ pa_usec_t time, temp; ++ const pa_timing_info *t; ++ ++ t = wwo->timing_info; ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ ++ time = pa_bytes_to_usec(t->read_index, &wwo->sample_spec); ++ if (t->read_index_corrupt) { ++ WARN("Read index corrupt?!\n"); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ return time; ++ } ++ ++ if (t->playing) { ++ time += pa_timeval_age(&t->timestamp); ++ temp = t->transport_usec + t->configured_sink_usec; ++ if (temp > wwo->buffer_attr.tlength) temp = wwo->buffer_attr.tlength; ++ if (time > temp) time -= temp; else time = 0; ++ } ++ ++ /* Make sure we haven't claimed to have played more than we have written */ ++ temp = pa_bytes_to_usec(t->write_index, &wwo->sample_spec); ++ if (time > temp) time = temp; ++ ++ /* No queued buffer shows an underrun, so we lie */ ++ if (!wwo->lpQueuePtr) time = temp; ++ ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ return time; ++} ++ ++/************************************************************************** ++ * wodPlayer_ProcessMessages [internal] ++ */ ++static void wodPlayer_ProcessMessages(WINE_WAVEINST* wwo) { ++ LPWAVEHDR lpWaveHdr; ++ enum win_wm_message msg; ++ DWORD param; ++ HANDLE ev; ++ ++ while (PULSE_RetrieveRingMessage(&wwo->msgRing, &msg, ¶m, &ev)) { ++ TRACE("Received %s %x\n", PULSE_getCmdString(msg), param); ++ ++ switch (msg) { ++ case WINE_WM_PAUSING: ++ wwo->state = WINE_WS_PAUSED; ++ pa_threaded_mainloop_lock(PULSE_ml); ++ PULSE_WaitForOperation(pa_stream_cork(wwo->stream, 1, PULSE_StreamSuccessCallback, wwo)); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_RESTARTING: ++ if (wwo->state == WINE_WS_PAUSED) { ++ wwo->state = WINE_WS_PLAYING; ++ pa_threaded_mainloop_lock(PULSE_ml); ++ PULSE_WaitForOperation(pa_stream_cork(wwo->stream, 0, PULSE_StreamSuccessCallback, wwo)); ++ /* If the serverside buffer was near full before pausing, we ++ * need to have space to write soon, so force playback start */ ++ PULSE_WaitForOperation(pa_stream_trigger(wwo->stream, PULSE_StreamSuccessCallback, wwo)); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ } ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_HEADER: ++ lpWaveHdr = (LPWAVEHDR)param; ++ /* insert buffer at the end of queue */ ++ { ++ LPWAVEHDR *wh; ++ for (wh = &(wwo->lpQueuePtr); *wh; wh = &((*wh)->lpNext)); ++ *wh = lpWaveHdr; ++ } ++ ++ if (!wwo->lpPlayPtr) ++ wodPlayer_BeginWaveHdr(wwo,lpWaveHdr); ++ if (wwo->state == WINE_WS_STOPPED) ++ wwo->state = WINE_WS_PLAYING; ++ ++ wodPlayer_Feed(wwo, pa_stream_writable_size(wwo->stream)); ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_RESETTING: ++ wodPlayer_Reset(wwo); ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_BREAKLOOP: ++ if (wwo->state == WINE_WS_PLAYING && wwo->lpLoopPtr != NULL) ++ /* ensure exit at end of current loop */ ++ wwo->dwLoops = 1; ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_FEED: /* Sent by the pulse thread */ ++ wodPlayer_Feed(wwo, pa_stream_writable_size(wwo->stream)); ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_XRUN: /* Sent by the pulse thread */ ++ WARN("Trying to recover from underrun.\n"); ++ /* Return all the queued wavehdrs, so the app will send more data */ ++ wodPlayer_NotifyCompletions(wwo, FALSE, (pa_usec_t)-1); ++ ++ SetEvent(ev); ++ break; ++ ++ case WINE_WM_CLOSING: ++ wwo->hThread = NULL; ++ wwo->state = WINE_WS_CLOSED; ++ /* sanity check: this should not happen since the device must have been reset before */ ++ if (wwo->lpQueuePtr || wwo->lpPlayPtr) ERR("out of sync\n"); ++ SetEvent(ev); ++ TRACE("Thread exiting.\n"); ++ ExitThread(0); ++ /* shouldn't go here */ ++ ++ default: ++ FIXME("unknown message %d\n", msg); ++ break; ++ } ++ } ++} ++ ++/************************************************************************** ++ * wodPlayer [internal] ++ * ++ * The thread which is responsible for returning WaveHdrs via DriverCallback, ++ * the writing of queued WaveHdrs, and all pause / reset stream management. ++ */ ++static DWORD CALLBACK wodPlayer(LPVOID lpParam) { ++ WINE_WAVEINST *wwo = (WINE_WAVEINST*)lpParam; ++ DWORD dwSleepTime = INFINITE; ++ int64_t delta_write; ++ ++ wwo->state = WINE_WS_STOPPED; ++ SetEvent(wwo->hStartUpEvent); ++ ++ /* Wait for the shortest time before an action is required. If there are ++ * no pending actions, wait forever for a command. */ ++ for (;;) { ++ TRACE("Waiting %u ms\n", dwSleepTime); ++ PULSE_WaitRingMessage(&wwo->msgRing, dwSleepTime); ++ ++ delta_write = wwo->timing_info->write_index; ++ wodPlayer_ProcessMessages(wwo); ++ ++ /* Check for a stall situaiton */ ++ if (delta_write == wwo->timing_info->write_index ++ && wwo->lpQueuePtr && !wwo->lpPlayPtr ++ && wwo->state != WINE_WS_STOPPED) ++ wodPlayer_CheckReleasing(wwo); ++ ++ /* If there is audio playing, return headers and get next timeout */ ++ if (wwo->state == WINE_WS_PLAYING) { ++ dwSleepTime = wodPlayer_NotifyCompletions(wwo, FALSE, wodPlayer_GetStreamTime(wwo)); ++ } else ++ dwSleepTime = INFINITE; ++ } ++ ++ return 0; ++} ++ ++/************************************************************************** ++ * wodOpen [internal] ++ * ++ * Create a new pa_stream and connect it to a sink while creating a new ++ * WINE_WAVEINST to represent the device to the windows application. ++ */ ++static DWORD wodOpen(WORD wDevID, DWORD_PTR lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) { ++ WINE_WAVEDEV *wdo; ++ WINE_WAVEINST *wwo = NULL; ++ DWORD ret = MMSYSERR_NOERROR; ++ ++ TRACE("(%u, %p, %08X);\n", wDevID, lpDesc, dwFlags); ++ if (lpDesc == NULL) { ++ WARN("Invalid Parameter!\n"); ++ return MMSYSERR_INVALPARAM; ++ } ++ ++ if (wDevID >= PULSE_WodNumDevs) { ++ WARN("Asked for device %d, but only %d known!\n", wDevID, PULSE_WodNumDevs); ++ return MMSYSERR_BADDEVICEID; ++ } ++ wdo = &WOutDev[wDevID]; ++ ++ wwo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_WAVEINST)); ++ if (!wwo) { ++ WARN("Out of memory?!\n"); ++ return MMSYSERR_NOMEM; ++ } ++ *(WINE_WAVEINST**)lpdwUser = wwo; ++ ++ /* check to see if format is supported and make pa_sample_spec struct */ ++ if (!PULSE_SetupFormat(lpDesc->lpFormat, &wwo->sample_spec)) { ++ WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%d !\n", ++ lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, ++ lpDesc->lpFormat->nSamplesPerSec); ++ ret = WAVERR_BADFORMAT; ++ goto exit; ++ } ++ ++ /* Check to see if this was just a query */ ++ if (dwFlags & WAVE_FORMAT_QUERY) { ++ TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%d !\n", ++ lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, ++ lpDesc->lpFormat->nSamplesPerSec); ++ ret = MMSYSERR_NOERROR; ++ goto exit; ++ } ++ ++ if (TRACE_ON(wave)) { ++ char t[PA_SAMPLE_SPEC_SNPRINT_MAX]; ++ pa_sample_spec_snprint(t, sizeof(t), &wwo->sample_spec); ++ TRACE("Sample spec '%s'\n", t); ++ } ++ ++ wwo->wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); ++ wwo->waveDesc = *lpDesc; ++ PULSE_InitRingMessage(&wwo->msgRing); ++ ++ wwo->stream = pa_stream_new(PULSE_context, "WaveOut", &wwo->sample_spec, NULL); ++ /* If server doesn't support sample_spec, it will error out here (re: 24bit) */ ++ if (!wwo->stream) { ++ ret = WAVERR_BADFORMAT; ++ goto exit; ++ } ++ ++ /* Setup callbacks */ ++ pa_stream_set_write_callback (wwo->stream, PULSE_StreamRequestCallback, wwo); ++ pa_stream_set_state_callback (wwo->stream, PULSE_StreamStateCallback, wwo); ++ pa_stream_set_underflow_callback (wwo->stream, PULSE_StreamUnderflowCallback, wwo); ++ pa_stream_set_moved_callback (wwo->stream, PULSE_StreamMovedCallback, wwo); ++ pa_stream_set_suspended_callback (wwo->stream, PULSE_StreamSuspendedCallback, wwo); ++ ++ /* Blank Buffer Attributes */ ++ wwo->buffer_attr.prebuf = (uint32_t)-1; ++ wwo->buffer_attr.tlength = (uint32_t)-1; ++ wwo->buffer_attr.minreq = (uint32_t)-1; ++ wwo->buffer_attr.maxlength = (uint32_t)-1; ++ ++ /* Try and connect */ ++ TRACE("Connecting stream for playback on %s.\n", wdo->device_name); ++ pa_threaded_mainloop_lock(PULSE_ml); ++ pa_stream_connect_playback(wwo->stream, wdo->device_name, NULL, PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_ADJUST_LATENCY, NULL, NULL); ++ ++ /* Wait for connection */ ++ for (;;) { ++ pa_context_state_t cstate = pa_context_get_state(PULSE_context); ++ pa_stream_state_t sstate = pa_stream_get_state(wwo->stream); ++ ++ if (cstate == PA_CONTEXT_FAILED || cstate == PA_CONTEXT_TERMINATED || ++ sstate == PA_STREAM_FAILED || sstate == PA_STREAM_TERMINATED) { ++ ERR("Failed to connect stream context object: %s\n", pa_strerror(pa_context_errno(PULSE_context))); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ret = MMSYSERR_NODRIVER; ++ goto exit; ++ } ++ ++ if (sstate == PA_STREAM_READY) ++ break; ++ ++ pa_threaded_mainloop_wait(PULSE_ml); ++ } ++ TRACE("(%p)->stream connected for playback.\n", wwo); ++ ++ /* Get the pa_timing_info structure */ ++ PULSE_WaitForOperation(pa_stream_update_timing_info(wwo->stream, PULSE_StreamSuccessCallback, wwo)); ++ wwo->timing_info = pa_stream_get_timing_info(wwo->stream); ++ assert(wwo->timing_info); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ /* Create and start the wodPlayer() thread to manage playback */ ++ wwo->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); ++ wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)wwo, 0, &(wwo->dwThreadID)); ++ if (wwo->hThread) ++ SetThreadPriority(wwo->hThread, THREAD_PRIORITY_TIME_CRITICAL); ++ else { ++ ERR("Thread creation for the wodPlayer failed!\n"); ++ ret = MMSYSERR_NOMEM; ++ goto exit; ++ } ++ WaitForSingleObject(wwo->hStartUpEvent, INFINITE); ++ CloseHandle(wwo->hStartUpEvent); ++ wwo->hStartUpEvent = INVALID_HANDLE_VALUE; ++ ++ return wodPlayer_NotifyClient (wwo, WOM_OPEN, 0L, 0L); ++ ++exit: ++ if (!wwo) ++ return ret; ++ ++ if (wwo->hStartUpEvent != INVALID_HANDLE_VALUE) ++ CloseHandle(wwo->hStartUpEvent); ++ ++ if (wwo->msgRing.ring_buffer_size > 0) ++ PULSE_DestroyRingMessage(&wwo->msgRing); ++ ++ if (wwo->stream) { ++ if (pa_stream_get_state(wwo->stream) == PA_STREAM_READY) ++ pa_stream_disconnect(wwo->stream); ++ pa_stream_unref(wwo->stream); ++ wwo->stream = NULL; ++ } ++ HeapFree(GetProcessHeap(), 0, wwo); ++ ++ return ret; ++} ++ ++/************************************************************************** ++ * wodClose [internal] ++ */ ++static DWORD wodClose(WINE_WAVEINST *wwo) { ++ DWORD ret; ++ ++ TRACE("(%p);\n", wwo); ++ if (!wwo) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ if (wwo->state != WINE_WS_FAILED) { ++ if (wwo->lpQueuePtr && wwo->lpPlayPtr) { ++ WARN("buffers still playing !\n"); ++ return WAVERR_STILLPLAYING; ++ } ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ PULSE_WaitForOperation(pa_stream_drain(wwo->stream, PULSE_StreamSuccessCallback, NULL)); ++ pa_stream_disconnect(wwo->stream); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ if (wwo->hThread != INVALID_HANDLE_VALUE) ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_CLOSING, 0, TRUE); ++ ++ PULSE_DestroyRingMessage(&wwo->msgRing); ++ } ++ ++ if (wwo->stream) ++ pa_stream_unref(wwo->stream); ++ ret = wodPlayer_NotifyClient(wwo, WOM_CLOSE, 0L, 0L); ++ ++ HeapFree(GetProcessHeap(), 0, wwo); ++ ++ return ret; ++} ++ ++/************************************************************************** ++ * wodWrite [internal] ++ */ ++static DWORD wodWrite(WINE_WAVEINST *wwo, LPWAVEHDR lpWaveHdr, DWORD dwSize) { ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ if (lpWaveHdr->lpData == NULL || !(lpWaveHdr->dwFlags & WHDR_PREPARED)) ++ return WAVERR_UNPREPARED; ++ ++ if (lpWaveHdr->dwFlags & WHDR_INQUEUE) ++ return WAVERR_STILLPLAYING; ++ ++ lpWaveHdr->dwFlags &= ~WHDR_DONE; ++ lpWaveHdr->dwFlags |= WHDR_INQUEUE; ++ lpWaveHdr->lpNext = 0; ++ lpWaveHdr->reserved = 0; ++ ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodPause [internal] ++ */ ++static DWORD wodPause(WINE_WAVEINST *wwo) { ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_PAUSING, 0, TRUE); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodGetPosition [internal] ++ */ ++static DWORD wodGetPosition(WINE_WAVEINST *wwo, LPMMTIME lpTime, DWORD uSize) { ++ pa_usec_t time, temp; ++ ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ if (lpTime == NULL) return MMSYSERR_INVALPARAM; ++ ++ time = wodPlayer_GetStreamTime(wwo); ++ ++ temp = pa_bytes_to_usec(wwo->dwLastReset, &wwo->sample_spec); ++ if (time > temp) time -= temp; else time = 0; ++ ++ return PULSE_UsecToMMTime(time, lpTime, &wwo->sample_spec); ++} ++/************************************************************************** ++ * wodBreakLoop [internal] ++ */ ++static DWORD wodBreakLoop(WINE_WAVEINST *wwo) { ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_BREAKLOOP, 0, TRUE); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodGetDevCaps [internal] ++ */ ++static DWORD wodGetDevCaps(DWORD wDevID, LPWAVEOUTCAPSW lpCaps, DWORD dwSize) { ++ TRACE("(%u, %p, %u);\n", wDevID, lpCaps, dwSize); ++ ++ if (lpCaps == NULL) return MMSYSERR_NOTENABLED; ++ ++ if (wDevID >= PULSE_WodNumDevs) { ++ TRACE("Asked for device %d, but only %d known!\n", wDevID, PULSE_WodNumDevs); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ memcpy(lpCaps, &(WOutDev[wDevID].caps.out), min(dwSize, sizeof(*lpCaps))); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodGetNumDevs [internal] ++ * Context-sanity check here, as if we respond with 0, WINE will move on ++ * to the next waveout driver. ++ */ ++static DWORD wodGetNumDevs(void) { ++ if (!PULSE_ml || !PULSE_context || pa_context_get_state(PULSE_context) != PA_CONTEXT_READY) ++ return 0; ++ ++ return PULSE_WodNumDevs; ++} ++ ++/************************************************************************** ++ * wodGetVolume [internal] ++ */ ++static DWORD wodGetVolume(WINE_WAVEINST *wwo, LPDWORD lpdwVol) { ++ double value1, value2; ++ DWORD wleft, wright; ++ ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ TRACE("(%p, %p);\n", wwo, lpdwVol); ++ ++ if (lpdwVol == NULL) ++ return MMSYSERR_NOTENABLED; ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ if (wwo->stream && PULSE_context && pa_context_get_state(PULSE_context) == PA_CONTEXT_READY && ++ pa_stream_get_state(wwo->stream) == PA_STREAM_READY) { ++ PULSE_WaitForOperation(pa_context_get_sink_input_info(PULSE_context, pa_stream_get_index(wwo->stream), WAVEOUT_SinkInputInfoCallback, wwo)); ++ } ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ ++ ++ if (wwo->volume.channels == 2) { ++ value1 = pa_sw_volume_to_linear(wwo->volume.values[0]); ++ value2 = pa_sw_volume_to_linear(wwo->volume.values[1]); ++ } else { ++ value1 = pa_sw_volume_to_linear(pa_cvolume_avg(&wwo->volume)); ++ value2 = value1; ++ } ++ ++ wleft = 0xFFFFl * value1; ++ wright = 0xFFFFl * value2; ++ ++ if (wleft > 0xFFFFl) ++ wleft = 0xFFFFl; ++ if (wright > 0xFFFFl) ++ wright = 0xFFFFl; ++ ++ *lpdwVol = (WORD)wleft + (WORD)(wright << 16); ++ ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodSetVolume [internal] ++ */ ++static DWORD wodSetVolume(WINE_WAVEINST *wwo, DWORD dwParam1) { ++ double value1, value2; ++ ++ TRACE("(%p, %08X);\n", wwo, dwParam1); ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ value1 = (double)LOWORD(dwParam1)/(double)0xFFFFl; ++ value2 = (double)HIWORD(dwParam1)/(double)0xFFFFl; ++ ++ if (wwo->sample_spec.channels == 2) { ++ wwo->volume.channels = 2; ++ wwo->volume.values[0] = pa_sw_volume_from_linear(value1); ++ wwo->volume.values[1] = pa_sw_volume_from_linear(value2); ++ } else { ++ if (value1 != value2) FIXME("Non-stereo streams can't pan!\n"); ++ wwo->volume.channels = wwo->sample_spec.channels; ++ pa_cvolume_set(&wwo->volume, wwo->volume.channels, pa_sw_volume_from_linear(value1 > value2 ? value1 : value2)); ++ } ++ ++ if (TRACE_ON(wave)) { ++ char s[PA_CVOLUME_SNPRINT_MAX]; ++ pa_cvolume_snprint(s, PA_CVOLUME_SNPRINT_MAX, &wwo->volume); ++ TRACE("%s\n", s); ++ } ++ ++ pa_threaded_mainloop_lock(PULSE_ml); ++ if (!wwo->stream || !PULSE_context || pa_context_get_state(PULSE_context) != PA_CONTEXT_READY || ++ pa_stream_get_state(wwo->stream) != PA_STREAM_READY || !pa_cvolume_valid(&wwo->volume)) { ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ return MMSYSERR_NOERROR; ++ } ++ ++ PULSE_WaitForOperation(pa_context_set_sink_input_volume(PULSE_context, ++ pa_stream_get_index(wwo->stream), &wwo->volume, ++ PULSE_ContextSuccessCallback, wwo)); ++ pa_threaded_mainloop_unlock(PULSE_ml); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodRestart [internal] ++ */ ++static DWORD wodRestart(WINE_WAVEINST *wwo) { ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ if (wwo->state == WINE_WS_PAUSED) ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_RESTARTING, 0, TRUE); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodReset [internal] ++ */ ++static DWORD wodReset(WINE_WAVEINST *wwo) { ++ if (!wwo || wwo->state == WINE_WS_FAILED) { ++ WARN("Stream instance invalid.\n"); ++ return MMSYSERR_INVALHANDLE; ++ } ++ ++ PULSE_AddRingMessage(&wwo->msgRing, WINE_WM_RESETTING, 0, TRUE); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodDevInterfaceSize [internal] ++ */ ++static DWORD wodDevInterfaceSize(UINT wDevID, LPDWORD dwParam1) { ++ ++ *dwParam1 = MultiByteToWideChar(CP_UTF8, 0, WOutDev[wDevID].interface_name, -1, NULL, 0) * sizeof(WCHAR); ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodDevInterface [internal] ++ */ ++static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2) { ++ if (dwParam2 >= MultiByteToWideChar(CP_UTF8, 0, WOutDev[wDevID].interface_name, -1, ++ NULL, 0 ) * sizeof(WCHAR)) ++ { ++ MultiByteToWideChar(CP_UTF8, 0, WOutDev[wDevID].interface_name, -1, ++ dwParam1, dwParam2 / sizeof(WCHAR)); ++ return MMSYSERR_NOERROR; ++ } ++ return MMSYSERR_INVALPARAM; ++} ++ ++DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) { ++ TRACE("(%u, %p)\n", wDevID, desc); ++ *desc = WOutDev[wDevID].ds_desc; ++ return MMSYSERR_NOERROR; ++} ++ ++/************************************************************************** ++ * wodMessage (WINEPULSE.@) ++ */ ++DWORD WINAPI PULSE_wodMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { ++ ++ switch (wMsg) { ++ ++ case DRVM_INIT: ++ case DRVM_EXIT: ++ case DRVM_ENABLE: ++ case DRVM_DISABLE: ++ return 0; ++ ++ /* WaveOut Playback related functions */ ++ case WODM_OPEN: return wodOpen (wDevID, dwUser, (LPWAVEOPENDESC)dwParam1, dwParam2); ++ case WODM_CLOSE: return wodClose ((WINE_WAVEINST*)dwUser); ++ case WODM_WRITE: return wodWrite ((WINE_WAVEINST*)dwUser, (LPWAVEHDR)dwParam1, dwParam2); ++ case WODM_PAUSE: return wodPause ((WINE_WAVEINST*)dwUser); ++ case WODM_GETPOS: return wodGetPosition ((WINE_WAVEINST*)dwUser, (LPMMTIME)dwParam1, dwParam2); ++ case WODM_BREAKLOOP: return wodBreakLoop ((WINE_WAVEINST*)dwUser); ++ case WODM_RESTART: return wodRestart ((WINE_WAVEINST*)dwUser); ++ case WODM_RESET: return wodReset ((WINE_WAVEINST*)dwUser); ++ ++ case WODM_GETVOLUME: return wodGetVolume ((WINE_WAVEINST*)dwUser, (LPDWORD)dwParam1); ++ case WODM_SETVOLUME: return wodSetVolume ((WINE_WAVEINST*)dwUser, dwParam1); ++ ++ case WODM_PREPARE: ++ case WODM_UNPREPARE: ++ ++ case WODM_GETPITCH: ++ case WODM_SETPITCH: ++ ++ case WODM_GETPLAYBACKRATE: ++ case WODM_SETPLAYBACKRATE: ++ return MMSYSERR_NOTSUPPORTED; ++ ++ /* Device enumeration, directsound and capabilities */ ++ case WODM_GETDEVCAPS: return wodGetDevCaps (wDevID, (LPWAVEOUTCAPSW)dwParam1, dwParam2); ++ case WODM_GETNUMDEVS: return wodGetNumDevs (); ++ case DRV_QUERYDEVICEINTERFACESIZE: return wodDevInterfaceSize (wDevID, (LPDWORD)dwParam1); ++ case DRV_QUERYDEVICEINTERFACE: return wodDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); ++ case DRV_QUERYDSOUNDIFACE: return MMSYSERR_NOTSUPPORTED; ++ case DRV_QUERYDSOUNDDESC: return wodDsDesc (wDevID, (PDSDRIVERDESC)dwParam1); ++ ++ default: ++ FIXME("unknown message %d!\n", wMsg); ++ } ++ return MMSYSERR_NOTSUPPORTED; ++} ++ ++#else /* !HAVE_PULSEAUDIO */ ++ ++/************************************************************************** ++ * wodMessage (WINEPULSE.@) ++ */ ++DWORD WINAPI PULSE_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, ++ DWORD dwParam1, DWORD dwParam2) { ++ FIXME("(%u, %04X, %08X, %08X, %08X):stub\n", wDevID, wMsg, dwUser, ++ dwParam1, dwParam2); ++ return MMSYSERR_NOTENABLED; ++} ++ ++#endif /* HAVE_PULSEAUDIO */ +diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec +new file mode 100644 +index 0000000..1b49460 +--- /dev/null ++++ b/dlls/winepulse.drv/winepulse.drv.spec +@@ -0,0 +1,3 @@ ++@ stdcall -private DriverProc(long long long long long long) PULSE_DriverProc ++@ stdcall -private wodMessage(long long long long long long) PULSE_wodMessage ++@ stdcall -private widMessage(long long long long long long) PULSE_widMessage +diff --git a/dlls/winepulse.drv/winepulse.h b/dlls/winepulse.drv/winepulse.h +new file mode 100644 +index 0000000..b83de5d +--- /dev/null ++++ b/dlls/winepulse.drv/winepulse.h +@@ -0,0 +1,197 @@ ++/* Definitions for PulseAudio Wine Driver ++ * ++ * Copyright 2009 Arthur Taylor ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef __WINE_CONFIG_H ++# error You must include config.h to use this header ++#endif ++ ++#if defined(HAVE_PULSEAUDIO) && !defined(__WINEPULSE_H) ++#define __WINEPULSE_H ++ ++#include "mmreg.h" ++#include "dsound.h" ++#include "dsdriver.h" ++ ++#include "ks.h" ++#include "ksmedia.h" ++#include "ksguid.h" ++ ++#include ++ ++/* state diagram for waveOut writing: ++ * ++ * +---------+-------------+---------------+---------------------------------+ ++ * | state | function | event | new state | ++ * +---------+-------------+---------------+---------------------------------+ ++ * | | open() | | STOPPED | ++ * | PAUSED | write() | | PAUSED | ++ * | STOPPED | write() | | PLAYING | ++ * | PLAYING | write() | HEADER | PLAYING | ++ * | (other) | write() | | | ++ * | (any) | pause() | PAUSING | PAUSED | ++ * | PAUSED | restart() | RESTARTING | PLAYING (if no thrd => STOPPED) | ++ * | (any) | reset() | RESETTING | STOPPED | ++ * | (any) | close() | CLOSING | CLOSED | ++ * +---------+-------------+---------------+---------------------------------+ ++ */ ++ ++/* states of the playing device */ ++#define WINE_WS_PLAYING 1 ++#define WINE_WS_PAUSED 2 ++#define WINE_WS_STOPPED 3 ++#define WINE_WS_CLOSED 4 ++#define WINE_WS_FAILED 5 ++ ++#define PULSE_ALL_FORMATS \ ++ WAVE_FORMAT_1M08 | /* Mono 11025Hz 8-bit */\ ++ WAVE_FORMAT_1M16 | /* Mono 11025Hz 16-bit */\ ++ WAVE_FORMAT_1S08 | /* Stereo 11025Hz 8-bit */\ ++ WAVE_FORMAT_1S16 | /* Stereo 11025Hz 16-bit */\ ++ WAVE_FORMAT_2M08 | /* Mono 22050Hz 8-bit */\ ++ WAVE_FORMAT_2M16 | /* Mono 22050Hz 16-bit */\ ++ WAVE_FORMAT_2S08 | /* Stereo 22050Hz 8-bit */\ ++ WAVE_FORMAT_2S16 | /* Stereo 22050Hz 16-bit */\ ++ WAVE_FORMAT_4M08 | /* Mono 44100Hz 8-bit */\ ++ WAVE_FORMAT_4M16 | /* Mono 44100Hz 16-bit */\ ++ WAVE_FORMAT_4S08 | /* Stereo 44100Hz 8-bit */\ ++ WAVE_FORMAT_4S16 | /* Stereo 44100Hz 16-bit */\ ++ WAVE_FORMAT_48M08 | /* Mono 48000Hz 8-bit */\ ++ WAVE_FORMAT_48S08 | /* Stereo 48000Hz 8-bit */\ ++ WAVE_FORMAT_48M16 | /* Mono 48000Hz 16-bit */\ ++ WAVE_FORMAT_48S16 | /* Stereo 48000Hz 16-bit */\ ++ WAVE_FORMAT_96M08 | /* Mono 96000Hz 8-bit */\ ++ WAVE_FORMAT_96S08 | /* Stereo 96000Hz 8-bit */\ ++ WAVE_FORMAT_96M16 | /* Mono 96000Hz 16-bit */\ ++ WAVE_FORMAT_96S16 /* Stereo 96000Hz 16-bit */ ++ ++/* events to be sent to device */ ++enum win_wm_message { ++ WINE_WM_PAUSING = WM_USER + 1, WINE_WM_RESTARTING, WINE_WM_RESETTING, WINE_WM_HEADER, ++ WINE_WM_BREAKLOOP, WINE_WM_CLOSING, WINE_WM_STARTING, WINE_WM_STOPPING, WINE_WM_XRUN, WINE_WM_FEED ++}; ++ ++typedef struct { ++ enum win_wm_message msg; /* message identifier */ ++ DWORD param; /* parameter for this message */ ++ HANDLE hEvent; /* if message is synchronous, handle of event for synchro */ ++} PULSE_MSG; ++ ++/* implement an in-process message ring for better performance ++ * (compared to passing thru the server) ++ * this ring will be used by the input (resp output) record (resp playback) routine ++ */ ++typedef struct { ++ PULSE_MSG * messages; ++ int ring_buffer_size; ++ int msg_tosave; ++ int msg_toget; ++/* Either pipe or event is used, but that is defined in pulse.c, ++ * since this is a global header we define both here */ ++ int msg_pipe[2]; ++ HANDLE msg_event; ++ CRITICAL_SECTION msg_crst; ++} PULSE_MSG_RING; ++ ++typedef struct WINE_WAVEDEV WINE_WAVEDEV; ++typedef struct WINE_WAVEINST WINE_WAVEINST; ++ ++/* Per-playback/record device */ ++struct WINE_WAVEDEV { ++ char interface_name[MAXPNAMELEN * 2]; ++ char *device_name; ++ pa_cvolume volume; ++ ++ union { ++ WAVEOUTCAPSW out; ++ WAVEINCAPSW in; ++ } caps; ++ ++ /* DirectSound stuff */ ++ DSDRIVERDESC ds_desc; ++ DSDRIVERCAPS ds_caps; ++}; ++ ++/* Per-playback/record instance */ ++struct WINE_WAVEINST { ++ INT state; /* one of the WINE_WS_ manifest constants */ ++ WAVEOPENDESC waveDesc; ++ WORD wFlags; ++ ++ /* PulseAudio specific data */ ++ pa_stream *stream; /* The PulseAudio stream */ ++ const pa_timing_info *timing_info; /* The timing info structure for the stream */ ++ pa_sample_spec sample_spec; /* Sample spec of this stream / device */ ++ pa_cvolume volume; /* Software volume of the stream */ ++ pa_buffer_attr buffer_attr; /* Buffer attribute, may not be used */ ++ ++ /* waveIn / waveOut wavaHdr */ ++ LPWAVEHDR lpQueuePtr; /* Start of queued WAVEHDRs (waiting to be notified) */ ++ LPWAVEHDR lpPlayPtr; /* Start of not yet fully written buffers */ ++ DWORD dwPartialOffset; /* Offset of not yet written bytes in lpPlayPtr */ ++ LPWAVEHDR lpLoopPtr; /* Pointer of first buffer in loop, if any */ ++ DWORD dwLoops; /* Private copy of loop counter */ ++ DWORD dwLastReset; /* When the last reset occured, as pa stream time doesn't reset */ ++ ++ /* waveIn specific */ ++ const void *buffer; /* Pointer to the latest data fragment for recording streams */ ++ DWORD buffer_length; /* How large the latest data fragment is */ ++ DWORD buffer_read_offset; /* How far into latest data fragment we last read */ ++ ++ /* Thread communication and synchronization stuff */ ++ HANDLE hStartUpEvent; ++ HANDLE hThread; ++ DWORD dwThreadID; ++ PULSE_MSG_RING msgRing; ++}; ++ ++/* We establish one context per instance, so make it global to the lib */ ++pa_context *PULSE_context; /* Connection Context */ ++pa_threaded_mainloop *PULSE_ml; /* PA Runtime information */ ++ ++/* WaveIn / WaveOut devices */ ++WINE_WAVEDEV *WOutDev; ++WINE_WAVEDEV *WInDev; ++DWORD PULSE_WodNumDevs; ++DWORD PULSE_WidNumDevs; ++ ++/* pulse.c: PulseAudio Async Callbacks */ ++void PULSE_StreamRequestCallback(pa_stream *s, size_t nbytes, void *userdata); ++void PULSE_StreamSuccessCallback(pa_stream *s, int success, void *userdata); ++void PULSE_StreamStateCallback(pa_stream *s, void *userdata); ++void PULSE_StreamUnderflowCallback(pa_stream *s, void *userdata); ++void PULSE_StreamSuspendedCallback(pa_stream *s, void *userdata); ++void PULSE_StreamMovedCallback(pa_stream *s, void *userdata); ++void PULSE_ContextSuccessCallback(pa_context *c, int success, void *userdata); ++ ++/* pulse.c: General Functions */ ++void PULSE_WaitForOperation(pa_operation *o); ++BOOL PULSE_SetupFormat(LPWAVEFORMATEX wf, pa_sample_spec *ss); ++HRESULT PULSE_UsecToMMTime(pa_usec_t time, LPMMTIME lpTime, const pa_sample_spec *ss); ++ ++/* pulse.c: Message Ring */ ++int PULSE_InitRingMessage(PULSE_MSG_RING* omr); ++int PULSE_DestroyRingMessage(PULSE_MSG_RING* omr); ++void PULSE_ResetRingMessage(PULSE_MSG_RING* omr); ++void PULSE_WaitRingMessage(PULSE_MSG_RING* omr, DWORD sleep); ++int PULSE_AddRingMessage(PULSE_MSG_RING* omr, enum win_wm_message msg, DWORD param, BOOL wait); ++int PULSE_RetrieveRingMessage(PULSE_MSG_RING* omr, enum win_wm_message *msg, DWORD *param, HANDLE *hEvent); ++ ++/* pulse.c: Tracing */ ++const char * PULSE_getCmdString(enum win_wm_message msg); ++#endif --- wine1.2-1.1.43.orig/debian/patches/dibeng-0015.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0015.patch @@ -0,0 +1,20 @@ +dib engine: update winedib.drv Makefile.in to build on 1.1.41 + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/Makefile.in | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + + +diff --git a/dlls/winedib.drv/Makefile.in b/dlls/winedib.drv/Makefile.in +index a29edf0..7544c0d 100644 +--- a/dlls/winedib.drv/Makefile.in ++++ b/dlls/winedib.drv/Makefile.in +@@ -38,4 +38,3 @@ C_SRCS = \ + + @MAKE_DLL_RULES@ + +-@DEPENDENCIES@ # everything below this line is overwritten by make depend --- wine1.2-1.1.43.orig/debian/patches/ddraw.patch +++ wine1.2-1.1.43/debian/patches/ddraw.patch @@ -0,0 +1,50 @@ +diff -urN wine-1.1.42/dlls/ddraw.bak/ddraw.c wine-1.1.42/dlls/ddraw/ddraw.c +--- wine-1.1.42/dlls/ddraw.bak/ddraw.c 2010-04-02 18:43:45.000000000 +0100 ++++ wine-1.1.42/dlls/ddraw/ddraw.c 2010-04-26 21:07:55.654427591 +0100 +@@ -35,6 +35,7 @@ + #include "winbase.h" + #include "winerror.h" + #include "wingdi.h" ++#include "winreg.h" + #include "wine/exception.h" + + #include "ddraw.h" +@@ -45,6 +46,8 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(ddraw); + ++#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1') ++ + static BOOL IDirectDrawImpl_DDSD_Match(const DDSURFACEDESC2* requested, const DDSURFACEDESC2* provided); + static HRESULT IDirectDrawImpl_AttachD3DDevice(IDirectDrawImpl *This, IDirectDrawSurfaceImpl *primary); + static HRESULT IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This, DDSURFACEDESC2 *pDDSD, IDirectDrawSurfaceImpl **ppSurf, UINT level); +@@ -485,6 +488,20 @@ + !(This->devicewindow) && + (hwnd != window) ) + { ++ BYTE buffer[32]; ++ DWORD size = sizeof(buffer); ++ HKEY hkey = 0; ++ HWND drawwin = hwnd; ++ /* @@ Wine registry key: HKCU\Software\Wine\Direct3D */ ++ if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Direct3D", &hkey)) { ++ if (!RegQueryValueExA( hkey, "DirectDrawDesktopHack", 0, NULL, buffer, &size)) { ++ if ( IS_OPTION_TRUE( buffer[0] ) ) { ++ TRACE("Enabling DirectDrawDesktopHack hack\n"); ++ drawwin = GetDesktopWindow(); ++ } ++ } ++ } ++ + HRESULT hr = IWineD3DDevice_AcquireFocusWindow(This->wineD3DDevice, hwnd); + if (FAILED(hr)) + { +@@ -492,7 +509,7 @@ + LeaveCriticalSection(&ddraw_cs); + return hr; + } +- This->dest_window = hwnd; ++ This->dest_window = drawwin; + } + } + else if(cooplevel & DDSCL_EXCLUSIVE) --- wine1.2-1.1.43.orig/debian/patches/dibeng-0013.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0013.patch @@ -0,0 +1,118 @@ +DIB Engine:dont use now missing winex11.drv BitBlt and PatBlt funcs + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/bitblt.c | 25 ++++++++++++++++++------- + dlls/winedib.drv/dibdrv.h | 1 - + dlls/winedib.drv/dibdrv_gdi32.h | 2 +- + dlls/winedib.drv/pen_brush.c | 4 ++-- + 4 files changed, 21 insertions(+), 11 deletions(-) + + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index 5fcc9e0..680e1fd 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -512,8 +512,8 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + int devXSrc, devWidth; + int devYSrc, devHeight, zeroYSrc; + +-CheckMapping(__FUNCTION__, "DEST", physDevDst); +-CheckMapping(__FUNCTION__, "SOURCE",physDevSrc); ++// CheckMapping(__FUNCTION__, "DEST", physDevDst); ++// CheckMapping(__FUNCTION__, "SOURCE",physDevSrc); + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, width:%d, height:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, rop:%08x\n", + physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevDst->physBitmap) : "", + xDst, yDst, width, height, +@@ -631,8 +631,12 @@ CheckMapping(__FUNCTION__, "SOURCE",physDevSrc); + if(!physDevSrc || !physDevSrc->hasDIB) + { + /* source is null or has also a DDB, no need to convert anything */ +- res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, +- physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, ySrc, rop); ++ if(_DIBDRV_GetDisplayDriver()->pBitBlt) ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, ySrc, rop); ++ else ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, ySrc, width, height, rop); + } + else + { +@@ -668,8 +672,12 @@ CheckMapping(__FUNCTION__, "SOURCE",physDevSrc); + zeroYSrc = 0; + _DIBDRV_Position_ds2ws(physDevSrc, &dummy, &zeroYSrc); + +- res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, +- physDevSrc->X11PhysDev, xSrc, zeroYSrc, rop); ++ if(_DIBDRV_GetDisplayDriver()->pBitBlt) ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc->X11PhysDev, xSrc, zeroYSrc, rop); ++ else ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc->X11PhysDev, xSrc, zeroYSrc, width, height, rop); + SelectObject(physDevSrc->hdc, dib); + DeleteObject(ddb); + noBlt3: +@@ -952,7 +960,10 @@ BOOL DIBDRV_PatBlt( DIBDRVPHYSDEV *physDev, INT left, INT top, INT width, INT he + else + { + /* DDB selected in, use X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pPatBlt(physDev->X11PhysDev, left, top, width, height, rop); ++ if(_DIBDRV_GetDisplayDriver()->pPatBlt) ++ res = _DIBDRV_GetDisplayDriver()->pPatBlt(physDev->X11PhysDev, left, top, width, height, rop); ++ else ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDev->X11PhysDev, left, top, width, height, 0, left, top, width, height, rop); + } + return res; + } +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 6b72254..72d6b52 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -33,7 +33,6 @@ + #include "wine/debug.h" + #include "wingdi.h" + #include "winreg.h" +-#include "wine/winbase16.h" /* GlobalLock16 */ + + #include "freetype.h" + +diff --git a/dlls/winedib.drv/dibdrv_gdi32.h b/dlls/winedib.drv/dibdrv_gdi32.h +index 8e4eb05..4f14e5a 100644 +--- a/dlls/winedib.drv/dibdrv_gdi32.h ++++ b/dlls/winedib.drv/dibdrv_gdi32.h +@@ -66,7 +66,7 @@ typedef struct tagDC_FUNCS + BOOL (CDECL *pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT); + BOOL (CDECL *pGetDCOrgEx)(PHYSDEV,LPPOINT); + UINT (CDECL *pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*); +- INT (CDECL *pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT); ++ INT (CDECL *pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT); + INT (CDECL *pGetDeviceCaps)(PHYSDEV,INT); + BOOL (CDECL *pGetDeviceGammaRamp)(PHYSDEV,LPVOID); + BOOL (CDECL *pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR); +diff --git a/dlls/winedib.drv/pen_brush.c b/dlls/winedib.drv/pen_brush.c +index 32d50fb..1d9b51a 100644 +--- a/dlls/winedib.drv/pen_brush.c ++++ b/dlls/winedib.drv/pen_brush.c +@@ -498,7 +498,7 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + } + + /* gets brush DIB's pointer */ +- bmi = GlobalLock16(logbrush.lbHatch); ++ bmi = GlobalLock((HGLOBAL)logbrush.lbHatch); + + /* initializes a temporary DIB with brush's one */ + if(!_DIBDRVBITMAP_InitFromBitmapinfo(&src, bmi, NULL)) +@@ -525,7 +525,7 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + + err: + /* frees brush's DIB pointer */ +- GlobalUnlock16(logbrush.lbHatch); ++ GlobalUnlock((HGLOBAL)logbrush.lbHatch); + + break; + } --- wine1.2-1.1.43.orig/debian/patches/winepulse-0.35-configure.ac.patch +++ wine1.2-1.1.43/debian/patches/winepulse-0.35-configure.ac.patch @@ -0,0 +1,60 @@ +diff --git a/configure.ac b/configure.ac +index f823045..583f9c1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -68,6 +68,7 @@ AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG]), + [if test "x$withval" = "xno"; then ac_cv_header_png_h=no; fi]) + AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), + [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi]) ++AC_ARG_WITH(pulse, AC_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) + AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) + AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF]), + [if test "x$withval" = "xno"; then ac_cv_header_tiffio_h=no; fi]) +@@ -1359,6 +1360,30 @@ then + CFLAGS="$save_CFLAGS" + fi + ++dnl **** Check for PulseAudio **** ++AC_SUBST(PULSELIBS,"") ++AC_SUBST(PULSECFLAGS,"") ++if test "x$with_pulse" != "xno"; ++then ++ ac_save_CPPFLAGS="$CPPFLAGS" ++ if test "$PKG_CONFIG" != "false"; ++ then ++ ac_pulse_libs="`$PKG_CONFIG --libs libpulse 2>/dev/null`" ++ ac_pulse_cflags="`$PKG_CONFIG --cflags libpulse 2>/dev/null`" ++ ++ CPPFLAGS="$CPPFLAGS $ac_pulse_cflags" ++ AC_CHECK_HEADERS(pulse/pulseaudio.h, ++ [AC_CHECK_LIB(pulse, pa_stream_is_corked, ++ [AC_DEFINE(HAVE_PULSEAUDIO, 1, [Define if you have pulseaudio]) ++ PULSELIBS="$ac_pulse_libs" ++ PULSECFLAGS="$ac_pulse_cflags"],,$ac_pulse_libs) ++ ]) ++ fi ++ CPPFLAGS="$ac_save_CPPFLAGS" ++fi ++WINE_WARNING_WITH(pulse, [test "$ac_cv_lib_pulse_pa_stream_is_corked" != "yes"], ++ [libpulse ${notice_platform}development files not found or too old, Pulse won't be supported.]) ++ + dnl **** Check for ALSA 1.x **** + AC_SUBST(ALSALIBS,"") + if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes" +@@ -1526,7 +1551,7 @@ dnl **** Check for libodbc **** + WINE_CHECK_SONAME(odbc,SQLConnect,,[AC_DEFINE_UNQUOTED(SONAME_LIBODBC,["libodbc.$LIBEXT"])]) + + dnl **** Check for any sound system **** +-if test "x$ALSALIBS$AUDIOIOLIBS$COREAUDIO$NASLIBS$ESDLIBS$ac_cv_lib_soname_jack" = "x" -a \ ++if test "x$ALSALIBS$AUDIOIOLIBS$COREAUDIO$NASLIBS$ESDLIBS$PULSELIBS$ac_cv_lib_soname_jack" = "x" -a \ + "$ac_cv_header_sys_soundcard_h" != "yes" -a \ + "$ac_cv_header_machine_soundcard_h" != "yes" -a \ + "$ac_cv_header_soundcard_h" != "yes" -a \ +@@ -2618,6 +2643,7 @@ WINE_CONFIG_DLL(winenas.drv) + WINE_CONFIG_DLL(wineoss.drv) + WINE_CONFIG_DLL(wineps.drv) + WINE_CONFIG_DLL(wineps16.drv16,enable_win16) ++WINE_CONFIG_DLL(winepulse.drv) + WINE_CONFIG_DLL(winequartz.drv) + WINE_CONFIG_DLL(winex11.drv) + WINE_CONFIG_DLL(wing.dll16,enable_win16) --- wine1.2-1.1.43.orig/debian/patches/wine-hacks-configure.patch +++ wine1.2-1.1.43/debian/patches/wine-hacks-configure.patch @@ -0,0 +1,154 @@ +diff -urN wine-1.1.43.orig/configure wine-1.1.43/configure +--- wine-1.1.43.orig/configure 2010-04-16 18:53:23.000000000 +0100 ++++ wine-1.1.43/configure 2010-04-27 01:11:18.000000000 +0100 +@@ -618,6 +618,8 @@ + CUPSINCL + AUDIOIOLIBS + ALSALIBS ++PULSECFLAGS ++PULSELIBS + ESDLIBS + ESDINCL + ESDCONFIG +@@ -791,6 +793,7 @@ + with_oss + with_png + with_pthread ++with_pulse + with_sane + with_tiff + with_v4l +@@ -1478,6 +1481,7 @@ + --without-oss do not use the OSS sound support + --without-png do not use PNG + --without-pthread do not use the pthread library ++ --without-pulse do not use PulseAudio sound support + --without-sane do not use SANE (scanner support) + --without-tiff do not use TIFF + --without-v4l do not use v4l1 (v4l support) +@@ -2653,6 +2657,12 @@ + fi + + ++# Check whether --with-pulse was given. ++if test "${with_pulse+set}" = set; then : ++ withval=$with_pulse; ++fi ++ ++ + # Check whether --with-sane was given. + if test "${with_sane+set}" = set; then : + withval=$with_sane; +@@ -10432,6 +10442,87 @@ + CFLAGS="$save_CFLAGS" + fi + ++PULSELIBS="" ++ ++PULSECFLAGS="" ++ ++if test "x$with_pulse" != "xno"; ++then ++ ac_save_CPPFLAGS="$CPPFLAGS" ++ if test "$PKG_CONFIG" != "false"; ++ then ++ ac_pulse_libs="`$PKG_CONFIG --libs libpulse 2>/dev/null`" ++ ac_pulse_cflags="`$PKG_CONFIG --cflags libpulse 2>/dev/null`" ++ ++ CPPFLAGS="$CPPFLAGS $ac_pulse_cflags" ++ for ac_header in pulse/pulseaudio.h ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "pulse/pulseaudio.h" "ac_cv_header_pulse_pulseaudio_h" "$ac_includes_default" ++if test "x$ac_cv_header_pulse_pulseaudio_h" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_PULSE_PULSEAUDIO_H 1 ++_ACEOF ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pa_stream_is_corked in -lpulse" >&5 ++$as_echo_n "checking for pa_stream_is_corked in -lpulse... " >&6; } ++if test "${ac_cv_lib_pulse_pa_stream_is_corked+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lpulse $ac_pulse_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 pa_stream_is_corked (); ++int ++main () ++{ ++return pa_stream_is_corked (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_pulse_pa_stream_is_corked=yes ++else ++ ac_cv_lib_pulse_pa_stream_is_corked=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_pulse_pa_stream_is_corked" >&5 ++$as_echo "$ac_cv_lib_pulse_pa_stream_is_corked" >&6; } ++if test "x$ac_cv_lib_pulse_pa_stream_is_corked" = x""yes; then : ++ ++$as_echo "#define HAVE_PULSEAUDIO 1" >>confdefs.h ++ ++ PULSELIBS="$ac_pulse_libs" ++ PULSECFLAGS="$ac_pulse_cflags" ++fi ++ ++ ++fi ++ ++done ++ ++ fi ++ CPPFLAGS="$ac_save_CPPFLAGS" ++fi ++if test "$ac_cv_lib_pulse_pa_stream_is_corked" != "yes"; then : ++ case "x$with_pulse" in ++ x) as_fn_append wine_warnings "|libpulse ${notice_platform}development files not found or too old, Pulse won't be supported." ;; ++ xno) ;; ++ *) as_fn_error "libpulse ${notice_platform}development files not found or too old, Pulse won't be supported. ++This is an error since --with-pulse was requested." "$LINENO" 5 ;; ++esac ++fi ++ + ALSALIBS="" + + if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes" +@@ -11623,7 +11714,7 @@ + + fi + +-if test "x$ALSALIBS$AUDIOIOLIBS$COREAUDIO$NASLIBS$ESDLIBS$ac_cv_lib_soname_jack" = "x" -a \ ++if test "x$ALSALIBS$AUDIOIOLIBS$COREAUDIO$NASLIBS$ESDLIBS$PULSELIBS$ac_cv_lib_soname_jack" = "x" -a \ + "$ac_cv_header_sys_soundcard_h" != "yes" -a \ + "$ac_cv_header_machine_soundcard_h" != "yes" -a \ + "$ac_cv_header_soundcard_h" != "yes" -a \ +@@ -14680,6 +14771,7 @@ + wine_fn_config_dll winecoreaudio.drv enable_winecoreaudio_drv + wine_fn_config_lib winecrt0 + wine_fn_config_dll wined3d enable_wined3d wined3d ++wine_fn_config_dll winedib.drv enable_winedib_drv + wine_fn_config_dll wineesd.drv enable_wineesd_drv + wine_fn_config_dll winejack.drv enable_winejack_drv + wine_fn_config_dll winejoystick.drv enable_winejoystick_drv +@@ -14689,6 +14781,7 @@ + wine_fn_config_dll wineoss.drv enable_wineoss_drv + wine_fn_config_dll wineps.drv enable_wineps_drv + wine_fn_config_dll wineps16.drv16 enable_win16 ++wine_fn_config_dll winepulse.drv enable_winepulse_drv + wine_fn_config_dll winequartz.drv enable_winequartz_drv + wine_fn_config_dll winex11.drv enable_winex11_drv + wine_fn_config_dll wing.dll16 enable_win16 --- wine1.2-1.1.43.orig/debian/patches/dibeng-0014.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0014.patch @@ -0,0 +1,105 @@ +DIB Engine: fix vertically mirrored images caused by GetObject() changes + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/convert.c | 18 ++++++++++-------- + dlls/winedib.drv/dibdrv.h | 3 +++ + dlls/winedib.drv/dibdrvbitmap.c | 5 +++++ + 3 files changed, 18 insertions(+), 8 deletions(-) + + +diff --git a/dlls/winedib.drv/convert.c b/dlls/winedib.drv/convert.c +index 8ee6ecd..5fc7eea 100644 +--- a/dlls/winedib.drv/convert.c ++++ b/dlls/winedib.drv/convert.c +@@ -51,6 +51,7 @@ HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int sca + HDC tmpHdc; + HBITMAP tmpBmp; + int res; ++ DIBDRVBITMAP *physBitmap; + + /* gets DIBSECTION data from source DIB */ + if(GetObjectW(srcBmp, sizeof(DIBSECTION), &ds) != sizeof(DIBSECTION)) +@@ -65,19 +66,20 @@ HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int sca + bits = ds.dsBm.bmBits; + stride = ((dibWidth * ds.dsBmih.biBitCount +31) &~31) / 8; + +- /* adjust bits to point at needed starting stripe */ +- if(dibHeight < 0) ++ /* get physical bitmap -- needed for topdown flag */ ++ if( (physBitmap = _BITMAPLIST_Get(srcBmp)) == NULL) + { ++ ERR("Couldn't retrieve physical bitmap\n"); ++ return 0; ++ } ++ topDown = physBitmap->topdown; ++ ++ /* adjust bits to point at needed starting stripe */ ++ if(topDown) + /* top-down DIB */ +- topDown = TRUE; +- dibHeight = -dibHeight; + bits = (BYTE *)bits + startScan * stride; +- } + else +- { +- topDown = FALSE; + bits = (BYTE *)bits + (dibHeight - startScan - scanLines) * stride; +- } + + /* if requested part is out of source bitmap, returns 0 */ + if(startScan >= dibHeight) +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 72d6b52..e041e35 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -138,6 +138,9 @@ typedef struct _DIBDRVBITMAP + { + /* bitmap format of dib */ + DIBFORMAT format; ++ ++ /* topdown flag */ ++ BOOL topdown; + + /* pointer to top left corner of bitmap */ + void *bits; +diff --git a/dlls/winedib.drv/dibdrvbitmap.c b/dlls/winedib.drv/dibdrvbitmap.c +index eb7d1e2..1b2c959 100644 +--- a/dlls/winedib.drv/dibdrvbitmap.c ++++ b/dlls/winedib.drv/dibdrvbitmap.c +@@ -202,6 +202,7 @@ BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, c + { + /* top-down dib */ + dib->height = -dib->height; ++ dib->topdown = TRUE; + } + else + { +@@ -209,6 +210,7 @@ BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, c + /* data->bits always points to the top-left corner and the stride is -ve */ + dib->bits = (BYTE*)dib->bits + (dib->height - 1) * dib->stride; + dib->stride = -dib->stride; ++ dib->topdown = FALSE; + } + + /* gets and stores bitmap format */ +@@ -427,6 +429,8 @@ BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *s + + dib->lightColor = src->lightColor; + ++ dib->topdown = src->topdown; ++ + if(copy) + { + int size = dib->height*abs(dib->stride); +@@ -496,6 +500,7 @@ BOOL _DIBDRVBITMAP_CreateFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP + dib->stride = ((width * dib->bitCount +31) &~31) / 8; + if(src->stride < 0) + dib->stride = -dib->stride; ++ dib->topdown = src->topdown; + + /* allocates bits for newly created DIB */ + if(!(dib->bits = HeapAlloc(GetProcessHeap(), 0, height*abs(dib->stride)))) --- wine1.2-1.1.43.orig/debian/patches/winepulse-0.34-winecfg.patch +++ wine1.2-1.1.43/debian/patches/winepulse-0.34-winecfg.patch @@ -0,0 +1,313 @@ +diff --git a/programs/winecfg/Bg.rc b/programs/winecfg/Bg.rc +index 5555ad2..29ff717 100644 +--- a/programs/winecfg/Bg.rc ++++ b/programs/winecfg/Bg.rc +@@ -276,6 +276,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Basic" + IDS_ACCEL_EMULATION "Emulation" ++ IDS_DRIVER_PULSE "PulseAudio Driver" + IDS_DRIVER_ALSA "ALSA Driver" + IDS_DRIVER_ESOUND "EsounD Driver" + IDS_DRIVER_OSS "OSS Driver" +diff --git a/programs/winecfg/Cs.rc b/programs/winecfg/Cs.rc +index f3116d7..2a06d88 100644 +--- a/programs/winecfg/Cs.rc ++++ b/programs/winecfg/Cs.rc +@@ -276,6 +276,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standardní" + IDS_ACCEL_BASIC "Základní" + IDS_ACCEL_EMULATION "Emulace" ++ IDS_DRIVER_PULSE "Ovladaè PulseAudio" + IDS_DRIVER_ALSA "Ovladaè ALSA" + IDS_DRIVER_ESOUND "Ovladaè EsounD" + IDS_DRIVER_OSS "Ovladaè OSS" +diff --git a/programs/winecfg/Da.rc b/programs/winecfg/Da.rc +index 64e022b..e6caea3 100644 +--- a/programs/winecfg/Da.rc ++++ b/programs/winecfg/Da.rc +@@ -270,6 +270,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Grundlæggende" + IDS_ACCEL_EMULATION "Emuléring" ++ IDS_DRIVER_PULSE "PulseAudio-driver" + IDS_DRIVER_ALSA "ALSA-driver" + IDS_DRIVER_ESOUND "EsounD-driver" + IDS_DRIVER_OSS "OSS-driver" +diff --git a/programs/winecfg/De.rc b/programs/winecfg/De.rc +index fa5bbe5..eda4e2b 100644 +--- a/programs/winecfg/De.rc ++++ b/programs/winecfg/De.rc +@@ -282,6 +282,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Einfach" + IDS_ACCEL_EMULATION "Emulation" ++ IDS_DRIVER_PULSE "PulseAudio-Treiber" + IDS_DRIVER_ALSA "ALSA-Treiber" + IDS_DRIVER_ESOUND "EsounD-Treiber" + IDS_DRIVER_OSS "OSS-Treiber" +diff --git a/programs/winecfg/En.rc b/programs/winecfg/En.rc +index 490314a..3e669cd 100644 +--- a/programs/winecfg/En.rc ++++ b/programs/winecfg/En.rc +@@ -282,6 +282,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Basic" + IDS_ACCEL_EMULATION "Emulation" ++ IDS_DRIVER_PULSE "PulseAudio Driver" + IDS_DRIVER_ALSA "ALSA Driver" + IDS_DRIVER_ESOUND "EsounD Driver" + IDS_DRIVER_OSS "OSS Driver" +diff --git a/programs/winecfg/Es.rc b/programs/winecfg/Es.rc +index 423c783..8534cfa 100644 +--- a/programs/winecfg/Es.rc ++++ b/programs/winecfg/Es.rc +@@ -270,6 +270,7 @@ BEGIN + IDS_ACCEL_STANDARD "Estándar" + IDS_ACCEL_BASIC "Básica" + IDS_ACCEL_EMULATION "Emulación" ++ IDS_DRIVER_PULSE "Manejador PulseAudio" + IDS_DRIVER_ALSA "Manejador ALSA" + IDS_DRIVER_ESOUND "Manejador EsounD" + IDS_DRIVER_OSS "Manejador OSS" +diff --git a/programs/winecfg/Fi.rc b/programs/winecfg/Fi.rc +index 957b87d..1eb62d1 100644 +--- a/programs/winecfg/Fi.rc ++++ b/programs/winecfg/Fi.rc +@@ -270,6 +270,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Basic" + IDS_ACCEL_EMULATION "Emulation" ++ IDS_DRIVER_PULSE "PulseAudio Driver" + IDS_DRIVER_ALSA "ALSA Driver" + IDS_DRIVER_ESOUND "EsounD Driver" + IDS_DRIVER_OSS "OSS Driver" +diff --git a/programs/winecfg/Fr.rc b/programs/winecfg/Fr.rc +index f84cff6..045d93f 100644 +--- a/programs/winecfg/Fr.rc ++++ b/programs/winecfg/Fr.rc +@@ -284,6 +284,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Basique" + IDS_ACCEL_EMULATION "Émulation" ++ IDS_DRIVER_PULSE "Pilote PulseAudio" + IDS_DRIVER_ALSA "Pilote ALSA" + IDS_DRIVER_ESOUND "Pilote EsounD" + IDS_DRIVER_OSS "Pilote OSS" +diff --git a/programs/winecfg/Hu.rc b/programs/winecfg/Hu.rc +index 7c4e4fc..654b524 100644 +--- a/programs/winecfg/Hu.rc ++++ b/programs/winecfg/Hu.rc +@@ -270,6 +270,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Basic" + IDS_ACCEL_EMULATION "Emulation" ++ IDS_DRIVER_PULSE "PulseAudio Driver" + IDS_DRIVER_ALSA "ALSA Driver" + IDS_DRIVER_ESOUND "EsounD Driver" + IDS_DRIVER_OSS "OSS Driver" +diff --git a/programs/winecfg/It.rc b/programs/winecfg/It.rc +index 29deea2..e328a19 100644 +--- a/programs/winecfg/It.rc ++++ b/programs/winecfg/It.rc +@@ -284,6 +284,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Base" + IDS_ACCEL_EMULATION "Emulazione" ++ IDS_DRIVER_PULSE "Driver PulseAudio" + IDS_DRIVER_ALSA "Driver ALSA" + IDS_DRIVER_ESOUND "Driver Esound" + IDS_DRIVER_OSS "Driver OSS" +diff --git a/programs/winecfg/Ja.rc b/programs/winecfg/Ja.rc +index ff03564..94d7c62 100644 +--- a/programs/winecfg/Ja.rc ++++ b/programs/winecfg/Ja.rc +@@ -285,6 +285,7 @@ BEGIN + IDS_ACCEL_STANDARD "標準" + IDS_ACCEL_BASIC "基本" + IDS_ACCEL_EMULATION "エミュレーション" ++ IDS_DRIVER_PULSE "PulseAudio ドライãƒ" + IDS_DRIVER_ALSA "ALSA ドライãƒ" + IDS_DRIVER_ESOUND "EsounD ドライãƒ" + IDS_DRIVER_OSS "OSS ドライãƒ" +diff --git a/programs/winecfg/Ko.rc b/programs/winecfg/Ko.rc +index b30ce87..36dabd2 100644 +--- a/programs/winecfg/Ko.rc ++++ b/programs/winecfg/Ko.rc +@@ -285,6 +285,7 @@ BEGIN + IDS_ACCEL_STANDARD "Ç¥ÁØ" + IDS_ACCEL_BASIC "±âº»" + IDS_ACCEL_EMULATION "¾Ö¹Ä·¹À̼Ç" ++ IDS_DRIVER_PULSE "PulseAudio µå¶óÀ̹ö" + IDS_DRIVER_ALSA "ALSA µå¶óÀ̹ö" + IDS_DRIVER_ESOUND "EsounD µå¶óÀ̹ö" + IDS_DRIVER_OSS "OSS µå¶óÀ̹ö" +diff --git a/programs/winecfg/Lt.rc b/programs/winecfg/Lt.rc +index 1a9d0fa..ff7a586 100644 +--- a/programs/winecfg/Lt.rc ++++ b/programs/winecfg/Lt.rc +@@ -283,6 +283,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standartinis" + IDS_ACCEL_BASIC "Bazinis" + IDS_ACCEL_EMULATION "Emuliacija" ++ IDS_DRIVER_PULSE "PulseAudio tvarkyklÄ—" + IDS_DRIVER_ALSA "ALSA tvarkyklÄ—" + IDS_DRIVER_ESOUND "EsounD tvarkyklÄ—" + IDS_DRIVER_OSS "OSS tvarkyklÄ—" +diff --git a/programs/winecfg/Nl.rc b/programs/winecfg/Nl.rc +index 5783033..431872f 100644 +--- a/programs/winecfg/Nl.rc ++++ b/programs/winecfg/Nl.rc +@@ -283,6 +283,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standaard" + IDS_ACCEL_BASIC "Eenvoudig" + IDS_ACCEL_EMULATION "Emulatie" ++ IDS_DRIVER_PULSE "PulseAudio Stuurprogramma" + IDS_DRIVER_ALSA "ALSA Stuurprogramma" + IDS_DRIVER_ESOUND "EsounD Stuurprogramma" + IDS_DRIVER_OSS "OSS Stuurprogramma" +diff --git a/programs/winecfg/No.rc b/programs/winecfg/No.rc +index 13a62f4..7e66a3a 100644 +--- a/programs/winecfg/No.rc ++++ b/programs/winecfg/No.rc +@@ -283,6 +283,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Grunnleggende" + IDS_ACCEL_EMULATION "Emulering" ++ IDS_DRIVER_PULSE "PulseAudio-driver" + IDS_DRIVER_ALSA "ALSA-driver" + IDS_DRIVER_ESOUND "EsounD-driver" + IDS_DRIVER_OSS "OSS-driver" +diff --git a/programs/winecfg/Pl.rc b/programs/winecfg/Pl.rc +index 9422f34..eeca25c 100644 +--- a/programs/winecfg/Pl.rc ++++ b/programs/winecfg/Pl.rc +@@ -273,6 +273,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standardowe" + IDS_ACCEL_BASIC "Podstawowe" + IDS_ACCEL_EMULATION "Emulacja" ++ IDS_DRIVER_PULSE "Sterownik PulseAudio" + IDS_DRIVER_ALSA "Sterownik ALSA" + IDS_DRIVER_ESOUND "Sterownik EsounD" + IDS_DRIVER_OSS "Sterownik OSS" +diff --git a/programs/winecfg/Pt.rc b/programs/winecfg/Pt.rc +index aeab826..c2e0200 100644 +--- a/programs/winecfg/Pt.rc ++++ b/programs/winecfg/Pt.rc +@@ -470,6 +470,7 @@ BEGIN + IDS_ACCEL_STANDARD "Padrão" + IDS_ACCEL_BASIC "Básico" + IDS_ACCEL_EMULATION "Emulação" ++ IDS_DRIVER_PULSE "Controlador PulseAudio" + IDS_DRIVER_ALSA "Controlador ALSA" + IDS_DRIVER_ESOUND "Controlador EsounD" + IDS_DRIVER_OSS "Controlador OSS" +diff --git a/programs/winecfg/Ro.rc b/programs/winecfg/Ro.rc +index c031ea8..430d6d8 100644 +--- a/programs/winecfg/Ro.rc ++++ b/programs/winecfg/Ro.rc +@@ -282,6 +282,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "De bază" + IDS_ACCEL_EMULATION "Emulare" ++ IDS_DRIVER_PULSE "Driver PulseAudio" + IDS_DRIVER_ALSA "Driver ALSA" + IDS_DRIVER_ESOUND "Driver Esound" + IDS_DRIVER_OSS "Driver OSS" +diff --git a/programs/winecfg/Ru.rc b/programs/winecfg/Ru.rc +index 58252ba..39fb6d5 100644 +--- a/programs/winecfg/Ru.rc ++++ b/programs/winecfg/Ru.rc +@@ -287,6 +287,7 @@ BEGIN + IDS_ACCEL_STANDARD "Стандартное" + IDS_ACCEL_BASIC "Минимальное" + IDS_ACCEL_EMULATION "ЭмулÑциÑ" ++ IDS_DRIVER_PULSE "PulseAudio драйвер" + IDS_DRIVER_ALSA "ALSA драйвер" + IDS_DRIVER_ESOUND "EsounD драйвер" + IDS_DRIVER_OSS "OSS драйвер" +diff --git a/programs/winecfg/Si.rc b/programs/winecfg/Si.rc +index eec1658..35b5462 100644 +--- a/programs/winecfg/Si.rc ++++ b/programs/winecfg/Si.rc +@@ -272,6 +272,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standardno" + IDS_ACCEL_BASIC "Osnovno" + IDS_ACCEL_EMULATION "Emulacija" ++ IDS_DRIVER_PULSE "PulseAudio gonilnik" + IDS_DRIVER_ALSA "ALSA gonilnik" + IDS_DRIVER_ESOUND "EsounD gonilnik" + IDS_DRIVER_OSS "OSS gonilnik" +diff --git a/programs/winecfg/Sv.rc b/programs/winecfg/Sv.rc +index d724afa..ba34d44 100644 +--- a/programs/winecfg/Sv.rc ++++ b/programs/winecfg/Sv.rc +@@ -270,6 +270,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standard" + IDS_ACCEL_BASIC "Grundläggande" + IDS_ACCEL_EMULATION "Emulering" ++ IDS_DRIVER_PULSE "PulseAudio-drivrutin" + IDS_DRIVER_ALSA "ALSA-drivrutin" + IDS_DRIVER_ESOUND "EsounD-drivrutin" + IDS_DRIVER_OSS "OSS-drivrutin" +diff --git a/programs/winecfg/Tr.rc b/programs/winecfg/Tr.rc +index 89ddb23..196debe 100644 +--- a/programs/winecfg/Tr.rc ++++ b/programs/winecfg/Tr.rc +@@ -270,6 +270,7 @@ BEGIN + IDS_ACCEL_STANDARD "Standart" + IDS_ACCEL_BASIC "Temel" + IDS_ACCEL_EMULATION "Taklit" ++ IDS_DRIVER_PULSE "PulseAudio Sürücüsü" + IDS_DRIVER_ALSA "ALSA Sürücüsü" + IDS_DRIVER_ESOUND "EsounD Sürücüsü" + IDS_DRIVER_OSS "OSS Sürücüsü" +diff --git a/programs/winecfg/Zh.rc b/programs/winecfg/Zh.rc +index 14ac5c3..cd380a3 100644 +--- a/programs/winecfg/Zh.rc ++++ b/programs/winecfg/Zh.rc +@@ -275,6 +275,7 @@ BEGIN + IDS_ACCEL_STANDARD "标准" + IDS_ACCEL_BASIC "基本" + IDS_ACCEL_EMULATION "软件模拟" ++ IDS_DRIVER_PULSE "PulseAudio 驱动" + IDS_DRIVER_ALSA "ALSA 驱动" + IDS_DRIVER_ESOUND "EsounD 驱动" + IDS_DRIVER_OSS "OSS 驱动" +diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c +index 9f8a0a2..59837ef 100644 +--- a/programs/winecfg/audio.c ++++ b/programs/winecfg/audio.c +@@ -89,6 +89,7 @@ typedef struct + } AUDIO_DRIVER; + + static const AUDIO_DRIVER sAudioDrivers[] = { ++ {IDS_DRIVER_PULSE, "pulse"}, + {IDS_DRIVER_ALSA, "alsa"}, + {IDS_DRIVER_OSS, "oss"}, + {IDS_DRIVER_COREAUDIO, "coreaudio"}, +diff --git a/programs/winecfg/libraries.c b/programs/winecfg/libraries.c +index 37cc12b..7c13fad 100644 +--- a/programs/winecfg/libraries.c ++++ b/programs/winecfg/libraries.c +@@ -81,6 +81,7 @@ static const char * const builtin_only[] = + "wineoss.drv", + "wineps", + "wineps.drv", ++ "winepulse.drv", + "winex11.drv", + "winmm", + "wintab32", +diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h +index f006861..57b2a15 100644 +--- a/programs/winecfg/resource.h ++++ b/programs/winecfg/resource.h +@@ -187,7 +187,7 @@ + #define IDS_ACCEL_BASIC 8302 + #define IDS_ACCEL_EMULATION 8303 + #define IDS_DRIVER_ALSA 8304 +- ++#define IDS_DRIVER_PULSE 8305 + #define IDS_DRIVER_ESOUND 8306 + #define IDS_DRIVER_OSS 8307 + #define IDS_DRIVER_JACK 8308 --- wine1.2-1.1.43.orig/debian/patches/dibeng-0010.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0010.patch @@ -0,0 +1,2110 @@ +DIB Engine: introduction of bitmaplist structure + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/Makefile.in | 3 + dlls/winedib.drv/bitblt.c | 46 +++-- + dlls/winedib.drv/bitmap.c | 54 +++--- + dlls/winedib.drv/bitmaplist.c | 168 +++++++++++++++++ + dlls/winedib.drv/dc.c | 20 +- + dlls/winedib.drv/dib.c | 323 +++++++++++++-------------------- + dlls/winedib.drv/dibdrv.h | 55 ++++-- + dlls/winedib.drv/dibdrv_main.c | 6 + + dlls/winedib.drv/dibdrvbitmap.c | 211 ++++++++++++---------- + dlls/winedib.drv/font.c | 4 + dlls/winedib.drv/graphics.c | 8 - + dlls/winedib.drv/palette.c | 56 ++++-- + dlls/winedib.drv/pen_brush.c | 66 ++++--- + dlls/winedib.drv/primitives_bitblt.c | 16 +- + dlls/winedib.drv/primitives_color.c | 20 +- + dlls/winedib.drv/primitives_convert.c | 9 + + dlls/winedib.drv/primitives_font.c | 18 +- + dlls/winedib.drv/text.c | 6 - + 18 files changed, 640 insertions(+), 449 deletions(-) + create mode 100644 dlls/winedib.drv/bitmaplist.c + + +diff --git a/dlls/winedib.drv/Makefile.in b/dlls/winedib.drv/Makefile.in +index 722785e..a29edf0 100644 +--- a/dlls/winedib.drv/Makefile.in ++++ b/dlls/winedib.drv/Makefile.in +@@ -5,11 +5,12 @@ VPATH = @srcdir@ + MODULE = winedib.drv + IMPORTS = user32 gdi32 advapi32 kernel32 ntdll + EXTRAINCL = @FREETYPEINCL@ @FONTCONFIGINCL@ +-EXTRALIBS = @XLIB@ ++EXTRALIBS = @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ + + C_SRCS = \ + bitblt.c \ + bitmap.c \ ++ bitmaplist.c \ + clipping.c \ + convert.c \ + dc.c \ +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index 97feefd..b5b70f7 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -267,8 +267,12 @@ BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + _DIBDRV_Position_ws2ds(physDevSrc, &xSrc, &ySrc); + _DIBDRV_Sizes_ws2ds(physDevSrc, &widthSrc, &heightSrc); + +- /* from tests, it seems that negative coords on phys space are not allowed */ +- if(xDst < 0 || yDst < 0 || xSrc < 0 || ySrc < 0) ++ /* from tests, it seems that coords out of phys spaces are not allowed */ ++ if(xDst < 0 || yDst < 0 || xSrc < 0 || ySrc < 0 || ++ xDst + widthDst > physDevDst->physBitmap->width || ++ yDst + heightDst > physDevDst->physBitmap->height || ++ xSrc + widthSrc > physDevSrc->physBitmap->width || ++ ySrc + heightSrc > physDevSrc->physBitmap->height) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; +@@ -279,10 +283,10 @@ BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setPoint(&ps, xSrc, ySrc); + setSize(&szDst, widthDst, heightDst); + setSize(&szSrc, widthSrc, heightSrc); +- setRect(&dstClip, 0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height); ++ setRect(&dstClip, 0, 0, physDevDst->physBitmap->width, physDevDst->physBitmap->height); + if(physDevSrc) + { +- setRect(&srcClip, 0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height); ++ setRect(&srcClip, 0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height); + res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); + } + else +@@ -306,7 +310,7 @@ BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setSize(&szSrc, widthSrc, heightSrc); + if(!StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip)) + continue; +- if(physDevDst->physBitmap.funcs->AlphaBlend(physDevDst, pd.x, pd.y, szDst.cx, szDst.cy, ++ if(physDevDst->physBitmap->funcs->AlphaBlend(physDevDst, pd.x, pd.y, szDst.cx, szDst.cy, + physDevSrc, ps.x, ps.y, szSrc.cx, szSrc.cy, blendfn)) + res = TRUE; + } +@@ -326,9 +330,9 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + SIZE szDst = {widthDst, heightDst}; + + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", +- physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", ++ physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevDst->physBitmap) : "", + xDst, yDst, widthDst, heightDst, +- physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", ++ physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevSrc->physBitmap) : "", + xSrc, ySrc, widthSrc, heightSrc)); + + /* if sizes are null or negative, or source positions are negatives, returns false */ +@@ -349,7 +353,7 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + } + else if(!physDevSrc->hasDIB) + { +- FIXME("DDB source bitmap -- shouldn't happen\n"); ++ FIXME("DDB source bitmap still not supported\n"); + res = FALSE; + goto fin; + } +@@ -450,11 +454,11 @@ BOOL _DIBDRV_InternalBitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setPoint(&pd, xDst, yDst); + setPoint(&ps, xSrc, ySrc); + setSize(&sz, width, height); +- setRect(&dstClip, 0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height); ++ setRect(&dstClip, 0, 0, physDevDst->physBitmap->width, physDevDst->physBitmap->height); + + if(physDevSrc) + { +- setRect(&srcClip, 0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height); ++ setRect(&srcClip, 0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height); + res = BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, &dstClip); + } + else +@@ -476,7 +480,7 @@ BOOL _DIBDRV_InternalBitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setSize(&sz, width, height); + if(!BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip)) + continue; +- if(!physDevDst->physBitmap.funcs->BitBlt(physDevDst, pd.x, pd.y, sz.cx, sz.cy, physDevSrc, ps.x, ps.y, rop)) ++ if(!physDevDst->physBitmap->funcs->BitBlt(physDevDst, pd.x, pd.y, sz.cx, sz.cy, physDevSrc, ps.x, ps.y, rop)) + res = FALSE; + } + return res; +@@ -496,16 +500,16 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + SIZE sz = {width, height}; + + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, width:%d, height:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, rop:%08x\n", +- physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", ++ physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevDst->physBitmap) : "", + xDst, yDst, width, height, +- physDevSrc, physDevSrc ? (physDevSrc->hasDIB ? "DIB-" : "DDB"): "---", physDevSrc && physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", ++ physDevSrc, physDevSrc ? (physDevSrc->hasDIB ? "DIB-" : "DDB"): "---", physDevSrc && physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevSrc->physBitmap) : "", + xSrc, ySrc, rop)); + + if(physDevDst->hasDIB) + { + /* DIB section selected in dest DC, use DIB Engine */ + /* clip blit area */ +- RECT dstClip = {0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height}; ++ RECT dstClip = {0, 0, physDevDst->physBitmap->width, physDevDst->physBitmap->height}; + + if(!physDevSrc || physDevSrc->hasDIB) + { +@@ -609,7 +613,7 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + /* clip blit area */ + if(physDevSrc) + { +- RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; ++ RECT srcClip = {0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height}; + res = !BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, 0); + } + else +@@ -672,10 +676,10 @@ BOOL _DIBDRV_InternalStretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setPoint(&ps, xSrc, ySrc); + setSize(&szDst, widthDst, heightDst); + setSize(&szSrc, widthSrc, heightSrc); +- setRect(&dstClip, 0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height); ++ setRect(&dstClip, 0, 0, physDevDst->physBitmap->width, physDevDst->physBitmap->height); + if(physDevSrc) + { +- setRect(&srcClip, 0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height); ++ setRect(&srcClip, 0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height); + res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); + } + else +@@ -699,7 +703,7 @@ BOOL _DIBDRV_InternalStretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setSize(&szSrc, widthSrc, heightSrc); + if(!StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip)) + continue; +- if(physDevDst->physBitmap.funcs->StretchBlt(physDevDst, pd.x, pd.y, szDst.cx, szDst.cy, ++ if(physDevDst->physBitmap->funcs->StretchBlt(physDevDst, pd.x, pd.y, szDst.cx, szDst.cy, + physDevSrc, ps.x, ps.y, szSrc.cx, szSrc.cy, rop)) + res = TRUE; + } +@@ -727,9 +731,9 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + return DIBDRV_BitBlt(physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, rop); + + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d, rop:%08x\n", +- physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", ++ physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevDst->physBitmap) : "", + xDst, yDst, widthDst, heightDst, +- physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", ++ physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevSrc->physBitmap) : "", + xSrc, ySrc, widthSrc, heightSrc, rop)); + + if(physDevDst->hasDIB) +@@ -833,7 +837,7 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + /* clip blit area */ + if(physDevSrc) + { +- RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; ++ RECT srcClip = {0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height}; + res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, 0); + } + else +diff --git a/dlls/winedib.drv/bitmap.c b/dlls/winedib.drv/bitmap.c +index f3d3b9c..1562137 100644 +--- a/dlls/winedib.drv/bitmap.c ++++ b/dlls/winedib.drv/bitmap.c +@@ -34,13 +34,15 @@ HBITMAP DIBDRV_SelectBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap ) + DIBSECTION dibSection; + HBITMAP res; + ++ MAYBE(TRACE("physDev:%p, hbitmap:%p\n", physDev, hbitmap)); ++ + /* try to get the DIBSECTION data from the bitmap */ +- if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) != sizeof(DIBSECTION)) + { + /* not a DIB section, sets it on physDev and use X11 behaviour */ + +- MAYBE(TRACE("physDev:%p, hbitmap:%p\n", physDev, hbitmap)); + physDev->hasDIB = FALSE; ++ physDev->physBitmap = NULL; + res = _DIBDRV_GetDisplayDriver()->pSelectBitmap(physDev->X11PhysDev, hbitmap); + if(res) + physDev->hbitmap = hbitmap; +@@ -49,32 +51,23 @@ HBITMAP DIBDRV_SelectBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap ) + { + /* it's a DIB section, sets it on physDev and use DIB Engine behaviour */ + +- MAYBE(TRACE("physDev:%p, hbitmap:%p, physBitmap=%p\n", physDev, hbitmap, &physDev->physBitmap)); +- +- /* frees any previously physical bitmap */ +- _DIBDRVBITMAP_Free(&physDev->physBitmap); +- +- /* WARNING : the color table can't be grabbed here, since it's still +- not initialized. It'll be grabbed on RealizeDefaultPalette(), +- which is presumably the first call made after palette initialization. +- So, by now we just set up palette size and leave NULL the palette pointer */ +- if(_DIBDRVBITMAP_InitFromBMIH(&physDev->physBitmap, &dibSection.dsBmih, dibSection.dsBitfields, NULL, dibSection.dsBm.bmBits)) ++ /* sets the physical bitmap */ ++ if((physDev->physBitmap = _BITMAPLIST_Get(hbitmap)) != NULL) + { +- /* stores the active bitmap */ +- res = physDev->hbitmap; +- physDev->hbitmap = hbitmap; +- +- /* remember there's a DIB selected in */ + physDev->hasDIB = TRUE; ++ physDev->hbitmap = hbitmap; ++ MAYBE(TRACE("physDev->physBitmap:%p(%s)\n", physDev->physBitmap, _DIBDRVBITMAP_GetFormatName(physDev->physBitmap))); ++ res = hbitmap; + } + else + { +- ERR("Failed to initialize physical bitmap\n"); ++ ERR("Physical bitmap %p not found in internal list\n", hbitmap); ++ physDev->hbitmap = GetStockObject(DEFAULT_BITMAP); ++ physDev->hasDIB = FALSE; + res = 0; + } + } + return res; +- + } + + /**************************************************************************** +@@ -96,7 +89,7 @@ BOOL DIBDRV_CreateBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, LPVOID bmBits + else + { + /* it's a DIB section, use DIB Engine behaviour - should not happen, but.... */ +- ONCE(FIXME("CreateBitmap() called for a DIB section - shouldn't happen\n")); ++ ERR("CreateBitmap() called for a DIB section - shouldn't happen\n"); + res = TRUE; + } + return res; +@@ -108,12 +101,13 @@ BOOL DIBDRV_CreateBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, LPVOID bmBits + BOOL DIBDRV_DeleteBitmap( HBITMAP hbitmap ) + { + DIBSECTION dibSection; ++ DIBDRVBITMAP *bmp; + BOOL res; + + MAYBE(TRACE("hbitmap:%p\n", hbitmap)); + + /* try to get the DIBSECTION data from the bitmap */ +- if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) != sizeof(DIBSECTION)) + { + /* not a DIB section, use X11 behaviour */ + res = _DIBDRV_GetDisplayDriver()->pDeleteBitmap(hbitmap); +@@ -121,8 +115,22 @@ BOOL DIBDRV_DeleteBitmap( HBITMAP hbitmap ) + else + { + /* it's a DIB section, use DIB Engine behaviour */ +- ONCE(FIXME("STUB\n")); +- res = TRUE; ++ ++ /* do not try to delete stock objects */ ++ if(hbitmap == GetStockObject(DEFAULT_BITMAP)) ++ res = TRUE; ++ ++ /* locates and frees the physical bitmap */ ++ else if((bmp = _BITMAPLIST_Remove(hbitmap)) != NULL) ++ { ++ _DIBDRVBITMAP_Free(bmp); ++ res = TRUE; ++ } ++ else ++ { ++ ERR("Physical bitmap %p not found in internal list\n", hbitmap); ++ res = FALSE; ++ } + } + return res; + } +diff --git a/dlls/winedib.drv/bitmaplist.c b/dlls/winedib.drv/bitmaplist.c +new file mode 100644 +index 0000000..455f36a +--- /dev/null ++++ b/dlls/winedib.drv/bitmaplist.c +@@ -0,0 +1,168 @@ ++/* ++ * DIBDRV in-memory bitmap list ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++/* this modules manages association between HBITMAP handles and DIBDRVBITMAP ++ * physical bitmap objects. Needed mostly to get palettes from DIBs without ++ * resorting to GetDIBColorTable() or GETDIBits(), which are DC dependent. ++ * It makes also much easier (and faster) many bitmap operations */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++static CRITICAL_SECTION BITMAPLIST_CritSection; ++static CRITICAL_SECTION_DEBUG critsect_debug = ++{ ++ 0, 0, &BITMAPLIST_CritSection, ++ { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, ++ 0, 0, { (DWORD_PTR)(__FILE__ ": BITMAPLIST_CritSection") } ++}; ++static CRITICAL_SECTION BITMAPLIST_CritSection = { &critsect_debug, -1, 0, 0, 0, 0 }; ++ ++typedef struct _BITMAPLIST_NODE ++{ ++ HBITMAP hbmp; ++ DIBDRVBITMAP *bmp; ++ UINT refCount; ++ struct _BITMAPLIST_NODE *prev, *next; ++ ++} BITMAPLIST_NODE; ++ ++/* the list */ ++static BITMAPLIST_NODE *DIBDRV_BITMAPLIST; ++ ++/* initializes bitmap list -- to be called at process attach */ ++void _BITMAPLIST_Init(void) ++{ ++ DIBDRV_BITMAPLIST = NULL; ++} ++ ++/* terminates bitmap list -- to be called at process detach */ ++void _BITMAPLIST_Terminate(void) ++{ ++ BITMAPLIST_NODE *curNode, *nextNode; ++ ++ EnterCriticalSection(&BITMAPLIST_CritSection); ++ ++ /* frees all stored bitmaps, if any left */ ++ curNode = DIBDRV_BITMAPLIST; ++ while(curNode) ++ { ++ nextNode = curNode->next; ++ ERR("Unfreed DIB found, handle is %p\n", curNode->hbmp); ++ HeapFree(GetProcessHeap(), 0, curNode); ++ curNode = nextNode; ++ } ++ DIBDRV_BITMAPLIST = NULL; ++ LeaveCriticalSection(&BITMAPLIST_CritSection); ++ DeleteCriticalSection(&BITMAPLIST_CritSection); ++} ++ ++/* scan list for a DIB -- returns node containing it */ ++static BITMAPLIST_NODE *GetNode(HBITMAP hbmp) ++{ ++ BITMAPLIST_NODE *node = DIBDRV_BITMAPLIST; ++ while(node) ++ { ++ if(node->hbmp == hbmp) ++ return node; ++ node = node->next; ++ } ++ return NULL; ++} ++ ++/* adds a DIB to the list - it adds it on top, as ++ usually most recently created DIBs are used first */ ++BOOL _BITMAPLIST_Add(HBITMAP hbmp, DIBDRVBITMAP *bmp) ++{ ++ BITMAPLIST_NODE *existNode, *node; ++ ++ EnterCriticalSection(&BITMAPLIST_CritSection); ++ ++ /* checks if already there */ ++ node = NULL; ++ existNode = GetNode(hbmp); ++ if(!existNode) ++ { ++ node = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPLIST_NODE)); ++ if(!node) ++ ERR("HeapAlloc failed\n"); ++ else ++ { ++ node->next = DIBDRV_BITMAPLIST; ++ node->prev = NULL; ++ DIBDRV_BITMAPLIST = node; ++ if(node->next) ++ node->next->prev = node; ++ node->hbmp = hbmp; ++ node->bmp = bmp; ++ } ++ } ++ LeaveCriticalSection(&BITMAPLIST_CritSection); ++ return !existNode && node; ++} ++ ++/* removes a DIB from the list */ ++DIBDRVBITMAP *_BITMAPLIST_Remove(HBITMAP hbmp) ++{ ++ BITMAPLIST_NODE *node; ++ DIBDRVBITMAP *bmp; ++ ++ /* checks if already there */ ++ EnterCriticalSection(&BITMAPLIST_CritSection); ++ node = GetNode(hbmp); ++ if(node) ++ { ++ if(node->prev) ++ node->prev->next = node->next; ++ else ++ DIBDRV_BITMAPLIST = node->next; ++ if(node->next) ++ node->next->prev = node->prev; ++ } ++ LeaveCriticalSection(&BITMAPLIST_CritSection); ++ if(node) ++ { ++ bmp = node->bmp; ++ HeapFree(GetProcessHeap(), 0, node); ++ } ++ else ++ bmp = NULL; ++ return bmp; ++} ++ ++/* scans list for a DIB */ ++DIBDRVBITMAP *_BITMAPLIST_Get(HBITMAP hbmp) ++{ ++ BITMAPLIST_NODE *node; ++ DIBDRVBITMAP *bmp; ++ ++ EnterCriticalSection(&BITMAPLIST_CritSection); ++ node = GetNode(hbmp); ++ if(!node) ++ bmp = NULL; ++ else ++ bmp = node->bmp; ++ LeaveCriticalSection(&BITMAPLIST_CritSection); ++ return bmp; ++} +diff --git a/dlls/winedib.drv/dc.c b/dlls/winedib.drv/dc.c +index f5324b0..d2dae5f 100644 +--- a/dlls/winedib.drv/dc.c ++++ b/dlls/winedib.drv/dc.c +@@ -165,8 +165,8 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + /* no DIB selected into DC on creation */ + physDev->hasDIB = FALSE; + +- /* clear physical bitmap */ +- _DIBDRVBITMAP_Clear(&physDev->physBitmap); ++ /* initializes the physical bitmap */ ++ physDev->physBitmap = NULL; + + /* clears pen and brush */ + physDev->rop2 = R2_COPYPEN; +@@ -200,8 +200,8 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + physDev->brushHLine = dummy4; + + physDev->isBrushBitmap = FALSE; +- _DIBDRVBITMAP_Clear(&physDev->brushBitmap); +- _DIBDRVBITMAP_Clear(&physDev->brushBmpCache); ++ physDev->brushBitmap = NULL; ++ physDev->brushBmpCache = NULL; + + /* text color */ + physDev->textColor = 0; +@@ -234,12 +234,14 @@ BOOL DIBDRV_DeleteDC( DIBDRVPHYSDEV *physDev ) + res = _DIBDRV_GetDisplayDriver()->pDeleteDC(physDev->X11PhysDev); + physDev->X11PhysDev = NULL; + +- /* frees physical bitmap */ +- _DIBDRVBITMAP_Free(&physDev->physBitmap); ++ /* resets physical bitmap */ ++ physDev->physBitmap = NULL; + +- /* frees brush bitmap */ +- _DIBDRVBITMAP_Free(&physDev->brushBitmap); +- _DIBDRVBITMAP_Free(&physDev->brushBmpCache); ++ /* reset brush bitmap */ ++ _DIBDRVBITMAP_Free(physDev->brushBitmap); ++ physDev->brushBitmap = NULL; ++ _DIBDRVBITMAP_Free(physDev->brushBmpCache); ++ physDev->brushBmpCache = NULL; + + /* free brush ands and xors */ + if(physDev->brushAnds) +diff --git a/dlls/winedib.drv/dib.c b/dlls/winedib.drv/dib.c +index 41fb158..ae6a5cf 100644 +--- a/dlls/winedib.drv/dib.c ++++ b/dlls/winedib.drv/dib.c +@@ -68,15 +68,44 @@ static DWORD pal8[] = + HBITMAP DIBDRV_CreateDIBSection( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, + const BITMAPINFO *bmi, UINT usage ) + { +- HBITMAP res; ++ DIBDRVBITMAP *bmp; ++ DIBSECTION ds; + + MAYBE(TRACE("physDev:%p, hbitmap:%p, bmi:%p, usage:%d\n", physDev, hbitmap, bmi, usage)); + + /* createDIBSection is only DIB-related, so we just use the engine */ +- ONCE(FIXME("STUB\n")); +- res = hbitmap; + +- return res; ++ /* we need bitmap bits */ ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &ds) != sizeof(DIBSECTION)) ++ { ++ ERR("Bitmap is not a DIB Section\n"); ++ return NULL; ++ } ++ ++ /* creates the physical bitmap */ ++ if(!(bmp = _DIBDRVBITMAP_CreateFromBitmapinfo(bmi, ds.dsBm.bmBits))) ++ { ++ ERR("_DIBDRVBITMAP_CreateFromBitmapinfo failed\n"); ++ return NULL; ++ } ++ ++ /* TEMPORARY -- if usage is DIB_PAL_COLOR, sets the palette ++ as ungrabbed, so next call to RealizeDefaultPalette will ++ do it */ ++ if(usage == DIB_PAL_COLORS) ++ { ++ FIXME("Do color table grabbing here instead of RealizeDefaultPalette\n"); ++ bmp->colorTableGrabbed = FALSE; ++ } ++ ++ /* adds it to the internal list */ ++ if(!_BITMAPLIST_Add(hbitmap, bmp)) ++ { ++ ERR("Couldn't add physical bitmap to list\n"); ++ _DIBDRVBITMAP_Free(bmp); ++ return NULL; ++ } ++ return hbitmap; + } + + /*********************************************************************** +@@ -87,15 +116,12 @@ INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + { + INT res; + DIBSECTION ds; +- DIBDRVBITMAP sBmp, dBmp; ++ DIBDRVBITMAP *sBmp, *dBmp; + DWORD *buf; + int iLine; + int size; +- BOOL justInfo, justInfoHeader; + int requestedBpp; +- RGBQUAD *colorTable; +- int colorTableSize; +- BITMAPINFO *sourceInfo; ++ RGBQUAD *colorTable = NULL; + + MAYBE(TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", + physDev, hbitmap, startscan, lines, bits, info, coloruse)); +@@ -118,118 +144,46 @@ INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + return 0; + } + +- /* get requested BPP */ +- requestedBpp = info->bmiHeader.biBitCount; +- +- /* check wetrher we wants just the BITMAPINFO data */ +- justInfo = (bits == NULL); +- +- /* check wether we wants just to get BITMAPINFOHEADER data */ +- justInfoHeader = (requestedBpp == 0); +- +- if(!justInfo && justInfoHeader) ++ /* if we wants just the BITMAPINFOHEADER data, do it */ ++ if(bits == NULL && info->bmiHeader.biBitCount == 0) + { +- ERR("Bad requested BPP\n"); +- return 0; ++ memcpy(&info->bmiHeader, &ds.dsBmih, size); ++ return abs(ds.dsBmih.biHeight); + } +- +- /* copy / set missing DIB info */ +- if(justInfo) +- { +- info->bmiHeader.biWidth = ds.dsBmih.biWidth; +- info->bmiHeader.biHeight = ds.dsBmih.biHeight; +- } +- info->bmiHeader.biPlanes = 1; +- if(justInfoHeader) +- info->bmiHeader.biBitCount = ds.dsBmih.biBitCount; +- if(size == sizeof(BITMAPINFOHEADER)) +- { +- if(justInfoHeader) +- { +- info->bmiHeader.biCompression = ds.dsBmih.biCompression; +- info->bmiHeader.biXPelsPerMeter = ds.dsBmih.biXPelsPerMeter; +- info->bmiHeader.biYPelsPerMeter = ds.dsBmih.biYPelsPerMeter; +- info->bmiHeader.biClrUsed = ds.dsBmih.biClrUsed; +- info->bmiHeader.biClrImportant = ds.dsBmih.biClrImportant; +- } +- info->bmiHeader.biSizeImage = ds.dsBmih.biSizeImage; +- } +- +- /* width and height *must* match source's ones */ +- if(info->bmiHeader.biWidth != ds.dsBmih.biWidth || +- abs(info->bmiHeader.biHeight) != abs(ds.dsBmih.biHeight)) ++ ++ /* source and dest sizes must match */ ++ if(info->bmiHeader.biWidth != ds.dsBmih.biWidth || abs(info->bmiHeader.biHeight) != abs(ds.dsBmih.biHeight)) + { +- ERR("Size of requested bitmap data don't match source's ones\n"); ++ WARN("Source and dest DIBs sizes don't match\n"); + return 0; + } +- +- /* if we just wants the BITMAPINFOHEADER data, we're done */ +- if(justInfoHeader || (justInfo && ds.dsBmih.biBitCount > 8)) +- return abs(info->bmiHeader.biHeight); +- +- /* we now have to get source data -- we need it for palette, for example */ +- colorTableSize = 0; +- if(ds.dsBmih.biBitCount <= 8) +- colorTableSize = (1 << ds.dsBmih.biBitCount); +- else if(ds.dsBmih.biCompression == BI_BITFIELDS) +- colorTableSize = 3; +- sourceInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFOHEADER) + colorTableSize * sizeof(RGBQUAD)); +- if(!sourceInfo) ++ ++ /* get requested BPP and check it */ ++ requestedBpp = info->bmiHeader.biBitCount; ++ if(requestedBpp != 1 && requestedBpp != 4 && ++ requestedBpp != 8 && requestedBpp != 16 && ++ requestedBpp != 24 && requestedBpp != 32) + { +- ERR("HeapAlloc failed\n"); ++ ERR("Unknown BitCount %d\n", requestedBpp); + return 0; + } +- memcpy(sourceInfo, &ds.dsBmih, sizeof(BITMAPINFOHEADER)); +- if(ds.dsBmih.biBitCount <= 8) +- { +- /* grab palette - well, we should. No way to do it by now.... +- we should add a list HBITMAP <--> DIBDRVBITMAP and fiddle to many +- , many parts of the engine. Not worth the effort by now. +- So, we just synthesize the table */ +- switch(requestedBpp) +- { +- case 1: +- memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), pal1, 2*sizeof(DWORD)); +- break; +- +- case 4: +- memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), pal4, 16*sizeof(DWORD)); +- break; +- +- case 8: +- memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), pal8, 256*sizeof(DWORD)); +- break; +- +- default: +- ERR("Unknown requested bith depth %d\n", requestedBpp); +- _DIBDRVBITMAP_Free(&sBmp); +- return 0; +- } +- } +- else if(ds.dsBmih.biCompression == BI_BITFIELDS) +- memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), ds.dsBitfields, 3 * sizeof(RGBQUAD)); +- _DIBDRVBITMAP_Clear(&sBmp); +- if(!_DIBDRVBITMAP_InitFromBitmapinfo(&sBmp, sourceInfo)) ++ ++ /* now we must get (if needed) the color table */ ++ if(!(sBmp = _BITMAPLIST_Get(hbitmap))) + { +- ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); +- HeapFree(GetProcessHeap(), 0, sourceInfo); ++ ERR("Couldn't retrieve source DIB data\n"); + return 0; + } +- _DIBDRVBITMAP_Set_Bits(&sBmp, ds.dsBm.bmBits, FALSE); +- HeapFree(GetProcessHeap(), 0, sourceInfo); +- +- /* now grab / synthesize the color table if needed */ + if(requestedBpp <= 8) + { + colorTable = (RGBQUAD *)((BYTE *)info + size); +- if(requestedBpp == ds.dsBmih.biBitCount) +- { +- /* same source and dest format - copy color tables */ +- memcpy(colorTable, sBmp.colorTable, colorTableSize); +- } ++ ++ /* if same color format, just grab the color table */ ++ if(requestedBpp == sBmp->bitCount) ++ memcpy(colorTable, sBmp->colorTable, sBmp->colorTableSize); ++ /* otherwise synthesize a new color table */ + else + { +- /* different formats -- synthesize color table */ + switch(requestedBpp) + { + case 1: +@@ -246,38 +200,33 @@ INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + + default: + ERR("Unknown requested bith depth %d\n", requestedBpp); +- _DIBDRVBITMAP_Free(&sBmp); + return 0; + } + } + } + +- /* if we just wanted DIB info, job is done */ +- if(justInfo) +- { +- _DIBDRVBITMAP_Free(&sBmp); +- return abs(info->bmiHeader.biHeight); +- } +- +- /* Creates a DIBDRVBITMAP from dest dib */ +- _DIBDRVBITMAP_Clear(&dBmp); +- if(!_DIBDRVBITMAP_InitFromBitmapinfo(&dBmp, info)) ++ /* If we wanted just BITMAPINFO data, we're done */ ++ if(!bits) ++ return abs(ds.dsBmih.biHeight); ++ ++ /* now it's time to transfer image bits; for this we should create ++ a DIBDRVBITMAP from dest BITMAPINFO data */ ++ /* FIXME -- HERE is the place to add support for 'startscan' stuffs */ ++ if(!(dBmp = _DIBDRVBITMAP_CreateFromBMIH((BITMAPINFOHEADER *)info, ds.dsBitfields, colorTable, bits))) + { +- ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); +- _DIBDRVBITMAP_Free(&sBmp); ++ ERR("Couldn't create dest DIB\n"); + return 0; + } +- _DIBDRVBITMAP_Set_Bits(&dBmp, bits, FALSE); + + /* now we can do the bit conversion */ + buf = HeapAlloc(GetProcessHeap(), 0, ds.dsBmih.biWidth * sizeof(RGBQUAD)); + for(iLine = 0; iLine < lines; iLine++) + { +- sBmp.funcs->GetLine(&sBmp, iLine, 0, ds.dsBmih.biWidth, buf); +- dBmp.funcs->PutLine(&dBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ sBmp->funcs->GetLine(sBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ dBmp->funcs->PutLine(dBmp, iLine, 0, ds.dsBmih.biWidth, buf); + } +- _DIBDRVBITMAP_Free(&sBmp); +- _DIBDRVBITMAP_Free(&dBmp); ++ HeapFree(GetProcessHeap(), 0, buf); ++ _DIBDRVBITMAP_Free(dBmp); + return lines; + } + else +@@ -293,13 +242,11 @@ INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + const RGBQUAD *colors ) + { +- DIBDRVBITMAP *dib = &physDev->physBitmap; +-#if 0 +- HBITMAP thisDIB; +-#endif ++ DIBDRVBITMAP *dib = physDev->physBitmap; ++ HBRUSH thisBrush; ++ HPEN thisPen; + + MAYBE(TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors)); +- + /* SetDIBColorTable operates on a DIB, so we use the engine */ + + /* if bpp > 8, some error occurred... */ +@@ -334,13 +281,16 @@ UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + } + memcpy(dib->colorTable + start, colors, sizeof(RGBQUAD) * count); + dib->colorTableGrabbed = TRUE; +- +- /* hack to make GDI32 sense the DIB color table change +- (fixes a couple of todos in bitmap test suite */ +-#if 0 +- thisDIB = SelectObject(physDev->hdc, GetStockObject(OBJ_BITMAP)); +- SelectObject(physDev->hdc, thisDIB); +-#endif ++ ++ /* for monochrome bitmaps, we need the 'lightest' color */ ++ _DIBDRVBITMAP_GetLightestColorIndex(dib); ++ ++ /* we should re-select both current pen and brush ++ in order to update colormap-dependent colors */ ++ thisBrush = SelectObject(physDev->hdc, GetStockObject(NULL_BRUSH)); ++ thisPen = SelectObject(physDev->hdc, GetStockObject(NULL_PEN)); ++ SelectObject(physDev->hdc, thisBrush); ++ SelectObject(physDev->hdc, thisPen); + + return TRUE; + } +@@ -353,7 +303,7 @@ INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + { + INT res; + DIBSECTION ds; +- DIBDRVBITMAP sBmp, dBmp; ++ DIBDRVBITMAP *sBmp, *dBmp; + DWORD *buf; + int iLine; + +@@ -373,31 +323,29 @@ INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + } + + /* Creates a DIBDRVBITMAP from source dib */ +- _DIBDRVBITMAP_Clear(&sBmp); +- if(!_DIBDRVBITMAP_InitFromBitmapinfo(&sBmp, info)) ++ if(!(sBmp = _DIBDRVBITMAP_CreateFromBitmapinfo(info, (LPVOID)bits))) + { +- ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); ++ ERR("_DIBDRVBITMAP_CreateFromBitmapinfo failed\n"); + return 0; + } +- _DIBDRVBITMAP_Set_Bits(&sBmp, (LPVOID)bits, FALSE); + +- /* same for destination dib */ +- if(!_DIBDRVBITMAP_InitFromHBITMAP(&dBmp, hbitmap, FALSE)) ++ /* get destination physical bitmap */ ++ if(!(dBmp = _BITMAPLIST_Get(hbitmap))) + { +- ERR("_DIBDRVBITMAP_InitFromHBITMAP failed\n"); +- _DIBDRVBITMAP_Free(&sBmp); ++ ERR("Couldn't retrieve dest physical bitmap\n"); ++ _DIBDRVBITMAP_Free(sBmp); + return 0; + } +- ++ + /* now we can do the bit conversion */ + buf = HeapAlloc(GetProcessHeap(), 0, ds.dsBmih.biWidth * sizeof(RGBQUAD)); + for(iLine = 0; iLine < lines; iLine++) + { +- sBmp.funcs->GetLine(&sBmp, iLine, 0, ds.dsBmih.biWidth, buf); +- dBmp.funcs->PutLine(&dBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ sBmp->funcs->GetLine(sBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ dBmp->funcs->PutLine(dBmp, iLine, 0, ds.dsBmih.biWidth, buf); + } +- _DIBDRVBITMAP_Free(&sBmp); +- _DIBDRVBITMAP_Free(&dBmp); ++ HeapFree(GetProcessHeap(), 0, buf); ++ _DIBDRVBITMAP_Free(sBmp); + return lines; + } + else +@@ -411,34 +359,35 @@ INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + /************************************************************************* + * DIBDRV_SetDIBitsToDevice + */ +-INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDest, INT yDest, DWORD cx, ++INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDst, INT yDst, DWORD cx, + DWORD cy, INT xSrc, INT ySrc, + UINT startscan, UINT lines, LPCVOID bits, + const BITMAPINFO *info, UINT coloruse ) + { +- BITMAPINFO *bitmapInfo; +- int bmInfoSize; + int dibHeight, dibWidth; +- DIBDRVBITMAP sBmp; +- int sLine, dLine, iLine; ++ DIBDRVBITMAP *sBmp, *dBmp; ++ int iLine; + void *buf; + +- MAYBE(TRACE("physDev:%p, xDest:%d, yDest:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", +- physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse)); ++ MAYBE(TRACE("physDev:%p, xDst:%d, yDst:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", ++ physDev, xDst, yDst, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ + + /* inverts y on source -- FIXME: check if right with some tests, it seems so */ +- ySrc = abs(info->bmiHeader.biHeight) - ySrc - cy; ++// ySrc = abs(info->bmiHeader.biHeight) - ySrc - cy; + + dibHeight = info->bmiHeader.biHeight; + dibWidth = info->bmiHeader.biWidth; + + /* sanity check and source clipping on physical sizes */ + if(startscan >= abs(dibHeight)) ++ { ++ ERR("startscan out of range\n"); + return 0; ++ } + if(startscan + lines > abs(dibHeight)) + lines = abs(dibHeight) - startscan; + +@@ -446,75 +395,63 @@ INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDest, INT yDest, DWOR + dibHeight += (dibHeight > 0 ? -startscan : startscan); + + if(xSrc >= dibWidth) ++ { ++ ERR("xSrc out of range\n"); + return 0; ++ } + if(xSrc + cx > dibWidth) + cx = dibWidth - xSrc; + if(ySrc > abs(dibHeight)) ++ { ++ ERR("ySrc out of range\n"); + return 0; ++ } + if(ySrc + cy > abs(dibHeight)) + cy = abs(dibHeight) - ySrc; + + ySrc -= startscan; + cy -= startscan; + if(cy <= 0) ++ { ++ ERR("Null or negative vertical size\n"); + return 0; ++ } + if(ySrc < 0) + { +- yDest += ySrc; ++ yDst += ySrc; + cy += ySrc; + ySrc = 0; + } + if(cy <= 0) +- return 0; +- +- /* grab a copy of BITMAPINFO */ +- bmInfoSize = sizeof(BITMAPINFOHEADER); +- if(info->bmiHeader.biCompression == BI_BITFIELDS) +- bmInfoSize += 3 * sizeof(RGBQUAD); +- else if (info->bmiHeader.biBitCount <= 8) +- { +- if(info->bmiHeader.biClrUsed) +- bmInfoSize += info->bmiHeader.biClrUsed * sizeof(RGBQUAD); +- else +- bmInfoSize += (1 << info->bmiHeader.biBitCount) * sizeof(RGBQUAD); +- } +- if(!(bitmapInfo = HeapAlloc(GetProcessHeap(), 0, bmInfoSize))) + { +- ERR("HeapAlloc failed\n"); ++ ERR("Null or negative vertical size\n"); + return 0; + } +- memcpy(bitmapInfo, info, bmInfoSize); +- bitmapInfo->bmiHeader.biHeight = dibHeight; + +- /* create a DIBDRVBITMAP from BITMAPINFO data */ +- _DIBDRVBITMAP_Clear(&sBmp); +- if(!_DIBDRVBITMAP_InitFromBitmapinfo(&sBmp, bitmapInfo)) ++ /* Creates a DIBDRVBITMAP from source dib */ ++ if(!(sBmp = _DIBDRVBITMAP_CreateFromBitmapinfo(info, (LPVOID)bits))) + { +- ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); +- HeapFree(GetProcessHeap, 0, bitmapInfo); ++ ERR("_DIBDRVBITMAP_CreateFromBitmapinfo failed\n"); + return 0; + } +- HeapFree(GetProcessHeap(), 0, bitmapInfo); +- _DIBDRVBITMAP_Set_Bits(&sBmp, (LPVOID)bits, FALSE); + +- /* transfer lines to dest bitmap */ +- if(!(buf = HeapAlloc(GetProcessHeap(), 0, cx * sizeof(RGBQUAD)))) +- { +- ERR("HeapAlloc failed\n"); +- return 0; +- } +- for(sLine = ySrc, dLine = yDest, iLine = 0; iLine < cy; sLine++, dLine++, iLine++) ++ /* get destination physical bitmap */ ++ dBmp = physDev->physBitmap; ++ ++ /* now we can do the bit conversion */ ++ buf = HeapAlloc(GetProcessHeap(), 0, cx * sizeof(RGBQUAD)); ++ for(iLine = 0; iLine < cy; iLine++) + { +- sBmp.funcs->GetLine(&sBmp, sLine, xSrc, cx, buf); +- physDev->physBitmap.funcs->PutLine(&physDev->physBitmap, dLine, xDest, cx, buf); ++ sBmp->funcs->GetLine(sBmp, ySrc++, xSrc, cx, buf); ++ dBmp->funcs->PutLine(dBmp, yDst++, xDst, cx, buf); + } + HeapFree(GetProcessHeap(), 0, buf); +- ++ _DIBDRVBITMAP_Free(sBmp); + return cy; + } + else + { +- return _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc, ++ return _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDst, yDst, cx, cy, xSrc, ySrc, + startscan, lines, bits, info, coloruse); + } + } +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 8243d4b..4266703 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -171,6 +171,9 @@ typedef struct _DIBDRVBITMAP + RGBQUAD *colorTable; + DWORD colorTableSize; + ++ /* lightest color index, for monochrome bitmaps */ ++ int lightColor; ++ + /* flag indicating that color table has been grabbed */ + BOOL colorTableGrabbed; + +@@ -203,7 +206,7 @@ typedef struct _DIBDRVPHYSDEV + HBITMAP hbitmap; + + /* physical bitmap */ +- DIBDRVBITMAP physBitmap; ++ DIBDRVBITMAP *physBitmap; + + /* active ROP2 */ + INT rop2; +@@ -249,8 +252,8 @@ typedef struct _DIBDRVPHYSDEV + + /* brush bitmap, if needed, and its converted/resized cache copy */ + BOOL isBrushBitmap; +- DIBDRVBITMAP brushBitmap; +- DIBDRVBITMAP brushBmpCache; ++ DIBDRVBITMAP *brushBitmap; ++ DIBDRVBITMAP *brushBmpCache; + + /* text color */ + COLORREF textColor; +@@ -317,7 +320,10 @@ const char *_DIBDRVBITMAP_GetFormatName(DIBDRVBITMAP const *bmp); + void _DIBDRVBITMAP_Set_Bits(DIBDRVBITMAP *dib, void *bits, BOOL owns); + void *_DIBDRVBITMAP_Get_Bits(DIBDRVBITMAP *dib); + +-/* initializes dib from a bitmap : ++/* calculates and sets the lightest color for monochrome bitmaps */ ++int _DIBDRVBITMAP_GetLightestColorIndex(DIBDRVBITMAP *dib); ++ ++/* initialize or create dib from a bitmap : + dib dib being initialized + bi source BITMAPINFOHEADER with required DIB format info + bit_fields color masks +@@ -326,8 +332,11 @@ void *_DIBDRVBITMAP_Get_Bits(DIBDRVBITMAP *dib); + NOTE : DIBDRVBITMAP doesn't owns bits, but do own color table */ + BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields, + const RGBQUAD *color_table, void *bits); ++DIBDRVBITMAP *_DIBDRVBITMAP_CreateFromBMIH(const BITMAPINFOHEADER *bi, const DWORD *bit_fields, ++ const RGBQUAD *colorTable, void *bits); + +-BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi); ++BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi, void *bits); ++DIBDRVBITMAP *_DIBDRVBITMAP_CreateFromBitmapinfo(const BITMAPINFO *bmi, void *bits); + + /* initializes a DIBRDVBITMAP copying it from a source one + Parameters : +@@ -336,13 +345,6 @@ BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi); + copy TRUE->copy source pixel array FALSE->link to source pixel array */ + BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *src, BOOL copy); + +-/* initializes a DIBRDVBITMAP from a DIB HBITMAP +- Parameters : +- bmp destination DIBDRVBITMAP +- hbmp source HBITMAP +- copyPixels TRUE->copy source pixel array FALSE->link to source pixel array */ +-BOOL _DIBDRVBITMAP_InitFromHBITMAP(DIBDRVBITMAP *bmp, const HBITMAP hbmp, BOOL copyPixels); +- + /* creates a DIBRDVBITMAP copying format info from a source one + Parameters : + dib destination DIBDRVBITMAP +@@ -350,13 +352,16 @@ BOOL _DIBDRVBITMAP_InitFromHBITMAP(DIBDRVBITMAP *bmp, const HBITMAP hbmp, BOOL c + widht, height sizes of newly created bitmap */ + BOOL _DIBDRVBITMAP_CreateFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *src, int width, int height); + ++/* allocates a new DIBDTVBITMAP */ ++DIBDRVBITMAP *_DIBDRVBITMAP_New(void); ++ ++/* Frees and de-allocates a DIBDRVBITMAP structure data */ ++void _DIBDRVBITMAP_Free(DIBDRVBITMAP *bmp); ++ + /* Clears a DIBDRVBITMAP structure data + WARNING : doesn't free anything */ + void _DIBDRVBITMAP_Clear(DIBDRVBITMAP *bmp); + +-/* Frees a DIBDRVBITMAP structure data */ +-void _DIBDRVBITMAP_Free(DIBDRVBITMAP *bmp); +- + /* checks whether the format of 2 DIBs are identical + it checks the pixel bit count and the color table size + and content, if needed */ +@@ -375,6 +380,26 @@ BOOL _DIBDRVBITMAP_CreateSolid(DIBDRVBITMAP *bmp, DIBDRVBITMAP *format, int widt + BOOL _DIBDRVBITMAP_ExpandHoriz(DIBDRVBITMAP *dib, int baseWidth, int minWidth); + + /* ********************************************************************* ++ * BITMAP LIST MANAGEMENT FUNCTIONS ++ * ********************************************************************/ ++ ++/* initializes bitmap list -- to be called at process attach */ ++void _BITMAPLIST_Init(void); ++ ++/* terminates bitmap list -- to be called at process detach */ ++void _BITMAPLIST_Terminate(void); ++ ++/* adds a DIB to the list - it adds it on top, as ++ usually most recently created DIBs are used first */ ++BOOL _BITMAPLIST_Add(HBITMAP hbmp, DIBDRVBITMAP *bmp); ++ ++/* removes a DIB from the list */ ++DIBDRVBITMAP *_BITMAPLIST_Remove(HBITMAP hbmp); ++ ++/* scans list for a DIB */ ++DIBDRVBITMAP *_BITMAPLIST_Get(HBITMAP hbmp); ++ ++/* ********************************************************************* + * DIB <--> DDB CONVERSION ROUTINES + * ********************************************************************/ + +diff --git a/dlls/winedib.drv/dibdrv_main.c b/dlls/winedib.drv/dibdrv_main.c +index e436440..119a294 100644 +--- a/dlls/winedib.drv/dibdrv_main.c ++++ b/dlls/winedib.drv/dibdrv_main.c +@@ -42,6 +42,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) + /* initializes freetype library */ + if(!_DIBDRV_FreeType_Init()) + ERR("Couldn't initialize freetype library.\n"); ++ ++ /* initializes internal bitmap list */ ++ _BITMAPLIST_Init(); + + break; + case DLL_THREAD_DETACH: +@@ -55,6 +58,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) + /* unloads display driver */ + _DIBDRV_FreeDisplayDriver(); + ++ /* terminates internal bitmap list */ ++ _BITMAPLIST_Terminate(); ++ + break; + } + return ret; +diff --git a/dlls/winedib.drv/dibdrvbitmap.c b/dlls/winedib.drv/dibdrvbitmap.c +index 8e6b653..eb7d1e2 100644 +--- a/dlls/winedib.drv/dibdrvbitmap.c ++++ b/dlls/winedib.drv/dibdrvbitmap.c +@@ -142,6 +142,33 @@ void *_DIBDRVBITMAP_Get_Bits(DIBDRVBITMAP * dib) + } + } + ++/* calculates and sets the lightest color for monochrome bitmaps */ ++int _DIBDRVBITMAP_GetLightestColorIndex(DIBDRVBITMAP *dib) ++{ ++ DWORD foreRed, foreGreen, foreBlue; ++ DWORD backRed, backGreen, backBlue; ++ RGBQUAD *fore, *back; ++ ++ /* zero for non-monochrome bitmaps */ ++ if(dib->bitCount != 1) ++ return 0; ++ /* just in case color table hasn't been grabbed yet */ ++ if(!dib->colorTableGrabbed) ++ return 1; ++ back = dib->colorTable; ++ fore = back + 1; ++ foreRed = fore->rgbRed; foreGreen = fore->rgbGreen; foreBlue = fore->rgbBlue; ++ backRed = back->rgbRed; backGreen = back->rgbGreen; backBlue = back->rgbBlue; ++ if(foreRed*foreRed + foreGreen*foreGreen + foreBlue*foreBlue > ++ backRed*backRed + backGreen*backGreen + backBlue*backBlue) ++ { ++ dib->lightColor = 1; ++ return 1; ++ } ++ dib->lightColor = 0; ++ return 0; ++} ++ + /* initializes dib from a bitmap : + dib dib being initialized + bi source BITMAPINFOHEADER with required DIB format info +@@ -264,6 +291,9 @@ BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, c + memcpy(dib->colorTable, colorTable, + dib->colorTableSize * sizeof(dib->colorTable[0])); + dib->colorTableGrabbed = TRUE; ++ ++ /* for monochrome bitmaps, we need the 'lightest' color */ ++ _DIBDRVBITMAP_GetLightestColorIndex(dib); + } + else if(!dib->colorTableSize) + /* no color table on more than 8 bits/pixel */ +@@ -273,16 +303,64 @@ BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, c + return TRUE; + } + +-BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi) ++DIBDRVBITMAP *_DIBDRVBITMAP_CreateFromBMIH(const BITMAPINFOHEADER *bi, const DWORD *bit_fields, ++ const RGBQUAD *colorTable, void *bits) ++{ ++ DIBDRVBITMAP *bmp = _DIBDRVBITMAP_New(); ++ if(bmp && !_DIBDRVBITMAP_InitFromBMIH(bmp, bi, bit_fields, colorTable, bits)) ++ { ++ _DIBDRVBITMAP_Free(bmp); ++ bmp = NULL; ++ } ++ return bmp; ++} ++ ++/* gets a BITMAPINFOHEADER from a soure BITMAPINFO- or BITMAPCORE-header */ ++static BITMAPINFOHEADER *GetBitmapInfoHeader(BITMAPINFO const *bmi) ++{ ++ BITMAPINFOHEADER *res = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER)); ++ ++ int size = bmi->bmiHeader.biSize; ++ if(size >= sizeof(BITMAPINFOHEADER)) ++ { ++ memcpy(res, bmi, sizeof(BITMAPINFOHEADER)); ++ res->biSize = sizeof(BITMAPINFOHEADER); ++ } ++ else if(size == sizeof(BITMAPCOREHEADER)) ++ { ++ BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)bmi; ++ res->biSize = sizeof(BITMAPINFOHEADER); ++ res->biWidth = core->bcWidth; ++ res->biHeight = core->bcHeight; ++ res->biPlanes = core->bcPlanes; ++ res->biBitCount = core->bcBitCount; ++ } ++ else ++ { ++ HeapFree(GetProcessHeap(), 0, res); ++ ERR("Bad/unknown header size %d\n", size); ++ res = NULL; ++ } ++ return res; ++} ++ ++BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi, void *bits) + { + static const DWORD bit_fields_DIB32_RGB[3] = {0xff0000, 0x00ff00, 0x0000ff}; + static const DWORD bit_fields_DIB16_RGB[3] = {0x7c00, 0x03e0, 0x001f}; +- BITMAPINFOHEADER *bi = (BITMAPINFOHEADER *)bmi; + const DWORD *masks = NULL; + RGBQUAD *colorTable = NULL; +- BYTE *ptr = (BYTE*)bmi + bi->biSize; +- int num_colors = bi->biClrUsed; ++ BITMAPINFOHEADER *bi; ++ BYTE *ptr; ++ int num_colors; + BOOL res; ++ ++ /* gets info header */ ++ if(!(bi = GetBitmapInfoHeader(bmi))) ++ return FALSE; ++ ++ ptr = (BYTE*)bmi + bmi->bmiHeader.biSize; ++ num_colors = bi->biClrUsed; + + MAYBE(TRACE("dib=%p, bmi=%p\n", dib, bmi)); + +@@ -302,11 +380,23 @@ BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi) + colorTable = (RGBQUAD*)ptr; + ptr += num_colors * sizeof(*colorTable); + +- res = _DIBDRVBITMAP_InitFromBMIH(dib, bi, masks, colorTable, ptr); ++ res = _DIBDRVBITMAP_InitFromBMIH(dib, bi, masks, colorTable, bits ? bits : ptr); ++ HeapFree(GetProcessHeap(), 0, bi); + MAYBE(TRACE("END\n")); + return res; + } + ++DIBDRVBITMAP *_DIBDRVBITMAP_CreateFromBitmapinfo(const BITMAPINFO *bmi, void *bits) ++{ ++ DIBDRVBITMAP *bmp = _DIBDRVBITMAP_New(); ++ if(bmp && !_DIBDRVBITMAP_InitFromBitmapinfo(bmp, bmi, bits)) ++ { ++ _DIBDRVBITMAP_Free(bmp); ++ bmp = NULL; ++ } ++ return bmp; ++} ++ + /* initializes a DIBRDVBITMAP copying it from a source one + Parameters : + dib destination DIBDRVBITMAP +@@ -335,6 +425,8 @@ BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *s + + dib->funcs = src->funcs; + ++ dib->lightColor = src->lightColor; ++ + if(copy) + { + int size = dib->height*abs(dib->stride); +@@ -378,92 +470,6 @@ BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *s + return TRUE; + } + +-/* initializes a DIBRDVBITMAP from a DIB HBITMAP +- Parameters : +- bmp destination DIBDRVBITMAP +- hbmp source HBITMAP +- copyPixels TRUE->copy source pixel array FALSE->link to source pixel array */ +-BOOL _DIBDRVBITMAP_InitFromHBITMAP(DIBDRVBITMAP *bmp, const HBITMAP hbmp, BOOL copyPixels) +-{ +- BITMAPINFO *destInfo; +- DIBSECTION ds; +- int size; +- +- MAYBE(TRACE("bmp=%p, hbmp=%p, copyPixels = %s\n", bmp, hbmp, copyPixels ? "TRUE" : "FALSE")); +- +- /* be sure bitmap is empty */ +- _DIBDRVBITMAP_Clear(bmp); +- +- /* gets source bitmap data */ +- if(!(size = GetObjectW(hbmp, sizeof(DIBSECTION), &ds))) +- { +- ERR("Failed getting bitmap object\n"); +- return FALSE; +- } +- if(size != sizeof(DIBSECTION)) +- { +- ERR("Bitmap is not a DIB section\n"); +- return FALSE; +- } +- +- destInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); +- if(!destInfo) +- { +- ERR("HeapAlloc failed\n"); +- return FALSE; +- } +- +- memcpy(destInfo, &ds.dsBmih, sizeof(BITMAPINFOHEADER)); +- if(ds.dsBmih.biCompression == BI_BITFIELDS) +- memcpy((BITMAPINFOHEADER *)destInfo + 1, ds.dsBitfields, 3 * sizeof(RGBQUAD)); +- else if(ds.dsBmih.biBitCount <= 8) +- { +- FIXME("Can't grab color table here.... syslvel lock\n"); +- return FALSE; +-#if 0 +- HDC refDC = CreateCompatibleDC(0); +- if(!refDC) +- { +- ERR("CreateCompatibleDC() failed\n"); +- return FALSE; +- } +- if(!GetDIBits(refDC, hbmp, 0, 1, NULL, destInfo, DIB_RGB_COLORS)) +- { +- DeleteDC(refDC); +- HeapFree(GetProcessHeap(), 0, destInfo); +- ERR("GetDIBits failed\n"); +- return FALSE; +- } +- DeleteDC(refDC); +-#endif +- } +- if(!_DIBDRVBITMAP_InitFromBitmapinfo(bmp, destInfo)) +- { +- HeapFree(GetProcessHeap(), 0, destInfo); +- ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); +- return FALSE; +- } +- HeapFree(GetProcessHeap(), 0, destInfo); +- if(copyPixels) +- { +- size = abs(bmp->stride) * bmp->height; +- if(!(bmp->bits = HeapAlloc(GetProcessHeap(), 0, size))) +- { +- ERR("HeapAlloc failed\n"); +- _DIBDRVBITMAP_Free(bmp); +- return FALSE; +- } +- memcpy(bmp->bits, ds.dsBm.bmBits, size); +- bmp->ownsBits = TRUE; +- } +- else +- bmp->bits = ds.dsBm.bmBits; +- if(bmp->stride < 0) +- bmp->bits = (BYTE*)bmp->bits - (bmp->height - 1) * bmp->stride; +- +- return TRUE; +-} +- + + /* creates a DIBRDVBITMAP copying format info from a source one + Parameters : +@@ -512,6 +518,8 @@ void _DIBDRVBITMAP_Clear(DIBDRVBITMAP *bmp) + { + MAYBE(TRACE("bmp=%p\n", bmp)); + ++ if(!bmp) ++ return; + bmp->bits = NULL; + bmp->ownsBits = FALSE; + bmp->colorTable = NULL; +@@ -521,11 +529,23 @@ void _DIBDRVBITMAP_Clear(DIBDRVBITMAP *bmp) + MAYBE(TRACE("END\n")); + } + ++/* allocates a new DIBDTVBITMAP */ ++DIBDRVBITMAP *_DIBDRVBITMAP_New(void) ++{ ++ DIBDRVBITMAP *bmp = HeapAlloc(GetProcessHeap(), 0, sizeof(DIBDRVBITMAP)); ++ if(!bmp) ++ return NULL; ++ _DIBDRVBITMAP_Clear(bmp); ++ return bmp; ++} ++ + /* Frees a DIBDRVBITMAP structure data */ + void _DIBDRVBITMAP_Free(DIBDRVBITMAP *bmp) + { + MAYBE(TRACE("bmp=%p\n", bmp)); + ++ if(!bmp) ++ return; + /* frees bits, if needed */ + if(bmp->bits && bmp->ownsBits) + { +@@ -535,17 +555,12 @@ void _DIBDRVBITMAP_Free(DIBDRVBITMAP *bmp) + bmp->bits = (BYTE *)bmp->bits + bmp->stride * (bmp->height -1); + HeapFree(GetProcessHeap(), 0, bmp->bits); + } +- bmp->ownsBits = FALSE; +- bmp->bits = NULL; +- + /* frees color table */ + if(bmp->colorTable) + HeapFree(GetProcessHeap(), 0, bmp->colorTable); +- bmp->colorTable = NULL; +- bmp->colorTableSize = 0; +- bmp->colorTableGrabbed = FALSE; ++ ++ HeapFree(GetProcessHeap(), 0, bmp); + +- MAYBE(TRACE("END\n")); + } + + +diff --git a/dlls/winedib.drv/font.c b/dlls/winedib.drv/font.c +index f7ea8dc..bcfbaba 100644 +--- a/dlls/winedib.drv/font.c ++++ b/dlls/winedib.drv/font.c +@@ -93,7 +93,7 @@ COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + + #ifdef DIBDRV_ANTIALIASED_FONTS + /* fills the text color table used on antialiased font display */ +- if(physDev->physBitmap.funcs) ++ if(physDev->physBitmap->funcs) + { + BYTE r, g, b; + INT i; +@@ -103,7 +103,7 @@ COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + b = GetBValue(color); + for(i = 0; i < 256; i++) + { +- physDev->textColorTable[i] = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, RGB( ++ physDev->textColorTable[i] = physDev->physBitmap->funcs->ColorToPixel(physDev->physBitmap, RGB( + MulDiv(r, i, 255), + MulDiv(g, i, 255), + MulDiv(b, i, 255) +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +index 8e2c12e..0d2d607 100644 +--- a/dlls/winedib.drv/graphics.c ++++ b/dlls/winedib.drv/graphics.c +@@ -517,7 +517,7 @@ COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, int x, int y ) + if(physDev->hasDIB) + { + _DIBDRV_Position_ws2ds(physDev, &x, &y); +- res = physDev->physBitmap.funcs->GetPixel(&physDev->physBitmap, x, y); ++ res = physDev->physBitmap->funcs->GetPixel(physDev->physBitmap, x, y); + } + else + { +@@ -976,18 +976,18 @@ COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, int x, int y, COLORREF color ) + color = _DIBDRV_MapColor(physDev, color); + + /* map to pixel color / palette index */ +- color = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, color); ++ color = physDev->physBitmap->funcs->ColorToPixel(physDev->physBitmap, color); + + _DIBDRV_Position_ws2ds(physDev, &x, &y); + + /* gets previous pixel */ +- res = physDev->physBitmap.funcs->GetPixel(&physDev->physBitmap, x, y); ++ res = physDev->physBitmap->funcs->GetPixel(physDev->physBitmap, x, y); + + /* calculates AND and XOR from color */ + _DIBDRV_CalcAndXorMasks(GetROP2(physDev->hdc), color, &and, &xor); + + /* sets the pixel */ +- physDev->physBitmap.funcs->SetPixel(&physDev->physBitmap, x, y, and, xor); ++ physDev->physBitmap->funcs->SetPixel(physDev->physBitmap, x, y, and, xor); + } + else + { +diff --git a/dlls/winedib.drv/palette.c b/dlls/winedib.drv/palette.c +index 87016da..301cf1d 100644 +--- a/dlls/winedib.drv/palette.c ++++ b/dlls/winedib.drv/palette.c +@@ -38,12 +38,12 @@ COLORREF _DIBDRV_MapColor(DIBDRVPHYSDEV *physDev, COLORREF color) + case 0x10 : /* DIBINDEX */ + MAYBE(TRACE("DIBINDEX Color is %08x\n", color)); + index = color & 0xffff; +- if(index >= physDev->physBitmap.colorTableSize) ++ if(index >= physDev->physBitmap->colorTableSize) + { +- WARN("DIBINDEX color out of range\n"); ++ WARN("DIBINDEX color %d out of range, color table size is %d\n", index, physDev->physBitmap->colorTableSize); + return 0; + } +- palColor = physDev->physBitmap.colorTable + index; ++ palColor = physDev->physBitmap->colorTable + index; + MAYBE(TRACE("Returning color %08x\n", RGB(palColor->rgbRed, palColor->rgbGreen, palColor->rgbBlue))); + return RGB(palColor->rgbRed, palColor->rgbGreen, palColor->rgbBlue); + +@@ -64,24 +64,36 @@ COLORREF _DIBDRV_MapColor(DIBDRVPHYSDEV *physDev, COLORREF color) + return RGB(paletteEntry.peRed, paletteEntry.peGreen, paletteEntry.peBlue); + + case 0x02: /* PALETTERGB */ +- return _DIBDRV_GetNearestColor(&physDev->physBitmap, color & 0xffffff); ++ return _DIBDRV_GetNearestColor(physDev->physBitmap, color & 0xffffff); + + default: + /* RGB color -- we must process special case for monochrome bitmaps */ +- if(physDev->physBitmap.bitCount == 1) ++ if(physDev->physBitmap->bitCount == 1) + { +- RGBQUAD *back = physDev->physBitmap.colorTable; ++ RGBQUAD *back = physDev->physBitmap->colorTable; + RGBQUAD *fore = back+1; +- if(fore->rgbRed * fore->rgbRed + fore->rgbGreen * fore->rgbGreen + fore->rgbBlue * fore->rgbBlue < +- back->rgbRed * back->rgbRed + back->rgbGreen * back->rgbGreen + back->rgbBlue * back->rgbBlue) ++ COLORREF lightColorref, darkColorref; ++ ++ /* lightest color is considered to be 'foreground' one, i.e. associated to white color */ ++ if(physDev->physBitmap->lightColor == 1) + { +- fore = back; +- back = fore + 1; ++ darkColorref = RGB(back->rgbRed, back->rgbGreen, back->rgbBlue); ++ lightColorref = RGB(fore->rgbRed, fore->rgbGreen, fore->rgbBlue); + } +- if ( ((color >> 16) & 0xff) + ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) +- return RGB(fore->rgbRed, fore->rgbGreen, fore->rgbBlue); + else +- return RGB(back->rgbRed, back->rgbGreen, back->rgbBlue); ++ { ++ darkColorref = RGB(fore->rgbRed, fore->rgbGreen, fore->rgbBlue); ++ lightColorref = RGB(back->rgbRed, back->rgbGreen, back->rgbBlue); ++ } ++ ++ /* tested on Windows XP -- if present in colortable, maps to corresponding color ++ if not, if white maps to the lightest color, otherwise darkest one. */ ++ if(color == lightColorref || color == darkColorref) ++ return color; ++ else if (color == 0x00ffffff) ++ return lightColorref; ++ else ++ return darkColorref; + } + else + return color; +@@ -200,20 +212,24 @@ UINT DIBDRV_RealizeDefaultPalette( DIBDRVPHYSDEV *physDev ) + /* HACK - we can't get the dib color table during SelectBitmap since it hasn't + been initialized yet. This is called from DC_InitDC so it's a convenient place + to grab the color table. */ +- MAYBE(TRACE("Color table size = %d, Color table = %p\n", physDev->physBitmap.colorTableSize, physDev->physBitmap.colorTable)); +- if(!physDev->physBitmap.colorTableGrabbed) ++ MAYBE(TRACE("Color table size = %d, Color table = %p\n", physDev->physBitmap->colorTableSize, physDev->physBitmap->colorTable)); ++ if(!physDev->physBitmap->colorTableGrabbed) + { + MAYBE(TRACE("Grabbing palette\n")); +- physDev->physBitmap.colorTable = HeapAlloc(GetProcessHeap(), 0, sizeof(physDev->physBitmap.colorTable[0]) * physDev->physBitmap.colorTableSize); +- GetDIBColorTable(physDev->hdc, 0, physDev->physBitmap.colorTableSize, physDev->physBitmap.colorTable); ++ physDev->physBitmap->colorTable = HeapAlloc(GetProcessHeap(), 0, sizeof(physDev->physBitmap->colorTable[0]) * physDev->physBitmap->colorTableSize); ++ GetDIBColorTable(physDev->hdc, 0, physDev->physBitmap->colorTableSize, physDev->physBitmap->colorTable); + #ifdef DIBDRV_ENABLE_MAYBE +- for(i = 0; i < physDev->physBitmap.colorTableSize; i++) ++ for(i = 0; i < physDev->physBitmap->colorTableSize; i++) + { +- q = physDev->physBitmap.colorTable + i; ++ q = physDev->physBitmap->colorTable + i; + TRACE(" %03d : R%03d G%03d B%03d\n", i, q->rgbRed, q->rgbGreen, q->rgbBlue); + } + #endif +- physDev->physBitmap.colorTableGrabbed = TRUE; ++ physDev->physBitmap->colorTableGrabbed = TRUE; ++ ++ /* for monochrome bitmaps, we need the 'lightest' color */ ++ _DIBDRVBITMAP_GetLightestColorIndex(physDev->physBitmap); ++ + } + res = 0; + } +diff --git a/dlls/winedib.drv/pen_brush.c b/dlls/winedib.drv/pen_brush.c +index c40bfaf..32d50fb 100644 +--- a/dlls/winedib.drv/pen_brush.c ++++ b/dlls/winedib.drv/pen_brush.c +@@ -48,20 +48,20 @@ static inline void OrderEndPoints(int *s, int *e) + static void SolidPenHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + { + OrderEndPoints(&x1, &x2); +- physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x1, x2, y, physDev->penAnd, physDev->penXor); ++ physDev->physBitmap->funcs->SolidHLine(physDev->physBitmap, x1, x2, y, physDev->penAnd, physDev->penXor); + } + + static void SolidPenVLine(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) + { + OrderEndPoints(&y1, &y2); +- physDev->physBitmap.funcs->SolidVLine(&physDev->physBitmap, x, y1, y2, physDev->penAnd, physDev->penXor); ++ physDev->physBitmap->funcs->SolidVLine(physDev->physBitmap, x, y1, y2, physDev->penAnd, physDev->penXor); + } + + static void WINAPI SolidPenLineCallback(int x, int y, LPARAM lparam) + { + DIBDRVPHYSDEV *physDev = (DIBDRVPHYSDEV *)lparam; + +- physDev->physBitmap.funcs->SetPixel(&physDev->physBitmap, x, y, physDev->penAnd, physDev->penXor); ++ physDev->physBitmap->funcs->SetPixel(physDev->physBitmap, x, y, physDev->penAnd, physDev->penXor); + return; + } + +@@ -120,7 +120,7 @@ static void DashedPenHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + if(x + dashLen > x2) + dashLen = x2 - x; + +- physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x, x + dashLen, y, and, xor); ++ physDev->physBitmap->funcs->SolidHLine(physDev->physBitmap, x, x + dashLen, y, and, xor); + x += dashLen; + + physDev->leftInDash -= dashLen; +@@ -137,7 +137,7 @@ static void DashedPenHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + if(x - (int)dashLen < x2) + dashLen = x - x2; + +- physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x - dashLen + 1, x + 1, y, and, xor); ++ physDev->physBitmap->funcs->SolidHLine(physDev->physBitmap, x - dashLen + 1, x + 1, y, and, xor); + x -= dashLen; + + physDev->leftInDash -= dashLen; +@@ -162,7 +162,7 @@ static void DashedPenVLine(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) + if(y + dashLen > y2) + dashLen = y2 - y; + +- physDev->physBitmap.funcs->SolidVLine(&physDev->physBitmap, x, y, y + dashLen, and, xor); ++ physDev->physBitmap->funcs->SolidVLine(physDev->physBitmap, x, y, y + dashLen, and, xor); + y += dashLen; + + physDev->leftInDash -= dashLen; +@@ -179,7 +179,7 @@ static void DashedPenVLine(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) + if(y - (int)dashLen < y2) + dashLen = y - y2; + +- physDev->physBitmap.funcs->SolidVLine(&physDev->physBitmap, x, y - dashLen + 1, y + 1, and, xor); ++ physDev->physBitmap->funcs->SolidVLine(physDev->physBitmap, x, y - dashLen + 1, y + 1, and, xor); + y -= dashLen; + + physDev->leftInDash -= dashLen; +@@ -195,7 +195,7 @@ static void WINAPI DashedPenLineCallback(int x, int y, LPARAM lparam) + + GetDashColors(physDev, &and, &xor); + +- physDev->physBitmap.funcs->SetPixel(&physDev->physBitmap, x, y, and, xor); ++ physDev->physBitmap->funcs->SetPixel(physDev->physBitmap, x, y, and, xor); + + physDev->leftInDash--; + NextDash(physDev); +@@ -222,8 +222,8 @@ void _DIBDRV_ResetDashOrigin(DIBDRVPHYSDEV *physDev) + the background color is used -- tested on WinXP */ + static DWORD AdjustFgColor(DIBDRVPHYSDEV *physDev, COLORREF color) + { +- RGBQUAD *back = physDev->physBitmap.colorTable; +- RGBQUAD *fore = physDev->physBitmap.colorTable+1; ++ RGBQUAD *back = physDev->physBitmap->colorTable; ++ RGBQUAD *fore = physDev->physBitmap->colorTable+1; + + if( + fore->rgbRed == GetRValue(color) && +@@ -270,9 +270,9 @@ static DWORD AdjustFgColor(DIBDRVPHYSDEV *physDev, COLORREF color) + rgb.rgbGreen = GetGValue(color); + rgb.rgbBlue = GetBValue(color); + +- for(i = 0; i < physDev->physBitmap.colorTableSize; i++) ++ for(i = 0; i < physDev->physBitmap->colorTableSize; i++) + { +- RGBQUAD *cur = physDev->physBitmap.colorTable + i; ++ RGBQUAD *cur = physDev->physBitmap->colorTable + i; + if((rgb.rgbRed == cur->rgbRed) && (rgb.rgbGreen == cur->rgbGreen) && (rgb.rgbBlue == cur->rgbBlue)) + return i; + } +@@ -298,7 +298,7 @@ static void FixupFgColors1(DIBDRVPHYSDEV *physDev) + static void SolidBrushHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + { + OrderEndPoints(&x1, &x2); +- physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x1, x2, y, physDev->brushAnd, physDev->brushXor); ++ physDev->physBitmap->funcs->SolidHLine(physDev->physBitmap, x1, x2, y, physDev->brushAnd, physDev->brushXor); + } + + +@@ -324,16 +324,16 @@ static void GenerateMasks(DIBDRVPHYSDEV *physDev, DIBDRVBITMAP *bmp, DWORD **and + + static void PatternBrushHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + { +- DWORD *and, *xor, brushY = y % physDev->brushBitmap.height; ++ DWORD *and, *xor, brushY = y % physDev->brushBitmap->height; + + if(!physDev->brushAnds) +- GenerateMasks(physDev, &physDev->brushBitmap, &physDev->brushAnds, &physDev->brushXors); ++ GenerateMasks(physDev, physDev->brushBitmap, &physDev->brushAnds, &physDev->brushXors); + + OrderEndPoints(&x1, &x2); +- and = (DWORD *)((char *)physDev->brushAnds + brushY * physDev->brushBitmap.stride); +- xor = (DWORD *)((char *)physDev->brushXors + brushY * physDev->brushBitmap.stride); ++ and = (DWORD *)((char *)physDev->brushAnds + brushY * physDev->brushBitmap->stride); ++ xor = (DWORD *)((char *)physDev->brushXors + brushY * physDev->brushBitmap->stride); + +- physDev->physBitmap.funcs->PatternHLine(&physDev->physBitmap, x1, x2, y, and, xor, physDev->brushBitmap.width, x1 % physDev->brushBitmap.width); ++ physDev->physBitmap->funcs->PatternHLine(physDev->physBitmap, x1, x2, y, and, xor, physDev->brushBitmap->width, x1 % physDev->brushBitmap->width); + } + + /* null function for PS_NULL and BS_NULL pen and brush styles */ +@@ -356,8 +356,10 @@ HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen ) + { + GetObjectW(hpen, sizeof(logpen), &logpen); + +- physDev->penColorref = _DIBDRV_MapColor(physDev, logpen.lopnColor); +- physDev->penColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, physDev->penColorref); ++ physDev->penColorref = logpen.lopnColor; ++ physDev->penColor = physDev->physBitmap->funcs->ColorToPixel( ++ physDev->physBitmap, ++ _DIBDRV_MapColor(physDev, physDev->penColorref)); + + _DIBDRV_CalcAndXorMasks(GetROP2(physDev->hdc), physDev->penColor, &physDev->penAnd, &physDev->penXor); + +@@ -441,8 +443,10 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + GetObjectW(hbrush, sizeof(logbrush), &logbrush); + + /* frees any currently selected DIB brush and cache */ +- _DIBDRVBITMAP_Free(&physDev->brushBitmap); +- _DIBDRVBITMAP_Free(&physDev->brushBmpCache); ++ _DIBDRVBITMAP_Free(physDev->brushBitmap); ++ physDev->brushBitmap = NULL; ++ _DIBDRVBITMAP_Free(physDev->brushBmpCache); ++ physDev->brushBmpCache = NULL; + if(physDev->brushAnds) + { + HeapFree(GetProcessHeap(), 0, physDev->brushAnds); +@@ -459,13 +463,15 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + goto solid; + + case BS_SOLID: +- physDev->brushColorref = _DIBDRV_MapColor(physDev, logbrush.lbColor); ++ physDev->brushColorref = logbrush.lbColor; + solid: + MAYBE(TRACE("SOLID Pattern -- color is %x\n", physDev->brushColorref)); + physDev->brushStyle = BS_SOLID; + physDev->brushHLine = SolidBrushHLine; + +- physDev->brushColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, physDev->brushColorref); ++ physDev->brushColor = physDev->physBitmap->funcs->ColorToPixel( ++ physDev->physBitmap, ++ _DIBDRV_MapColor(physDev, physDev->brushColorref)); + + _DIBDRV_CalcAndXorMasks(physDev->rop2, physDev->brushColor, + &physDev->brushAnd, &physDev->brushXor); +@@ -485,7 +491,7 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + FIXME("DIB Pattern\n"); + + /* if no DIB selected in, fallback to null brush */ +- if(!physDev->physBitmap.bits) ++ if(!physDev->physBitmap->bits) + { + physDev->brushColorref = 0; + goto solid; +@@ -495,7 +501,7 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + bmi = GlobalLock16(logbrush.lbHatch); + + /* initializes a temporary DIB with brush's one */ +- if(!_DIBDRVBITMAP_InitFromBitmapinfo(&src, bmi)) ++ if(!_DIBDRVBITMAP_InitFromBitmapinfo(&src, bmi, NULL)) + { + ERR("Failed to initialize brush DIB\n"); + res = 0; +@@ -503,7 +509,7 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + } + + /* converts brush bitmap to match currently selected one's format */ +- if(!_DIBDRVBITMAP_Convert(&physDev->brushBitmap, &src, &physDev->physBitmap)) ++ if(!_DIBDRVBITMAP_Convert(physDev->brushBitmap, &src, physDev->physBitmap)) + { + ERR("Failed to convert brush DIB\n"); + _DIBDRVBITMAP_Free(&src); +@@ -537,7 +543,9 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + { + MAYBE(TRACE("NULL Pattern\n")); + physDev->brushColorref = 0; +- physDev->brushColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, 0); ++ physDev->brushColor = physDev->physBitmap->funcs->ColorToPixel( ++ physDev->physBitmap, ++ _DIBDRV_MapColor(physDev, 0)); + physDev->brushHLine = NullBrushHLine; + break; + } +@@ -644,7 +652,7 @@ COLORREF DIBDRV_SetBkColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + if(physDev->hasDIB) + { + physDev->backgroundColor = _DIBDRV_MapColor(physDev, color); +- physDev->backgroundColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, physDev->backgroundColor); ++ physDev->backgroundColor = physDev->physBitmap->funcs->ColorToPixel(physDev->physBitmap, physDev->backgroundColor); + + _DIBDRV_CalcAndXorMasks(physDev->rop2, physDev->backgroundColor, &physDev->backgroundAnd, &physDev->backgroundXor); + +diff --git a/dlls/winedib.drv/primitives_bitblt.c b/dlls/winedib.drv/primitives_bitblt.c +index 27d573f..3505277 100644 +--- a/dlls/winedib.drv/primitives_bitblt.c ++++ b/dlls/winedib.drv/primitives_bitblt.c +@@ -169,8 +169,8 @@ BOOL _DIBDRV_AlphaBlend_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + BYTE constAlpha = blendFn.SourceConstantAlpha; + + /* source and dest bitmaps */ +- const DIBDRVBITMAP *srcBmp = &physDevSrc->physBitmap; +- DIBDRVBITMAP *dstBmp = &physDevDst->physBitmap; ++ const DIBDRVBITMAP *srcBmp = physDevSrc->physBitmap; ++ DIBDRVBITMAP *dstBmp = physDevDst->physBitmap; + + /* source and destination line buffers */ + DWORD *sBuf = HeapAlloc(GetProcessHeap(), 0, abs(srcBmp->stride)); +@@ -403,15 +403,15 @@ BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + + /* gets source, dest and pattern bitmaps, if available */ + if(usePat && physDevDst->isBrushBitmap) +- patBmp = &physDevDst->brushBmpCache; ++ patBmp = physDevDst->brushBmpCache; + else + patBmp = NULL; + + if(useSrc) +- srcBmp = &physDevSrc->physBitmap; ++ srcBmp = physDevSrc->physBitmap; + else + srcBmp = NULL; +- dstBmp = &physDevDst->physBitmap; ++ dstBmp = physDevDst->physBitmap; + + /* gets pattern color, in case it's needed + it's NOT the COLORREF value (colors are swapped +@@ -656,15 +656,15 @@ BOOL _DIBDRV_StretchBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + + /* gets source, dest and pattern bitmaps, if available */ + if(usePat && physDevDst->isBrushBitmap) +- patBmp = &physDevDst->brushBmpCache; ++ patBmp = physDevDst->brushBmpCache; + else + patBmp = NULL; + + if(useSrc) +- srcBmp = &physDevSrc->physBitmap; ++ srcBmp = physDevSrc->physBitmap; + else + srcBmp = NULL; +- dstBmp = &physDevDst->physBitmap; ++ dstBmp = physDevDst->physBitmap; + + /* gets pattern color, in case it's needed + it's NOT the COLORREF value (colors are swapped +diff --git a/dlls/winedib.drv/primitives_color.c b/dlls/winedib.drv/primitives_color.c +index 6c42b44..93baf43 100644 +--- a/dlls/winedib.drv/primitives_color.c ++++ b/dlls/winedib.drv/primitives_color.c +@@ -142,32 +142,30 @@ DWORD _DIBDRV_GetNearestColorIndex(const DIBDRVBITMAP *dib, COLORREF color) + + DWORD _DIBDRV_ColorToPixelColortable(const DIBDRVBITMAP *dib, COLORREF color) + { +- DWORD r, g, b; +- +- r = GetRValue(color); +- g = GetGValue(color); +- b = GetBValue(color); +- + /* just in case it's being called without color table + properly initialized */ + if(!dib->colorTableGrabbed) + return 0; + ++ color &= 0xffffff; ++ + /* for monochrome bitmaps, color is : + foreground if matching foreground ctable + else background if matching background ctable +- else foreground ix 0xffffff ++ else foreground if 0xffffff + else background */ + if(dib->colorTableSize == 2) + { + RGBQUAD *back = dib->colorTable; + RGBQUAD *fore = dib->colorTable + 1; +- if(r == fore->rgbRed && g == fore->rgbGreen && b == fore->rgbBlue) ++ COLORREF backColorref = RGB(back->rgbRed, back->rgbGreen, back->rgbBlue); ++ COLORREF foreColorref = RGB(fore->rgbRed, fore->rgbGreen, fore->rgbBlue); ++ if(color == foreColorref) + return 1; +- else if(r == back->rgbRed && g == back->rgbGreen && b == back->rgbBlue) ++ else if(color == backColorref) + return 0; +- if((color & 0xffffff) == 0xffffff) +- return 1; ++ else if(color == 0xffffff) ++ return dib->lightColor; + else + return 0; + } +diff --git a/dlls/winedib.drv/primitives_convert.c b/dlls/winedib.drv/primitives_convert.c +index 24a5e77..7c4da14 100644 +--- a/dlls/winedib.drv/primitives_convert.c ++++ b/dlls/winedib.drv/primitives_convert.c +@@ -537,6 +537,9 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + /* get foreground color */ + DWORD back = *(DWORD *)bmp->colorTable & 0x00ffffff; + DWORD fore = *((DWORD *)bmp->colorTable + 1) & 0x00ffffff; ++ ++ /* get 'light' color */ ++ int lightColor = bmp->lightColor; + + /* put first partial byte, if any */ + startx &= 0x07; +@@ -553,7 +556,7 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + b |= mask; + else if(c == back) + b &= !mask; +- else if(c == 0x00ffffff) ++ else if((c == 0x00ffffff && lightColor) || (c == 0 && !lightColor)) + b |= mask; + else + b &= !mask; +@@ -570,7 +573,7 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + for(i = 0 ; i < 8 ; i++) + { + c = *dwBuf++ & 0x00ffffff; +- if(c == fore || (c == 0x00ffffff && c != back)) ++ if(c == fore || (c == 0x00ffffff && c != back && lightColor) || (c == 0 && !lightColor)) + b |= mask; + mask >>= 1; + } +@@ -589,7 +592,7 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + b |= mask; + else if(c == back) + b &= !mask; +- else if(c == 0x00ffffff) ++ else if((c == 0x00ffffff && lightColor) || (c == 0 && !lightColor)) + b |= mask; + else + b &= !mask; +diff --git a/dlls/winedib.drv/primitives_font.c b/dlls/winedib.drv/primitives_font.c +index e604a39..a2824a5 100644 +--- a/dlls/winedib.drv/primitives_font.c ++++ b/dlls/winedib.drv/primitives_font.c +@@ -31,7 +31,7 @@ void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clip + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -84,7 +84,7 @@ void _DIBDRV_freetype_blit_32_RGB(DIBDRVPHYSDEV *physDev, int x, int y, RECT *cl + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -137,7 +137,7 @@ void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, RE + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -189,7 +189,7 @@ void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRe + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -241,7 +241,7 @@ void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, RECT *cl + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -293,7 +293,7 @@ void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, RE + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -345,7 +345,7 @@ void _DIBDRV_freetype_blit_8(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -375,7 +375,7 @@ void _DIBDRV_freetype_blit_4(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +@@ -405,7 +405,7 @@ void _DIBDRV_freetype_blit_1(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRec + { + /* FIXME : MUST BE OPTIMIZED !!! */ + +- DIBDRVBITMAP *dib = &physDev->physBitmap; ++ DIBDRVBITMAP *dib = physDev->physBitmap; + int bmpX, bmpY; + BYTE *buf; + int dibX, dibY; +diff --git a/dlls/winedib.drv/text.c b/dlls/winedib.drv/text.c +index 0ae3575..94c7992 100644 +--- a/dlls/winedib.drv/text.c ++++ b/dlls/winedib.drv/text.c +@@ -120,7 +120,7 @@ BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + { + /* paints the backgound */ + for(iLine = tr.top; iLine < tr.bottom; iLine++) +- physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, ++ physDev->physBitmap->funcs->SolidHLine(physDev->physBitmap, + tr.left, tr.right-1, iLine, 0, backPixel); + } + } +@@ -187,7 +187,7 @@ BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + error = pFT_Glyph_To_Bitmap( + &glyph, + #ifdef DIBDRV_ANTIALIASED_FONTS +- physDev->physBitmap.bitCount > 8 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, ++ physDev->physBitmap->bitCount > 8 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, + #else + FT_RENDER_MODE_MONO, + #endif +@@ -220,7 +220,7 @@ BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + } + + /* now, draw to our target surface */ +- physDev->physBitmap.funcs->FreetypeBlit(physDev, x+bitmapGlyph->left, y-bitmapGlyph->top, &clipRec, bitmap); ++ physDev->physBitmap->funcs->FreetypeBlit(physDev, x+bitmapGlyph->left, y-bitmapGlyph->top, &clipRec, bitmap); + + /* frees converted bitmap, if any */ + if(bitmap != &bitmapGlyph->bitmap) --- wine1.2-1.1.43.orig/debian/patches/dibeng-0011.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0011.patch @@ -0,0 +1,434 @@ +DIB Engine: fix MapModes for xxxBlt + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/bitblt.c | 179 ++++++++++++++++++++++++++++--------------- + dlls/winedib.drv/convert.c | 14 +-- + dlls/winedib.drv/dibdrv.h | 7 ++ + dlls/winedib.drv/graphics.c | 38 +++++++++ + 4 files changed, 164 insertions(+), 74 deletions(-) + + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index b5b70f7..5fcc9e0 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -25,6 +25,23 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++void CheckMapping(const char *func, const char *s, DIBDRVPHYSDEV *physDev) ++{ ++ int a, b; ++ ++ if(!physDev) ++ return; ++ ++ a=10;b=20; ++ _DIBDRV_Position_ws2ds(physDev, &a, &b); ++ if(a != 10 || b != 20) ++ FIXME("%s:%s:Position(10, 20) translated to(%d, %d)\n", func, s, a, b); ++ a=10;b=20; ++ _DIBDRV_Sizes_ws2ds(physDev, &a, &b); ++ if(a != 10 || b != 20) ++ FIXME("%s:%s:sizes (10, 20) translated to(%d, %d)\n", func, s, a, b); ++} ++ + static inline void intSwap(int *a, int *b) + { + int tmp; +@@ -284,13 +301,8 @@ BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setSize(&szDst, widthDst, heightDst); + setSize(&szSrc, widthSrc, heightSrc); + setRect(&dstClip, 0, 0, physDevDst->physBitmap->width, physDevDst->physBitmap->height); +- if(physDevSrc) +- { +- setRect(&srcClip, 0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height); +- res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); +- } +- else +- res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); ++ setRect(&srcClip, 0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height); ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); + if(!res) + return TRUE; + xDst = pd.x; yDst = pd.y; +@@ -329,6 +341,9 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + POINT pd = {xDst, yDst}; + SIZE szDst = {widthDst, heightDst}; + ++CheckMapping(__FUNCTION__, "DEST", physDevDst); ++CheckMapping(__FUNCTION__, "SOURCE",physDevSrc); ++ + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", + physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevDst->physBitmap) : "", + xDst, yDst, widthDst, heightDst, +@@ -493,12 +508,12 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + INT xSrc, INT ySrc, DWORD rop ) + { + BOOL res; ++ int dummy; ++ int devXSrc, devWidth; ++ int devYSrc, devHeight, zeroYSrc; + +- /* clip blit area */ +- POINT pd = {xDst, yDst}; +- POINT ps = {xSrc, ySrc}; +- SIZE sz = {width, height}; +- ++CheckMapping(__FUNCTION__, "DEST", physDevDst); ++CheckMapping(__FUNCTION__, "SOURCE",physDevSrc); + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, width:%d, height:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, rop:%08x\n", + physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevDst->physBitmap) : "", + xDst, yDst, width, height, +@@ -508,9 +523,7 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + if(physDevDst->hasDIB) + { + /* DIB section selected in dest DC, use DIB Engine */ +- /* clip blit area */ +- RECT dstClip = {0, 0, physDevDst->physBitmap->width, physDevDst->physBitmap->height}; +- ++ + if(!physDevSrc || physDevSrc->hasDIB) + { + /* source is null or has a DIB, no need to convert anyting */ +@@ -520,12 +533,6 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + { + /* source is a DDB, must convert it to DIB */ + +- /* don't clip on source */ +- res = !BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); +- if(res) +- goto noBlt2; +- xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; +- + /* we must differentiate from 2 cases : + 1) source DC is a memory DC + 2) source DC is a device DC */ +@@ -541,7 +548,15 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + res = 0; + goto noBlt1; + } +- dib = _DIBDRV_ConvertDDBtoDIB(physDevSrc->hdc, ddb, ySrc, height); ++ ++ /* we need device coordinates for ySrc and height, as the conversion ++ functions operates directly on bitmap without the hdc */ ++ devYSrc = ySrc; ++ _DIBDRV_Position_ws2ds(physDevSrc, &dummy, &devYSrc); ++ devHeight = height; ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &dummy, &devHeight); ++ ++ dib = _DIBDRV_ConvertDDBtoDIB(physDevSrc->hdc, ddb, devYSrc, devHeight); + if(!dib) + { + ERR("Failed converting source DDB to DIB\n"); +@@ -550,7 +565,12 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + goto noBlt1; + } + SelectObject(physDevSrc->hdc, dib); +- res = _DIBDRV_InternalBitBlt(physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, 0, rop); ++ ++ /* we need to convert the '0' starting position on converted bitmap tp the world ++ space of bitmap's hdc */ ++ zeroYSrc = 0; ++ _DIBDRV_Position_ds2ws(physDevSrc, &dummy, &zeroYSrc); ++ res = _DIBDRV_InternalBitBlt(physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, zeroYSrc, rop); + SelectObject(physDevSrc->hdc, ddb); + DeleteObject(dib); + noBlt1: +@@ -562,7 +582,16 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + HBITMAP dib, stock; + HDC memHdc; + +- dib = _DIBDRV_ConvertDevDDBtoDIB(physDevSrc->hdc, physDevDst->hdc, xSrc, ySrc, width, height); ++ /* we need device coordinates for ySrc and height, as the conversion ++ functions operates directly on bitmap without the hdc */ ++ devXSrc = xSrc; ++ devYSrc = ySrc; ++ _DIBDRV_Position_ws2ds(physDevSrc, &devXSrc, &devYSrc); ++ devWidth = width; ++ devHeight = height; ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &devWidth, &devHeight); ++ ++ dib = _DIBDRV_ConvertDevDDBtoDIB(physDevSrc->hdc, physDevDst->hdc, devXSrc, devYSrc, devWidth, devHeight); + if(!dib) + { + ERR("Failed converting source DDB tp DIB for device DC\n"); +@@ -609,19 +638,6 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + { + /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ + HBITMAP dib, ddb; +- +- /* clip blit area */ +- if(physDevSrc) +- { +- RECT srcClip = {0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height}; +- res = !BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, 0); +- } +- else +- res = FALSE; +- if(res) +- goto noBlt3; +- xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; +- + dib = SelectObject(physDevSrc->hdc, GetStockObject(DEFAULT_BITMAP)); + if(!dib) + { +@@ -629,7 +645,15 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + res = 0; + goto noBlt3; + } +- ddb = _DIBDRV_ConvertDIBtoDDB(physDevSrc->hdc, dib, ySrc, height); ++ ++ /* we need device coordinates for ySrc and height, as the conversion ++ functions operates directly on bitmap without the hdc */ ++ devYSrc = ySrc; ++ _DIBDRV_Position_ws2ds(physDevSrc, &dummy, &devYSrc); ++ devHeight = height; ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &dummy, &devHeight); ++ ++ ddb = _DIBDRV_ConvertDIBtoDDB(physDevSrc->hdc, dib, devYSrc, devHeight); + if(!ddb) + { + ERR("Failed converting source DIB to DDB\n"); +@@ -638,8 +662,14 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + goto noBlt3; + } + SelectObject(physDevSrc->hdc, ddb); ++ ++ /* we need to convert the '0' starting position on converted bitmap tp the world ++ space of bitmap's hdc */ ++ zeroYSrc = 0; ++ _DIBDRV_Position_ds2ws(physDevSrc, &dummy, &zeroYSrc); ++ + res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, +- physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, 0, rop); ++ physDevSrc->X11PhysDev, xSrc, zeroYSrc, rop); + SelectObject(physDevSrc->hdc, dib); + DeleteObject(ddb); + noBlt3: +@@ -719,17 +749,16 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + INT widthSrc, INT heightSrc, DWORD rop ) + { + BOOL res; ++ int dummy; ++ int devXSrc, devWidthSrc; ++ int devYSrc, devHeightSrc, zeroYSrc; + +- /* clip blit area */ +- POINT pd = {xDst, yDst}; +- POINT ps = {xSrc, ySrc}; +- SIZE szDst = {widthDst, heightDst}; +- SIZE szSrc = {widthSrc, heightSrc}; +- + /* if source and dest sizes match, just call BitBlt(), it's faster */ + if(!physDevSrc || (widthDst == widthSrc && heightDst == heightSrc)) + return DIBDRV_BitBlt(physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, rop); + ++CheckMapping(__FUNCTION__, "DEST", physDevDst); ++CheckMapping(__FUNCTION__, "SOURCE",physDevSrc); + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d, rop:%08x\n", + physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(physDevDst->physBitmap) : "", + xDst, yDst, widthDst, heightDst, +@@ -764,7 +793,15 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + res = 0; + goto noBlt1; + } +- dib = _DIBDRV_ConvertDDBtoDIB(physDevSrc->hdc, ddb, ySrc, heightSrc); ++ ++ /* we need device coordinates for ySrc and height, as the conversion ++ functions operates directly on bitmap without the hdc */ ++ devYSrc = ySrc; ++ _DIBDRV_Position_ws2ds(physDevSrc, &dummy, &devYSrc); ++ devHeightSrc = heightSrc; ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &dummy, &devHeightSrc); ++ ++ dib = _DIBDRV_ConvertDDBtoDIB(physDevSrc->hdc, ddb, devYSrc, devHeightSrc); + if(!dib) + { + ERR("Failed converting source DDB to DIB\n"); +@@ -773,8 +810,15 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + goto noBlt1; + } + SelectObject(physDevSrc->hdc, dib); ++ ++ ++ /* we need to convert the '0' starting position on converted bitmap tp the world ++ space of bitmap's hdc */ ++ zeroYSrc = 0; ++ _DIBDRV_Position_ds2ws(physDevSrc, &dummy, &zeroYSrc); ++ + res = _DIBDRV_InternalStretchBlt(physDevDst, xDst, yDst, widthDst, heightDst, +- physDevSrc, xSrc, 0, widthSrc, heightSrc, rop); ++ physDevSrc, xSrc, zeroYSrc, widthSrc, heightSrc, rop); + SelectObject(physDevSrc->hdc, ddb); + DeleteObject(dib); + noBlt1: +@@ -786,7 +830,16 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + HBITMAP dib, stock; + HDC memHdc; + +- dib = _DIBDRV_ConvertDevDDBtoDIB(physDevSrc->hdc, physDevDst->hdc, xSrc, ySrc, widthSrc, heightSrc); ++ /* we need device coordinates for ySrc and height, as the conversion ++ functions operates directly on bitmap without the hdc */ ++ devXSrc = xSrc; ++ devYSrc = ySrc; ++ _DIBDRV_Position_ws2ds(physDevSrc, &devXSrc, &devYSrc); ++ devWidthSrc = widthSrc; ++ devHeightSrc = heightSrc; ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &devWidthSrc, &devHeightSrc); ++ ++ dib = _DIBDRV_ConvertDevDDBtoDIB(physDevSrc->hdc, physDevDst->hdc, devXSrc, devYSrc, devWidthSrc, devHeightSrc); + if(!dib) + { + ERR("Failed converting source DDB tp DIB for device DC\n"); +@@ -834,19 +887,6 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ + HBITMAP dib, ddb; + +- /* clip blit area */ +- if(physDevSrc) +- { +- RECT srcClip = {0, 0, physDevSrc->physBitmap->width, physDevSrc->physBitmap->height}; +- res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, 0); +- } +- else +- res = TRUE; +- if(!res) +- goto noBlt3; +- xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; +- xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; +- + dib = SelectObject(physDevSrc->hdc, GetStockObject(DEFAULT_BITMAP)); + if(!dib) + { +@@ -854,7 +894,15 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + res = 0; + goto noBlt3; + } +- ddb = _DIBDRV_ConvertDIBtoDDB(physDevSrc->hdc, dib, ySrc, heightSrc); ++ ++ /* we need device coordinates for ySrc and height, as the conversion ++ functions operates directly on bitmap without the hdc */ ++ devYSrc = ySrc; ++ _DIBDRV_Position_ws2ds(physDevSrc, &dummy, &devYSrc); ++ devHeightSrc = heightSrc; ++ _DIBDRV_Sizes_ws2ds(physDevSrc, &dummy, &devHeightSrc); ++ ++ ddb = _DIBDRV_ConvertDIBtoDDB(physDevSrc->hdc, dib, devYSrc, devHeightSrc); + if(!ddb) + { + ERR("Failed converting source DIB to DDB\n"); +@@ -870,8 +918,13 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + res = 0; + goto noBlt3; + } ++ ++ /* we need to convert the '0' starting position on converted bitmap tp the world ++ space of bitmap's hdc */ ++ zeroYSrc = 0; ++ _DIBDRV_Position_ds2ws(physDevSrc, &dummy, &zeroYSrc); + res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, +- physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, 0, widthSrc, heightSrc, rop); ++ physDevSrc->X11PhysDev, xSrc, zeroYSrc, widthSrc, heightSrc, rop); + SelectObject(physDevSrc->hdc, dib); + DeleteObject(ddb); + noBlt3: +diff --git a/dlls/winedib.drv/convert.c b/dlls/winedib.drv/convert.c +index 2f20ac1..8ee6ecd 100644 +--- a/dlls/winedib.drv/convert.c ++++ b/dlls/winedib.drv/convert.c +@@ -201,20 +201,12 @@ HBITMAP _DIBDRV_ConvertDDBtoDIB( HDC hdc, HBITMAP srcBmp, int startScan, int sca + bi->bmiHeader.biWidth = bitmap.bmWidth; + bi->bmiHeader.biHeight = scanLines; + bi->bmiHeader.biPlanes = bitmap.bmPlanes; +- bi->bmiHeader.biBitCount = 32; /* bitmap.bmBitsPixel; */ ++ bi->bmiHeader.biBitCount = 32; + bi->bmiHeader.biCompression = BI_RGB; + bi->bmiHeader.biSizeImage = 0; + +- /* Get the color table or the color masks */ +- /* NO NEED -- WE'RE REQUESTING A 32 bit DIB */ +-#if 0 +- if (!GetDIBits(hdc, srcBmp, startScan, scanLines, NULL, bi, DIB_RGB_COLORS)) +- { +- ERR("Couldn't get the color table/masks\n"); +- HeapFree( GetProcessHeap(), 0, bi ); +- return 0; +- } +-#endif ++ /* No need to get the color table or the color masks ++ as we're requesting a 32 bit rgba DIB */ + + /* Create bitmap and fill in bits */ + hBmp = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 4266703..6b72254 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -450,6 +450,13 @@ void _DIBDRV_Sizes_ws2ds(DIBDRVPHYSDEV *physDev, int *w, int *h); + /* converts a rectangle form Word space to Device space */ + void _DIBDRV_Rect_ws2ds(DIBDRVPHYSDEV *physDev, const RECT *src, RECT *dst); + ++/* converts positions from Device space to World space */ ++void _DIBDRV_Position_ds2ws(DIBDRVPHYSDEV *physDev, int *x, int *y); ++void _DIBDRV_Positions_ds2ws(DIBDRVPHYSDEV *physDev, int *x1, int *y1, int *x2, int *y2); ++ ++/* converts sizes from Device space to World space */ ++void _DIBDRV_Sizes_ds2ws(DIBDRVPHYSDEV *physDev, int *w, int *h); ++ + /* ********************************************************************* + * COLOR UTILITIES + * ********************************************************************/ +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +index 0d2d607..acbda6a 100644 +--- a/dlls/winedib.drv/graphics.c ++++ b/dlls/winedib.drv/graphics.c +@@ -381,6 +381,44 @@ void _DIBDRV_Sizes_ws2ds(DIBDRVPHYSDEV *physDev, int *w, int *h) + *h = pts[1].y - pts[0].y; + } + ++/* converts positions from Device space to World space */ ++void _DIBDRV_Position_ds2ws(DIBDRVPHYSDEV *physDev, int *x, int *y) ++{ ++ POINT p; ++ p.x = *x; ++ p.y = *y; ++ DPtoLP(physDev->hdc, &p, 1); ++ *x = p.x; ++ *y = p.y; ++} ++ ++void _DIBDRV_Positions_ds2ws(DIBDRVPHYSDEV *physDev, int *x1, int *y1, int *x2, int *y2) ++{ ++ POINT pts[2]; ++ pts[0].x = *x1; ++ pts[0].y = *y1; ++ pts[1].x = *x2; ++ pts[1].y = *y2; ++ DPtoLP(physDev->hdc, pts, 2); ++ *x1 = pts[0].x; ++ *y1 = pts[0].y; ++ *x2 = pts[1].x; ++ *y2 = pts[1].y; ++} ++ ++/* converts sizes from Device space to World space */ ++void _DIBDRV_Sizes_ds2ws(DIBDRVPHYSDEV *physDev, int *w, int *h) ++{ ++ POINT pts[2]; ++ pts[0].x = 0; ++ pts[0].y = 0; ++ pts[1].x = *w; ++ pts[1].y = *h; ++ DPtoLP(physDev->hdc, pts, 2); ++ *w = pts[1].x - pts[0].x; ++ *h = pts[1].y - pts[0].y; ++} ++ + /*********************************************************************** + * DIBDRV_Arc + */ --- wine1.2-1.1.43.orig/debian/patches/desktop-launcher-noexec +++ wine1.2-1.1.43/debian/patches/desktop-launcher-noexec @@ -0,0 +1,18 @@ +--- wine-1.1.43.orig/tools/wine.desktop 2010-04-16 18:53:23.000000000 +0100 ++++ wine-1.1.43/tools/wine.desktop 2010-04-27 07:04:05.470419505 +0100 +@@ -11,11 +11,13 @@ + Name[ca]=Wine - Carregador d'aplicacions del Windows + Name[pt]=Carregador de aplicativos Windows Wine + Name[pt_br]=Carregador de aplicativos Windows Wine +-Name[it]=Wine Carica Programmi Windows ++Name[nl]=Wine - Starter voor Windows-programma's ++Name[it]=Wine - Avvia applicazioni Windows + Name[da]=Wine, Programstarter til Windows-programmer + Name[nb]=Wine Programlaster for Windowsapplikasjoner + Name[nn]=Wine Programlaster for Windowsapplikasjoner +-Exec=wine start /unix %f ++Exec=cautious-launcher %f wine start /unix + MimeType=application/x-ms-dos-executable;application/x-msi;application/x-win-lnk; + NoDisplay=true ++Icon=wine + StartupNotify=true --- wine1.2-1.1.43.orig/debian/patches/dibeng-0007.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0007.patch @@ -0,0 +1,463 @@ +DIB Engine: Implement Polygon + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/graphics.c | 405 ++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 395 insertions(+), 10 deletions(-) + + +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +index 8dda082..fba34f5 100644 +--- a/dlls/winedib.drv/graphics.c ++++ b/dlls/winedib.drv/graphics.c +@@ -36,6 +36,281 @@ static inline void OrderInt(int *i1, int *i2) + } + } + ++#define LEFT_SIDE 1 ++#define TOP_SIDE 2 ++#define RIGHT_SIDE 4 ++#define BOTTOM_SIDE 8 ++ ++/* clips a line segment by a rectangular window */ ++static inline BYTE outCodes(const POINT *p, const RECT *r) ++{ ++ BYTE Code = 0; ++ ++ if(p->y < r->top) ++ Code |= TOP_SIDE; ++ else if(p->y >= r->bottom) ++ Code |= BOTTOM_SIDE; ++ if(p->x >= r->right) ++ Code |= RIGHT_SIDE; ++ else if(p->x < r->left) ++ Code |= LEFT_SIDE; ++ return Code; ++} ++ ++static BOOL ClipLine(const POINT *p1, const POINT *p2, const RECT *r, POINT *pc1, POINT *pc2) ++{ ++ BYTE outCode1,outCode2; ++ int tmp; ++ BYTE tmpCode; ++ ++ pc1->x = p1->x; pc1->y = p1->y; ++ pc2->x = p2->x; pc2->y = p2->y; ++ while(TRUE) ++ { ++ outCode1 = outCodes(pc1, r); ++ outCode2 = outCodes(pc2, r); ++ if(outCode1 & outCode2) ++ return FALSE; ++ if(!outCode1 && !outCode2) ++ return TRUE; ++ if(!outCode1) ++ { ++ tmp = pc1->x; pc1->x = pc2->x; pc2->x = tmp; ++ tmp = pc1->y; pc1->y = pc2->y; pc2->y = tmp; ++ tmpCode = outCode1; outCode1 = outCode2; outCode2 = tmpCode; ++ } ++ if(outCode1 & TOP_SIDE) ++ { ++ pc1->x += MulDiv(pc2->x - pc1->x, r->top - pc1->y, pc2->y - pc1->y); ++ pc1->y = r->top; ++ } ++ else if(outCode1 & BOTTOM_SIDE) ++ { ++ pc1->x += MulDiv(pc2->x - pc1->x, r->bottom - 1 - pc1->y, pc2->y - pc1->y); ++ pc1->y = r->bottom - 1; ++ } ++ else if(outCode1 & RIGHT_SIDE) ++ { ++ pc1->y += MulDiv(pc2->y - pc1->y, r->right - 1 - pc1->x, pc2->x - pc1->x); ++ pc1->x = r->right - 1; ++ } ++ else if(outCode1 & LEFT_SIDE) ++ { ++ pc1->y += MulDiv(pc2->y - pc1->y, r->left - pc1->x, pc2->x - pc1->x); ++ pc1->x = r->left; ++ } ++ } ++} ++ ++/* Clips a polygon by an horizontal/vertical line ++ which indicates the side : ++*/ ++static inline BOOL PointInside(const POINT *p, const RECT *r, BYTE side) ++{ ++ switch(side) ++ { ++ case 1: /* left */ ++ return p->x >= r->left; ++ case 2: /* top */ ++ return p->y >= r->top; ++ case 4: /* right */ ++ return p->x < r->right; ++ case 8: /* bottom */ ++ return p->y < r->bottom; ++ default: ++ return FALSE; ++ } ++} ++ ++static inline void SideIntersect(const POINT *p1, const POINT *p2, const RECT *r, BYTE side, POINT *inters) ++{ ++ switch( side ) ++ { ++ case LEFT_SIDE: /* left */ ++ inters->x = r->left; ++ inters->y = MulDiv(p2->y - p1->y, r->left - p1->x, p2->x - p1->x) + p1->y; ++ break; ++ case TOP_SIDE: /* top */ ++ inters->x = MulDiv(p2->x - p1->x, r->top - p1->y, p2->y - p1->y) + p1->x; ++ inters->y = r->bottom; ++ break; ++ case RIGHT_SIDE: /* right */ ++ inters->x = r->right - 1; ++ inters->y = MulDiv(p2->y - p1->y, r->right - 1 - p1->x, p2->x - p1->x) + p1->y; ++ break; ++ case BOTTOM_SIDE: /* bottom */ ++ inters->x = MulDiv(p2->x - p1->x, r->bottom - 1 - p1->y, p2->y - p1->y) + p1->x; ++ inters->y = r->bottom - 1; ++ break; ++ default: ++ break; ++ } ++} ++ ++ ++static BOOL ClipPolygonBySide(const POINT *pt, int count, const RECT *r, BYTE side, POINT **clipped, int *clippedCount) ++{ ++ int iPoint; ++ const POINT *p1, *p2; ++ POINT *pOut; ++ ++ if(!(*clipped = HeapAlloc(GetProcessHeap(), 0, sizeof(POINT) * count * 2))) ++ return FALSE; ++ pOut = *clipped; ++ *clippedCount = 0; ++ ++ p1 = pt + count - 1; ++ p2 = pt; ++ for(iPoint = 0 ; iPoint < count ; iPoint++) ++ { ++ if(PointInside(p2, r, side)) ++ { ++ /* point p is "inside" */ ++ if(!PointInside(p1, r, side)) ++ { ++ /* p is "inside" and s is "outside" */ ++ SideIntersect(p2, p1, r, side, pOut++); ++ (*clippedCount)++; ++ } ++ pOut->x = p2->x; ++ pOut->y = p2->y; ++ pOut++; ++ (*clippedCount)++; ++ } ++ else if(PointInside( p1, r, side )) ++ { ++ /* s is "inside" and p is "outside" */ ++ SideIntersect(p1, p2, r, side, pOut++); ++ (*clippedCount)++; ++ } ++ p1 = p2++; ++ } ++ return *clippedCount; ++} ++ ++ ++/* Clips a polygon by a rectangular window - returns a new polygon */ ++static BOOL ClipPolygon(const POINT* pt, int count, const RECT *r, POINT **newPt, int *newCount) ++{ ++ POINT *pc1, *pc2; ++ int count1, count2; ++ BOOL res; ++ ++ if(!ClipPolygonBySide(pt, count, r, LEFT_SIDE, &pc1, &count1)) ++ return FALSE; ++ res = ClipPolygonBySide(pc1, count1, r, TOP_SIDE, &pc2, &count2); ++ HeapFree(GetProcessHeap(), 0, pc1); ++ if(!res) ++ return FALSE; ++ res = ClipPolygonBySide(pc2, count2, r, RIGHT_SIDE, &pc1, &count1); ++ HeapFree(GetProcessHeap(), 0, pc2); ++ if(!res) ++ return FALSE; ++ res = ClipPolygonBySide(pc1, count1, r, BOTTOM_SIDE, &pc2, &count2); ++ HeapFree(GetProcessHeap(), 0, pc1); ++ if(!res) ++ return FALSE; ++ ++ *newPt = pc2; ++ *newCount = count2; ++ return TRUE; ++} ++ ++/* Intersects a line given by 2 points with an horizontal scan line at height y */ ++static BOOL ScanLine(const POINT *p1, const POINT *p2, int ys, POINT *pRes) ++{ ++ if(!pRes) ++ return FALSE; ++ ++ /* if line lies completely over or under scan line, no intersection */ ++ if((p1->y < ys && p2->y < ys) || (p1->y >= ys && p2->y >= ys)) ++ return FALSE; ++ ++ /* if line is parallel to x axis, we consider it not intersecting */ ++ if(p1->y == p2->y) ++ return FALSE; ++ ++ pRes->x = MulDiv(p2->x - p1->x, ys - p1->y, p2->y - p1->y) + p1->x; ++ pRes->y = ys; ++ return TRUE; ++} ++ ++/* Gets an x-ordered list of intersection points of a scanline at position y ++ with a polygon/polyline */ ++static BOOL ScanPolygon(const POINT *pt, int count, int ys, POINT **scans, int *scanCount) ++{ ++ const POINT *p1, *p2; ++ POINT *pDest; ++ int iPoint; ++ POINT *ps1, *ps2; ++ int i, j, tmp; ++ ++ /* if not at least 2 points, nothing to return */ ++ if(count < 2) ++ return FALSE; ++ ++ /* intersections count is AT MOST 'count'; we don't care to ++ allocate exact memory needed */ ++ *scans = HeapAlloc(GetProcessHeap(), 0, sizeof(POINT)*count); ++ if(!*scans) ++ return FALSE; ++ ++ /* builds unordered intersections */ ++ pDest = *scans; ++ *scanCount = 0; ++ p2 = pt; ++ for(iPoint = 0; iPoint < count-1; iPoint++) ++ { ++ p1 = p2; ++ p2++; ++ if(ScanLine(p1, p2, ys, pDest)) ++ { ++ pDest++; ++ (*scanCount)++; ++ } ++ } ++ p1 = p2; ++ p2 = pt; ++ if(ScanLine(p1, p2, ys, pDest)) ++ { ++ pDest++; ++ (*scanCount)++; ++ } ++ ++ /* now we sort the list -- duped point are left into ++ as they're needed for the scanline fill algorithm */ ++ for(i = 0, ps1 = *scans; i < *scanCount -1; i++, ps1++) ++ for(j = i+1, ps2 = ps1+1; j < *scanCount; j++, ps2++) ++ if(ps2->x < ps1->x) ++ { ++ tmp = ps2->x; ++ ps2->x = ps1->x; ++ ps1->x = tmp; ++ tmp = ps2->y; ++ ps2->y = ps1->y; ++ ps1->y = tmp; ++ } ++ ++ return TRUE; ++} ++ ++/* gets bounding box of a polygon */ ++void PolygonBoundingBox(const POINT *pt, int count, RECT *bBox) ++{ ++ const POINT *p; ++ int iPoint; ++ ++ bBox->left = MAXLONG; bBox->right = -MAXLONG; ++ bBox->top = MAXLONG; bBox->bottom = -MAXLONG; ++ for(p = pt, iPoint = 0; iPoint < count; iPoint++, p++) ++ { ++ if(p->x < bBox->left ) bBox->left = p->x; ++ if(p->x > bBox->right ) bBox->right = p->x; ++ if(p->y < bBox->top ) bBox->top = p->y; ++ if(p->y > bBox->bottom) bBox->bottom = p->y; ++ } ++} ++ + /*********************************************************************** + * DIBDRV_Arc + */ +@@ -291,45 +566,155 @@ BOOL DIBDRV_Pie( DIBDRVPHYSDEV *physDev, int left, int top, int right, int botto + /********************************************************************** + * DIBDRV_Polygon + */ +-BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* pt, int count ) ++BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* ptw, int count ) + { + BOOL res; ++ POINT *pt; ++ RECT *r; ++ int iRec; ++ POINT *clipped; ++ int clippedCount; ++ RECT bBox; ++ int ys; ++ POINT *scans; ++ int scanCount, iScan; ++ const POINT *p1, *p2; ++ int iPoint; ++ POINT pc1, pc2; + +- MAYBE(TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count)); ++ MAYBE(TRACE("physDev:%p, pt:%p, count:%d\n", physDev, ptw, count)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("STUB\n")); +- res = TRUE; ++ ++ res = FALSE; ++ ++ /* first converts all points to device coords */ ++ if(!(pt = HeapAlloc(GetProcessHeap(), 0, sizeof(POINT) * count))) ++ goto fin; ++ memcpy(pt, ptw, sizeof(POINT) * count); ++ LPtoDP(physDev->hdc, pt, count); ++ ++ /* cycle on all current clipping rectangles */ ++ r = physDev->regionRects; ++ for(iRec = 0; iRec < physDev->regionRectCount; iRec++, r++) ++ { ++ /* filled area */ ++ if(ClipPolygon(pt, count, r, &clipped, &clippedCount)) ++ { ++ /* gets polygon bounding box -- for ytop and ybottom */ ++ PolygonBoundingBox(clipped, clippedCount, &bBox); ++ ++ /* gets all ordered intersections of polygon with ++ current scanline */ ++ for(ys = bBox.top; ys < bBox.bottom; ys++) ++ { ++ if(ScanPolygon(clipped, clippedCount, ys, &scans, &scanCount)) ++ { ++ if(scanCount >= 2) ++ { ++ res = TRUE; ++ p1 = scans; ++ p2 = p1+1; ++ iScan = 0; ++ while(iScan < scanCount - 1) ++ { ++ physDev->brushHLine(physDev, p1->x, p2->x, ys); ++ p1 +=2; ++ p2 +=2; ++ iScan +=2; ++ } ++ } ++ HeapFree(GetProcessHeap(), 0, scans); ++ } ++ } ++ HeapFree(GetProcessHeap(), 0, clipped); ++ } ++ ++ /* perimeter -- don't use PolyLine for speed */ ++ p2 = pt; ++ for(iPoint = 0; iPoint < count -1; iPoint++) ++ { ++ p1 = p2++; ++ if(ClipLine(p1, p2, r, &pc1, &pc2)) ++ { ++ res = TRUE; ++ physDev->penLine(physDev, pc1.x, pc1.y, pc2.x, pc2.y); ++ } ++ } ++ p1 = p2; ++ p2 = pt; ++ if(ClipLine(p1, p2, r, &pc1, &pc2)) ++ { ++ res = TRUE; ++ physDev->penLine(physDev, pc1.x, pc1.y, pc2.x, pc2.y); ++ } ++ } ++ ++ HeapFree(GetProcessHeap(), 0, pt); ++ + } + else + { + /* DDB selected in, use X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pPolygon(physDev->X11PhysDev, pt, count); ++ res = _DIBDRV_GetDisplayDriver()->pPolygon(physDev->X11PhysDev, ptw, count); + } ++fin: + return res; + } + + /********************************************************************** + * DIBDRV_Polyline + */ +-BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* pt, int count ) ++BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* ptw, int count ) + { + BOOL res; + +- MAYBE(TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count)); ++ MAYBE(TRACE("physDev:%p, pt:%p, count:%d\n", physDev, ptw, count)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("STUB\n")); +- res = TRUE; ++ POINT *pt; ++ RECT *r; ++ POINT pc1, pc2; ++ int iRec, iPoint; ++ ++ if(count < 2) ++ return FALSE; ++ res = FALSE; ++ ++ /* first converts all points to device coords */ ++ if(!(pt = HeapAlloc(GetProcessHeap(), 0, sizeof(POINT) * count))) ++ return FALSE; ++ memcpy(pt, ptw, sizeof(POINT) * count); ++ LPtoDP(physDev->hdc, pt, count); ++ ++ r = physDev->regionRects; ++ for(iRec = 0; iRec < physDev->regionRectCount; iRec++) ++ { ++ const POINT *p2 = pt, *p1; ++ for(iPoint = 0; iPoint < count -1; iPoint++) ++ { ++ p1 = p2++; ++ if(ClipLine(p1, p2, r, &pc1, &pc2)) ++ { ++ res = TRUE; ++ physDev->penLine(physDev, pc1.x, pc1.y, pc2.x, pc2.y); ++ } ++ } ++ r++; ++ } ++ ++ HeapFree(GetProcessHeap(), 0, pt); ++ ++ return res; + } + else + { + /* DDB selected in, use X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pPolyline(physDev->X11PhysDev, pt, count); ++ res = _DIBDRV_GetDisplayDriver()->pPolyline(physDev->X11PhysDev, ptw, count); + } + return res; + } --- wine1.2-1.1.43.orig/debian/patches/dibeng-0004.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0004.patch @@ -0,0 +1,9088 @@ +DIB Engine: implement most engine functions + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/Makefile.in | 12 + dlls/winedib.drv/bitblt.c | 525 ++++++++++++++-- + dlls/winedib.drv/bitmap.c | 49 +- + dlls/winedib.drv/clipping.c | 6 + dlls/winedib.drv/convert.c | 309 +++++++++ + dlls/winedib.drv/dc.c | 280 ++++++++- + dlls/winedib.drv/dib.c | 24 - + dlls/winedib.drv/dibdrv.h | 292 +++++++++ + dlls/winedib.drv/dibdrv_gdi32.h | 168 +++++ + dlls/winedib.drv/dibdrv_main.c | 11 + dlls/winedib.drv/dibdrvbitmap.c | 650 ++++++++++++++++++++ + dlls/winedib.drv/driver.c | 254 ++++++++ + dlls/winedib.drv/font.c | 116 +++- + dlls/winedib.drv/freetype.c | 136 ++++ + dlls/winedib.drv/freetype.h | 186 ++++++ + dlls/winedib.drv/graphics.c | 264 +++++--- + dlls/winedib.drv/opengl.c | 32 - + dlls/winedib.drv/palette.c | 51 +- + dlls/winedib.drv/pen_brush.c | 492 ++++++++++++++- + dlls/winedib.drv/primitives.c | 274 ++++++++ + dlls/winedib.drv/primitives_bitblt.c | 1075 +++++++++++++++++++++++++++++++++ + dlls/winedib.drv/primitives_color.c | 142 ++++ + dlls/winedib.drv/primitives_convert.c | 559 +++++++++++++++++ + dlls/winedib.drv/primitives_font.c | 310 ++++++++++ + dlls/winedib.drv/primitives_line.c | 434 +++++++++++++ + dlls/winedib.drv/primitives_pixel.c | 244 +++++++ + dlls/winedib.drv/primitives_rop2.c | 112 +++ + dlls/winedib.drv/primitives_rop3.c | 786 ++++++++++++++++++++++++ + dlls/winedib.drv/text.c | 179 +++++ + dlls/winedib.drv/video.c | 8 + 30 files changed, 7706 insertions(+), 274 deletions(-) + create mode 100644 dlls/winedib.drv/convert.c + create mode 100644 dlls/winedib.drv/dibdrv_gdi32.h + create mode 100644 dlls/winedib.drv/dibdrvbitmap.c + create mode 100644 dlls/winedib.drv/driver.c + create mode 100644 dlls/winedib.drv/freetype.c + create mode 100644 dlls/winedib.drv/freetype.h + create mode 100644 dlls/winedib.drv/primitives.c + create mode 100644 dlls/winedib.drv/primitives_bitblt.c + create mode 100644 dlls/winedib.drv/primitives_color.c + create mode 100644 dlls/winedib.drv/primitives_convert.c + create mode 100644 dlls/winedib.drv/primitives_font.c + create mode 100644 dlls/winedib.drv/primitives_line.c + create mode 100644 dlls/winedib.drv/primitives_pixel.c + create mode 100644 dlls/winedib.drv/primitives_rop2.c + create mode 100644 dlls/winedib.drv/primitives_rop3.c + + +diff --git a/dlls/winedib.drv/Makefile.in b/dlls/winedib.drv/Makefile.in +index 66ad14f..722785e 100644 +--- a/dlls/winedib.drv/Makefile.in ++++ b/dlls/winedib.drv/Makefile.in +@@ -11,15 +11,27 @@ C_SRCS = \ + bitblt.c \ + bitmap.c \ + clipping.c \ ++ convert.c \ + dc.c \ + dib.c \ + dibdrv_main.c \ ++ dibdrvbitmap.c \ + driver.c \ + font.c \ ++ freetype.c \ + graphics.c \ + opengl.c \ + palette.c \ + pen_brush.c \ ++ primitives.c \ ++ primitives_bitblt.c \ ++ primitives_color.c \ ++ primitives_convert.c \ ++ primitives_font.c \ ++ primitives_line.c \ ++ primitives_pixel.c \ ++ primitives_rop2.c \ ++ primitives_rop3.c \ + text.c \ + video.c + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index 022f223..20cdcaa 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -25,6 +25,117 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++static inline void intSwap(int *a, int *b) ++{ ++ int tmp; ++ tmp = *a; ++ *a = *b; ++ *b = tmp; ++} ++ ++/* clips a source and destination areas to their respective clip rectangles ++ returning both source and dest modified; result is TRUE if clipping ++ leads to a non null rectangle, FALSE otherwise */ ++static BOOL BitBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *sz, RECT*srcClip, RECT*dstClip) ++{ ++ int xs1, ys1, xs2, ys2; ++ int xsc1, ysc1, xsc2, ysc2; ++ int xd1, yd1, xd2, yd2; ++ int xdc1, ydc1, xdc2, ydc2; ++ int w, h, dx, dy; ++ ++ /* extract sizes */ ++ w = sz->cx; h = sz->cy; ++ ++ /* if sizes null or negative, just return false */ ++ if(w <= 0 || h <= 0) ++ return FALSE; ++ ++ /* extract dest area data */ ++ xd1 = pd->x; ++ yd1 = pd->y; ++ xd2 = xd1 + w; ++ yd2 = yd1 + h; ++ ++ /* extract source data */ ++ xs1 = ps->x; ++ ys1 = ps->y; ++ xs2 = xs1 + w; ++ ys2 = ys1 + h; ++ ++ /* if source clip area is not null, do first clipping on it */ ++ if(srcClip) ++ { ++ /* extract source clipping area */ ++ xsc1 = srcClip->left; ++ ysc1 = srcClip->top; ++ xsc2 = srcClip->right; ++ ysc2 = srcClip->bottom; ++ ++ /* order clip area rectangle points */ ++ if(xsc1 > xsc2) intSwap(&xsc1, &xsc2); ++ if(ysc1 > ysc2) intSwap(&ysc1, &ysc2); ++ ++ /* clip on source clipping start point */ ++ if(xs1 < xsc1) { dx = xsc1 - xs1; w -= dx; xd1 += dx; xs1 = xsc1; } ++ if(ys1 < ysc1) { dy = ysc1 - ys1; h -= dy; yd1 += dy; ys1 = ysc1; } ++ ++ /* clip on source clipping end point */ ++ if(xs2 > xsc2) { dx = xs2 - xsc2; w -= dx; xd2 -= dx; xs2 = xsc2; } ++ if(ys2 > ysc2) { dy = ys2 - ysc2; h -= dy; yd2 -= dy; ys2 = ysc2; } ++ ++ /* if already zero area, return false */ ++ if(w <= 0 || h <= 0) ++ return FALSE; ++ } ++ /* now do clipping on destination area */ ++ ++ if(dstClip) ++ { ++ /* extract destination clipping area */ ++ xdc1 = dstClip->left; ++ ydc1 = dstClip->top; ++ xdc2 = dstClip->right; ++ ydc2 = dstClip->bottom; ++ ++ /* order clip area rectangle points */ ++ if(xdc1 > xdc2) intSwap(&xdc1, &xdc2); ++ if(ydc1 > ydc2) intSwap(&ydc1, &ydc2); ++ ++ /* clip on dest clipping start point */ ++ if(xd1 < xdc1) { dx = xdc1 - xd1; w -= dx; xs1 += dx; xd1 = xdc1; } ++ if(yd1 < ydc1) { dy = ydc1 - yd1; h -= dy; ys1 += dy; yd1 = ydc1; } ++ ++ /* clip on dest clipping end point */ ++ if(xd2 > xdc2) { dx = xd2 - xdc2; w -= dx; xs2 -= dx; xd2 = xdc2; } ++ if(yd2 > ydc2) { dy = yd2 - ydc2; h -= dy; ys2 -= dy; yd2 = ydc2; } ++ ++ /* if already zero area, return false */ ++ if(w <= 0 || h <= 0) ++ return FALSE; ++ } ++ ++ /* sets clipped/translated points and sizes and returns TRUE */ ++ ps->x = xs1; ps->y = ys1; ++ pd->x = xd1; pd->y = yd1; ++ sz->cx = w; sz->cy = h; ++ ++ return TRUE; ++ ++} ++ ++ ++/* clips a source and destination areas to their respective clip rectangles ++ returning both source and dest modified; result is TRUE if clipping ++ leads to a non null rectangle, FALSE otherwise */ ++static BOOL StretchBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *szSrc, SIZE *szDst, RECT*srcClip, RECT*dstClip) ++{ ++ ONCE(FIXME("TO DO\n")); ++ ++ return TRUE; ++ ++} ++ + /*********************************************************************** + * DIBDRV_AlphaBlend + */ +@@ -34,16 +145,17 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + { + BOOL res; + +- TRACE("physDevDst:%p, xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", +- physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc); ++ MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", ++ physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", ++ xDst, yDst, widthDst, heightDst, ++ physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", ++ xSrc, ySrc, widthSrc, heightSrc)); + + if(physDevDst->hasDIB && physDevSrc->hasDIB) + { + /* DIB section selected in both source and dest DC, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, +- blendfn); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else if(!physDevDst->hasDIB && !physDevSrc->hasDIB) + { +@@ -63,10 +175,8 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + else /* if(physDevDst->hasDIB) */ + { + /* DDB on source, DIB on dest -- must convert source DDB to DIB and use the engine for blit */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, +- blendfn); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + return res; + } +@@ -80,35 +190,171 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + { + BOOL res; + +- TRACE("physDevDst:%p, xDst:%d, yDst:%d, width:%d, height:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, rop:%08x\n", +- physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, ySrc, rop); ++ /* clip blit area */ ++ POINT pd = {xDst, yDst}; ++ POINT ps = {xSrc, ySrc}; ++ SIZE sz = {width, height}; + +- if(physDevDst->hasDIB && physDevSrc->hasDIB) +- { +- /* DIB section selected in both source and dest DC, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, +- physDevSrc->X11PhysDev, xSrc, ySrc, rop); +- } +- else if(!physDevDst->hasDIB && !physDevSrc->hasDIB) +- { +- /* DDB selected in noth source and dest DC, use X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, +- physDevSrc->X11PhysDev, xSrc, ySrc, rop); +- } +- else if(physDevSrc->hasDIB) ++ MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, width:%d, height:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, rop:%08x\n", ++ physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", ++ xDst, yDst, width, height, ++ physDevSrc, physDevSrc ? (physDevSrc->hasDIB ? "DIB-" : "DDB"): "---", physDevSrc && physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", ++ xSrc, ySrc, rop)); ++ ++ if(physDevDst->hasDIB) + { +- /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, +- physDevSrc->X11PhysDev, xSrc, ySrc, rop); ++ /* DIB section selected in dest DC, use DIB Engine */ ++ ++ /* clip blit area */ ++ RECT dstClip = {0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height}; ++ ++ if(!physDevSrc || physDevSrc->hasDIB) ++ { ++ /* clip blit area */ ++ if(physDevSrc) ++ { ++ RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; ++ res = BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, &dstClip); ++ } ++ else ++ res = BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); ++ if(!res) ++ goto noBlt2; ++ xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; ++ ++ /* source is null or has a DIB, no need to convert anyting */ ++ res = physDevDst->physBitmap.funcs->BitBlt(physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, ySrc, rop); ++ } ++ else ++ { ++ /* source is a DDB, must convert it to DIB */ ++ ++ /* don't clip on source */ ++ res = BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); ++ if(!res) ++ goto noBlt2; ++ xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; ++ ++ /* we must differentiate from 2 cases : ++ 1) source DC is a memory DC ++ 2) source DC is a device DC */ ++ if(GetObjectType(physDevSrc->hdc) == OBJ_MEMDC) ++ { ++ /* memory DC */ ++ HBITMAP dib, ddb; ++ ++ ddb = SelectObject(physDevSrc->hdc, GetStockObject(DEFAULT_BITMAP)); ++ if(!ddb) ++ { ++ ERR("Couldn't select out DDB from source HDC\n"); ++ res = 0; ++ goto noBlt1; ++ } ++ dib = _DIBDRV_ConvertDDBtoDIB(physDevSrc->hdc, ddb, ySrc, height); ++ if(!dib) ++ { ++ ERR("Failed converting source DDB to DIB\n"); ++ SelectObject(physDevSrc->hdc, ddb); ++ res = 0; ++ goto noBlt1; ++ } ++ SelectObject(physDevSrc->hdc, dib); ++ res = physDevDst->physBitmap.funcs->BitBlt(physDevDst, xDst, yDst, width, height, ++ physDevSrc, xSrc, 0, rop); ++ SelectObject(physDevSrc->hdc, ddb); ++ DeleteObject(dib); ++ noBlt1: ++ ; ++ } ++ else ++ { ++ /* device DC */ ++ HBITMAP dib, stock; ++ HDC memHdc; ++ ++ dib = _DIBDRV_ConvertDevDDBtoDIB(physDevSrc->hdc, physDevDst->hdc, xSrc, ySrc, width, height); ++ if(!dib) ++ { ++ ERR("Failed converting source DDB tp DIB for device DC\n"); ++ res = 0; ++ goto noBlt2; ++ } ++ memHdc = CreateCompatibleDC(physDevDst->hdc); ++ if(!memHdc) ++ { ++ ERR("Failed creating temporary memory DC\n"); ++ DeleteObject(dib); ++ res = 0; ++ goto noBlt2; ++ } ++ stock = SelectObject(memHdc, dib); ++ if(!stock) ++ { ++ ERR("Failed selecting converted DIB into temporary memory DC\n"); ++ DeleteObject(dib); ++ DeleteDC(memHdc); ++ res = 0; ++ goto noBlt2; ++ } ++ res = BitBlt(physDevDst->hdc, xDst, yDst, width, height, memHdc, 0, 0, rop); ++ ++ SelectObject(memHdc, stock); ++ DeleteObject(dib); ++ DeleteDC(memHdc); ++ noBlt2: ++ ; ++ } ++ } + } +- else /* if(physDevDst->hasDIB) */ ++ else /* dest is a DDB */ + { +- /* DDB on source, DIB on dest -- must convert source DDB to DIB and use the engine for blit */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, +- physDevSrc->X11PhysDev, xSrc, ySrc, rop); ++ /* DDB selected on dest DC, use X11 Driver */ ++ if(!physDevSrc || !physDevSrc->hasDIB) ++ { ++ /* source is null or has also a DDB, no need to convert anything */ ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, ySrc, rop); ++ } ++ else ++ { ++ /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ ++ HBITMAP dib, ddb; ++ ++ /* clip blit area */ ++ if(physDevSrc) ++ { ++ RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; ++ res = BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, 0); ++ } ++ else ++ res = TRUE; ++ if(!res) ++ goto noBlt3; ++ xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; ++ ++ dib = SelectObject(physDevSrc->hdc, GetStockObject(DEFAULT_BITMAP)); ++ if(!dib) ++ { ++ ERR("Couldn't select out DIB from source HDC\n"); ++ res = 0; ++ goto noBlt3; ++ } ++ ddb = _DIBDRV_ConvertDIBtoDDB(physDevSrc->hdc, dib, ySrc, height); ++ if(!ddb) ++ { ++ ERR("Failed converting source DIB to DDB\n"); ++ SelectObject(physDevSrc->hdc, dib); ++ res = 0; ++ goto noBlt3; ++ } ++ SelectObject(physDevSrc->hdc, ddb); ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, 0, rop); ++ SelectObject(physDevSrc->hdc, dib); ++ DeleteObject(ddb); ++noBlt3: ++ ; ++ } + } + return res; + } +@@ -123,35 +369,186 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + { + BOOL res; + +- TRACE("physDevDst:%p, xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d, rop:%8x\n", +- physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc, rop); ++ /* clip blit area */ ++ POINT pd = {xDst, yDst}; ++ POINT ps = {xSrc, ySrc}; ++ SIZE szDst = {widthDst, heightDst}; ++ SIZE szSrc = {widthSrc, heightSrc}; + +- if(physDevDst->hasDIB && physDevSrc->hasDIB) +- { +- /* DIB section selected in both source and dest DC, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); +- } +- else if(!physDevDst->hasDIB && !physDevSrc->hasDIB) +- { +- /* DDB selected in noth source and dest DC, use X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); +- } +- else if(physDevSrc->hasDIB) ++ /* if source and dest sizes match, just call BitBlt(), it's faster */ ++ if(!physDevSrc || (widthDst == widthSrc && heightDst == heightSrc)) ++ return DIBDRV_BitBlt(physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, rop); ++ ++ MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d, rop:%08x\n", ++ physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", ++ xDst, yDst, widthDst, heightDst, ++ physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", ++ xSrc, ySrc, widthSrc, heightSrc, rop)); ++ ++ if(physDevDst->hasDIB) + { +- /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); ++ /* DIB section selected in dest DC, use DIB Engine */ ++ ++ /* clip blit area */ ++ RECT dstClip = {0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height}; ++ ++ if(!physDevSrc || physDevSrc->hasDIB) ++ { ++ /* clip blit area */ ++ if(physDevSrc) ++ { ++ RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); ++ } ++ else ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); ++ if(!res) ++ goto noBlt2; ++ xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; ++ xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; ++ ++ /* source is null or has a DIB, no need to convert anyting */ ++ res = physDevDst->physBitmap.funcs->StretchBlt(physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc, rop); ++ } ++ else ++ { ++ /* source is a DDB, must convert it to DIB */ ++ ++ /* don't clip on source */ ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); ++ if(!res) ++ goto noBlt2; ++ xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; ++ xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; ++ ++ /* we must differentiate from 2 cases : ++ 1) source DC is a memory DC ++ 2) source DC is a device DC */ ++ if(GetObjectType(physDevSrc->hdc) == OBJ_MEMDC) ++ { ++ /* memory DC */ ++ HBITMAP dib, ddb; ++ ++ ddb = SelectObject(physDevSrc->hdc, GetStockObject(DEFAULT_BITMAP)); ++ if(!ddb) ++ { ++ ERR("Couldn't select out DDB from source HDC\n"); ++ res = 0; ++ goto noBlt1; ++ } ++ dib = _DIBDRV_ConvertDDBtoDIB(physDevSrc->hdc, ddb, ySrc, heightSrc); ++ if(!dib) ++ { ++ ERR("Failed converting source DDB to DIB\n"); ++ SelectObject(physDevSrc->hdc, ddb); ++ res = 0; ++ goto noBlt1; ++ } ++ SelectObject(physDevSrc->hdc, dib); ++ res = physDevDst->physBitmap.funcs->StretchBlt(physDevDst, xDst, yDst, widthDst, heightDst, ++ physDevSrc, xSrc, 0, widthSrc, heightSrc, rop); ++ SelectObject(physDevSrc->hdc, ddb); ++ DeleteObject(dib); ++ noBlt1: ++ ; ++ } ++ else ++ { ++ /* device DC */ ++ HBITMAP dib, stock; ++ HDC memHdc; ++ ++ dib = _DIBDRV_ConvertDevDDBtoDIB(physDevSrc->hdc, physDevDst->hdc, xSrc, ySrc, widthSrc, heightSrc); ++ if(!dib) ++ { ++ ERR("Failed converting source DDB tp DIB for device DC\n"); ++ res = 0; ++ goto noBlt2; ++ } ++ memHdc = CreateCompatibleDC(physDevDst->hdc); ++ if(!memHdc) ++ { ++ ERR("Failed creating temporary memory DC\n"); ++ DeleteObject(dib); ++ res = 0; ++ goto noBlt2; ++ } ++ stock = SelectObject(memHdc, dib); ++ if(!stock) ++ { ++ ERR("Failed selecting converted DIB into temporary memory DC\n"); ++ DeleteObject(dib); ++ DeleteDC(memHdc); ++ res = 0; ++ goto noBlt2; ++ } ++ res = StretchBlt(physDevDst->hdc, xDst, yDst, widthDst, heightDst, memHdc, 0, 0, widthSrc, widthDst, rop); ++ ++ SelectObject(memHdc, stock); ++ DeleteObject(dib); ++ DeleteDC(memHdc); ++ noBlt2: ++ ; ++ } ++ } + } +- else /* if(physDevDst->hasDIB) */ ++ else /* dest is a DDB */ + { +- /* DDB on source, DIB on dest -- must convert source DDB to DIB and use the engine for blit */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, +- physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); ++ /* DDB selected on dest DC, use X11 Driver */ ++ if(!physDevSrc || !physDevSrc->hasDIB) ++ { ++ /* source is null or has also a DDB, no need to convert anything */ ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, ++ physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, ySrc, widthSrc, heightSrc, rop); ++ } ++ else ++ { ++ /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ ++ HBITMAP dib, ddb; ++ ++ /* clip blit area */ ++ if(physDevSrc) ++ { ++ RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, 0); ++ } ++ else ++ res = TRUE; ++ if(!res) ++ goto noBlt3; ++ xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; ++ xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; ++ ++ dib = SelectObject(physDevSrc->hdc, GetStockObject(DEFAULT_BITMAP)); ++ if(!dib) ++ { ++ ERR("Couldn't select out DIB from source HDC\n"); ++ res = 0; ++ goto noBlt3; ++ } ++ ddb = _DIBDRV_ConvertDIBtoDDB(physDevSrc->hdc, dib, ySrc, heightSrc); ++ if(!ddb) ++ { ++ ERR("Failed converting source DIB to DDB\n"); ++ SelectObject(physDevSrc->hdc, dib); ++ res = 0; ++ goto noBlt3; ++ } ++ if(!SelectObject(physDevSrc->hdc, ddb)) ++ { ++ ERR("Failed to select converted DDB into source HDC\n"); ++ SelectObject(physDevSrc->hdc, dib); ++ DeleteObject(ddb); ++ res = 0; ++ goto noBlt3; ++ } ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, ++ physDevSrc ? physDevSrc->X11PhysDev : 0, xSrc, 0, widthSrc, heightSrc, rop); ++ SelectObject(physDevSrc->hdc, dib); ++ DeleteObject(ddb); ++noBlt3: ++ ; ++ } + } + return res; + } +@@ -162,14 +559,14 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + BOOL DIBDRV_PatBlt( DIBDRVPHYSDEV *physDev, INT left, INT top, INT width, INT height, DWORD rop ) + { + BOOL res; +- +- TRACE("physDev:%p, left:%d, top:%d, width:%d, height:%d, rop:%06x\n", physDev, left, top, width, height, rop); ++ ++ MAYBE(TRACE("physDev:%p, left:%d, top:%d, width:%d, height:%d, rop:%06x\n", physDev, left, top, width, height, rop)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pPatBlt(physDev->X11PhysDev, left, top, width, height, rop); ++ ONCE(FIXME("TEMPORARY - use BitBlt by now\n")); ++ res = DIBDRV_BitBlt(physDev, left, top, width, height, NULL, 0, 0, rop); + } + else + { +diff --git a/dlls/winedib.drv/bitmap.c b/dlls/winedib.drv/bitmap.c +index df7c03a..f3d3b9c 100644 +--- a/dlls/winedib.drv/bitmap.c ++++ b/dlls/winedib.drv/bitmap.c +@@ -34,12 +34,12 @@ HBITMAP DIBDRV_SelectBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap ) + DIBSECTION dibSection; + HBITMAP res; + +- TRACE("physDev:%p, hbitmap:%p\n", physDev, hbitmap); +- + /* try to get the DIBSECTION data from the bitmap */ + if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) + { + /* not a DIB section, sets it on physDev and use X11 behaviour */ ++ ++ MAYBE(TRACE("physDev:%p, hbitmap:%p\n", physDev, hbitmap)); + physDev->hasDIB = FALSE; + res = _DIBDRV_GetDisplayDriver()->pSelectBitmap(physDev->X11PhysDev, hbitmap); + if(res) +@@ -48,11 +48,30 @@ HBITMAP DIBDRV_SelectBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap ) + else + { + /* it's a DIB section, sets it on physDev and use DIB Engine behaviour */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- physDev->hasDIB = TRUE; +- res = _DIBDRV_GetDisplayDriver()->pSelectBitmap(physDev->X11PhysDev, hbitmap); +- if(res) ++ ++ MAYBE(TRACE("physDev:%p, hbitmap:%p, physBitmap=%p\n", physDev, hbitmap, &physDev->physBitmap)); ++ ++ /* frees any previously physical bitmap */ ++ _DIBDRVBITMAP_Free(&physDev->physBitmap); ++ ++ /* WARNING : the color table can't be grabbed here, since it's still ++ not initialized. It'll be grabbed on RealizeDefaultPalette(), ++ which is presumably the first call made after palette initialization. ++ So, by now we just set up palette size and leave NULL the palette pointer */ ++ if(_DIBDRVBITMAP_InitFromBMIH(&physDev->physBitmap, &dibSection.dsBmih, dibSection.dsBitfields, NULL, dibSection.dsBm.bmBits)) ++ { ++ /* stores the active bitmap */ ++ res = physDev->hbitmap; + physDev->hbitmap = hbitmap; ++ ++ /* remember there's a DIB selected in */ ++ physDev->hasDIB = TRUE; ++ } ++ else ++ { ++ ERR("Failed to initialize physical bitmap\n"); ++ res = 0; ++ } + } + return res; + +@@ -66,7 +85,7 @@ BOOL DIBDRV_CreateBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, LPVOID bmBits + DIBSECTION dibSection; + BOOL res; + +- TRACE("physDev:%p, hbitmap:%p, bmBits:%p\n", physDev, hbitmap, bmBits); ++ MAYBE(TRACE("physDev:%p, hbitmap:%p, bmBits:%p\n", physDev, hbitmap, bmBits)); + + /* try to get the DIBSECTION data from the bitmap */ + if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) +@@ -76,9 +95,9 @@ BOOL DIBDRV_CreateBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, LPVOID bmBits + } + else + { +- /* it's a DIB section, use DIB Engine behaviour */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pCreateBitmap(physDev->X11PhysDev, hbitmap, bmBits); ++ /* it's a DIB section, use DIB Engine behaviour - should not happen, but.... */ ++ ONCE(FIXME("CreateBitmap() called for a DIB section - shouldn't happen\n")); ++ res = TRUE; + } + return res; + } +@@ -91,7 +110,7 @@ BOOL DIBDRV_DeleteBitmap( HBITMAP hbitmap ) + DIBSECTION dibSection; + BOOL res; + +- TRACE("hbitmap:%p\n", hbitmap); ++ MAYBE(TRACE("hbitmap:%p\n", hbitmap)); + + /* try to get the DIBSECTION data from the bitmap */ + if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) +@@ -102,8 +121,8 @@ BOOL DIBDRV_DeleteBitmap( HBITMAP hbitmap ) + else + { + /* it's a DIB section, use DIB Engine behaviour */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pDeleteBitmap(hbitmap); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + return res; + } +@@ -115,7 +134,7 @@ LONG DIBDRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count ) + { + LONG res; + +- TRACE("hbitmap:%p, buffer:%p, count:%d\n", hbitmap, buffer, count); ++ MAYBE(TRACE("hbitmap:%p, buffer:%p, count:%d\n", hbitmap, buffer, count)); + + /* GetBitmapBits is only valid for DDBs, so use X11 driver */ + res = _DIBDRV_GetDisplayDriver()->pGetBitmapBits(hbitmap, buffer, count); +@@ -130,7 +149,7 @@ LONG DIBDRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) + { + LONG res; + +- TRACE("hbitmap:%p, bits:%p, count:%d\n", hbitmap, bits, count); ++ MAYBE(TRACE("hbitmap:%p, bits:%p, count:%d\n", hbitmap, bits, count)); + + /* SetBitmapBits is only valid for DDBs, so use X11 driver */ + res = _DIBDRV_GetDisplayDriver()->pSetBitmapBits(hbitmap, bits, count); +diff --git a/dlls/winedib.drv/clipping.c b/dlls/winedib.drv/clipping.c +index 1ddbb1b..81dec25 100644 +--- a/dlls/winedib.drv/clipping.c ++++ b/dlls/winedib.drv/clipping.c +@@ -25,18 +25,18 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++ + /*********************************************************************** + * DIBDRV_SetDeviceClipping + */ + void DIBDRV_SetDeviceClipping( DIBDRVPHYSDEV *physDev, HRGN vis_rgn, HRGN clip_rgn ) + { +- TRACE("physDev:%p, vis_rgn:%p, clip_rgn:%p\n", physDev, vis_rgn, clip_rgn); ++ MAYBE(TRACE("physDev:%p, vis_rgn:%p, clip_rgn:%p\n", physDev, vis_rgn, clip_rgn)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++ ONCE(FIXME("STUB\n")); + } + else + { +diff --git a/dlls/winedib.drv/convert.c b/dlls/winedib.drv/convert.c +new file mode 100644 +index 0000000..dc18e14 +--- /dev/null ++++ b/dlls/winedib.drv/convert.c +@@ -0,0 +1,309 @@ ++/* ++ * DIB Engine conversion routines ++ * Converts DDB <--> DIB ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++#include "winuser.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * Creates DDB that is compatible with source hdc. ++ * hdc is the HDC on where the DIB MUST be selected in ++ * srcBmp is the source DIB ++ * startScan and scanLines specify the portion of DIB to convert ++ * in order to avoid unneeded conversion of large DIBs on blitting ++ * ++ * NOTE : the srcBmp DIB MUST NOT be selected in any DC */ ++HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int scanLines ) ++{ ++ DIBSECTION ds; ++ BITMAPINFO *bmi; ++ HBITMAP hBmp = NULL; ++ ++ int dibWidth, dibHeight; ++ BOOL topDown; ++ void *bits; ++ int stride; ++ UINT colorUsed; ++ int bitFields; ++ HDC tmpHdc; ++ HBITMAP tmpBmp; ++ int res; ++ ++ /* gets DIBSECTION data from source DIB */ ++ if(GetObjectW(srcBmp, sizeof(DIBSECTION), &ds) != sizeof(DIBSECTION)) ++ { ++ ERR("Couldn't get DIBSECTION data\n"); ++ return 0; ++ } ++ ++ /* gets DIB info */ ++ dibWidth = ds.dsBmih.biWidth; ++ dibHeight = ds.dsBmih.biHeight; ++ bits = ds.dsBm.bmBits; ++ stride = ((dibWidth * ds.dsBmih.biBitCount +31) &~31) / 8; ++ ++ /* adjust bits to point at needed starting stripe */ ++ if(dibHeight < 0) ++ { ++ /* top-down DIB */ ++ topDown = TRUE; ++ dibHeight = -dibHeight; ++ bits = (BYTE *)bits + startScan * stride; ++ } ++ else ++ { ++ topDown = FALSE; ++ bits = (BYTE *)bits + (dibHeight - startScan - scanLines) * stride; ++ } ++ ++ /* if requested part is out of source bitmap, returns 0 */ ++ if(startScan >= dibHeight) ++ return 0; ++ if(startScan + scanLines >= dibHeight) ++ scanLines = dibHeight - startScan; ++ ++ /* gets the size of DIB palette and bitfields, if any */ ++ bitFields = 0; ++ if(ds.dsBmih.biBitCount > 8) ++ { ++ colorUsed = 0; ++ if(ds.dsBmih.biCompression == BI_BITFIELDS) ++ bitFields = 3; ++ } ++ else ++ { ++ colorUsed = ds.dsBmih.biClrUsed; ++ if(!colorUsed) ++ colorUsed = 1 << ds.dsBmih.biBitCount; ++ } ++ ++ /* builds the needed BITMAPINFOHEADER */ ++ bmi = HeapAlloc( GetProcessHeap(), 0, sizeof(BITMAPINFOHEADER)+ ++ sizeof(RGBQUAD)*colorUsed + sizeof(DWORD) * bitFields ); ++ if (!bmi) ++ { ++ ERR("HeapAlloc failed\n"); ++ return 0; ++ } ++ ++ /* copy the header part */ ++ memcpy( &bmi->bmiHeader, &ds.dsBmih, sizeof(BITMAPINFOHEADER) ); ++ ++ /* gets the color table part, if any */ ++ if(colorUsed) ++ { ++ /* create a temporary DC, GetDIBColorTable() requests that ++ the DIB is selected in a DC.... */ ++ if(!(tmpHdc = CreateCompatibleDC(hdc))) ++ { ++ ERR("Couldn't create the temporary HDC\n"); ++ HeapFree(GetProcessHeap(), 0, bmi); ++ return 0; ++ } ++ /* selects the DIB into the temporary DC */ ++ if( !(tmpBmp = SelectObject(tmpHdc, srcBmp))) ++ { ++ ERR("Couldn't select source DIB into temporary DC\n"); ++ DeleteDC(tmpHdc); ++ HeapFree(GetProcessHeap(), 0, bmi); ++ return 0; ++ } ++ GetDIBColorTable(tmpHdc, 0, colorUsed, bmi->bmiColors); ++ SelectObject(tmpHdc, tmpBmp); ++ DeleteDC(tmpHdc); ++ } ++ ++ /* fill the bitfields part, if any */ ++ if(bitFields) ++ memcpy(bmi->bmiColors, ds.dsBitfields, 3 * sizeof(DWORD)); ++ ++ /* adjust dib size for SetDIBits, as it needs it to reverse top-down dibs ++ it must be set to the number of scanLines to transfer */ ++ bmi->bmiHeader.biHeight = topDown ? -scanLines : scanLines; ++ ++ /* creates destination compatible bitmap */ ++ tmpHdc = GetDC(NULL); ++ hBmp = CreateCompatibleBitmap(tmpHdc, dibWidth, scanLines); ++ ReleaseDC(NULL, tmpHdc); ++ if(!hBmp) ++ { ++ ERR("CreateCompatibleBitmap failed\n"); ++ HeapFree( GetProcessHeap(), 0, bmi ); ++ return 0; ++ } ++ ++ /* copies the requested scan lines from DIB to DDB */ ++ /* FIXME : still no support for RLE packed DIBs */ ++ res = SetDIBits( hdc, hBmp, 0, scanLines, bits, bmi, DIB_RGB_COLORS ); ++ HeapFree( GetProcessHeap(), 0, bmi ); ++ if(!res) ++ { ++ ERR("SetDIBits failed\n"); ++ DeleteObject( hBmp ); ++ return 0; ++ } ++ return hBmp; ++} ++ ++/*********************************************************************** ++ * Creates DIB that is compatible with the target hdc. ++ * startScan and scanLines specify the portion of DDB to convert ++ * in order to avoid unneeded conversion of large DDBs on blitting ++ * ++ * NOTE : the srcBmp DDB MUST NOT be selected in any DC */ ++HBITMAP _DIBDRV_ConvertDDBtoDIB( HDC hdc, HBITMAP srcBmp, int startScan, int scanLines ) ++{ ++ HBITMAP hBmp = NULL; ++ BITMAP bitmap; ++ BITMAPINFO *bi; ++ void *bits = NULL; ++ ++ if (!GetObjectW( srcBmp, sizeof(bitmap), &bitmap )) ++ { ++ ERR("Couldn't retrieve source bitmap\n"); ++ return 0; ++ } ++ ++ if(startScan + scanLines >= bitmap.bmHeight) ++ scanLines = bitmap.bmHeight - startScan; ++ ++ bi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) /* + 256 * sizeof(RGBQUAD) */); ++ if (!bi) ++ { ++ ERR("HeapAlloc failed\n"); ++ return 0; ++ } ++ ++ bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ++ bi->bmiHeader.biWidth = bitmap.bmWidth; ++ bi->bmiHeader.biHeight = scanLines; ++ bi->bmiHeader.biPlanes = bitmap.bmPlanes; ++ bi->bmiHeader.biBitCount = 32; /* bitmap.bmBitsPixel; */ ++ bi->bmiHeader.biCompression = BI_RGB; ++ bi->bmiHeader.biSizeImage = 0; ++ ++ /* Get the color table or the color masks */ ++ /* NO NEED -- WE'RE REQUESTING A 32 bit DIB */ ++#if 0 ++ if (!GetDIBits(hdc, srcBmp, startScan, scanLines, NULL, bi, DIB_RGB_COLORS)) ++ { ++ ERR("Couldn't get the color table/masks\n"); ++ HeapFree( GetProcessHeap(), 0, bi ); ++ return 0; ++ } ++#endif ++ ++ /* Create bitmap and fill in bits */ ++ hBmp = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); ++ if(!hBmp) ++ { ++ ERR("Failed to create DIB section\n"); ++ HeapFree( GetProcessHeap(), 0, bi ); ++ return 0; ++ } ++ if (bits) ++ { ++ if(!GetDIBits(hdc, srcBmp, startScan, scanLines, bits, bi, DIB_RGB_COLORS)) ++ { ++ ERR("GetDIBits failed\n"); ++ DeleteObject( hBmp ); ++ HeapFree( GetProcessHeap(), 0, bi ); ++ return 0; ++ } ++ } ++ else ++ { ++ ERR("CreateDibSection couldn't allocate DIB bits\n"); ++ DeleteObject( hBmp ); ++ HeapFree( GetProcessHeap(), 0, bi ); ++ return 0; ++ } ++ HeapFree( GetProcessHeap(), 0, bi ); ++ return hBmp; ++} ++ ++/*********************************************************************** ++ * BITBLT_ConvertDevDDBtoDIB ++ * ++ * Creates DIB that is compatible with the target hdc for a device (non memory) source DC */ ++HBITMAP _DIBDRV_ConvertDevDDBtoDIB( HDC hdcSrc, HDC hdcDst, int xSrc, int ySrc, int width, int height ) ++{ ++ HBITMAP bmp, dib; ++ HDC memHDC = NULL; ++ ++ /* at first, we create a compatible DC and a bitmap with needed sizes */ ++ memHDC = CreateCompatibleDC(hdcSrc); ++ if(!memHDC) ++ { ++ ERR("CreateCompatibleDC failed\n"); ++ return 0; ++ } ++ bmp = CreateCompatibleBitmap(hdcSrc, width, height); ++ if(!bmp) ++ { ++ ERR("CreateCompatibleBitmap failed\n"); ++ DeleteDC(memHDC); ++ return 0; ++ } ++ ++ /* select the newly created DDB into the temporary DC */ ++ bmp = SelectObject(memHDC, bmp); ++ if(!bmp) ++ { ++ ERR("Failed selecting DDB into temporary DC\n"); ++ DeleteObject(bmp); ++ DeleteDC(memHDC); ++ return 0; ++ } ++ ++ /* next, we blit pixels from device to the compatible bitmap */ ++ if(!BitBlt(memHDC, 0, 0, width, height, hdcSrc, xSrc, ySrc, SRCCOPY)) ++ { ++ ERR("BitBlt failed\n"); ++ DeleteObject(bmp); ++ DeleteDC(memHDC); ++ return 0; ++ } ++ ++ /* select out the DDB from the temporary DC */ ++ bmp = SelectObject(memHDC, bmp); ++ DeleteDC(memHDC); ++ if(!bmp) ++ { ++ ERR("Failed selecting DDB out temporary DC\n"); ++ DeleteObject(bmp); ++ return 0; ++ } ++ ++ /*now we can convert the bitmap to a DIB */ ++ dib = _DIBDRV_ConvertDDBtoDIB( hdcDst, bmp, 0, height ); ++ if(!dib) ++ FIXME("ConvertDDBtoDIB failed\n"); ++ ++ /* free resources and return the created dib */ ++ DeleteObject(bmp); ++ return dib; ++} +diff --git a/dlls/winedib.drv/dc.c b/dlls/winedib.drv/dc.c +index c8e3b91..6184677 100644 +--- a/dlls/winedib.drv/dc.c ++++ b/dlls/winedib.drv/dc.c +@@ -25,6 +25,100 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++ ++/* some screen caps */ ++static unsigned int screen_width; ++static unsigned int screen_height; ++static unsigned int screen_bpp; ++static unsigned int screen_depth; ++static RECT virtual_screen_rect; ++ ++/* a few dynamic device caps */ ++static int log_pixels_x; /* pixels per logical inch in x direction */ ++static int log_pixels_y; /* pixels per logical inch in y direction */ ++static int horz_size; /* horz. size of screen in millimeters */ ++static int vert_size; /* vert. size of screen in millimeters */ ++static int palette_size; ++static int device_init_done; ++ ++/* NOTE : ++ Removing TC_RA_ABLE avoids bitmapped fonts, so FT_Face is always non-NULL ++ Adding TC_VA_ABLE forces to use gdi fonts always, so we can get an FT_Face ++*/ ++unsigned int text_caps = (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE | ++ TC_CR_ANY | TC_SA_DOUBLE | TC_SA_INTEGER | ++ TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE /* | TC_RA_ABLE */ | TC_VA_ABLE); ++ /* X11R6 adds TC_SF_X_YINDEP, Xrender adds TC_VA_ABLE */ ++ ++ ++static const WCHAR dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'}; ++static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'}; ++ ++/****************************************************************************** ++ * get_dpi ++ * ++ * get the dpi from the registry ++ */ ++static DWORD get_dpi( void ) ++{ ++ DWORD dpi = 96; ++ HKEY hkey; ++ ++ if (RegOpenKeyW(HKEY_CURRENT_CONFIG, dpi_key_name, &hkey) == ERROR_SUCCESS) ++ { ++ DWORD type, size, new_dpi; ++ ++ size = sizeof(new_dpi); ++ if(RegQueryValueExW(hkey, dpi_value_name, NULL, &type, (void *)&new_dpi, &size) == ERROR_SUCCESS) ++ { ++ if(type == REG_DWORD && new_dpi != 0) ++ dpi = new_dpi; ++ } ++ RegCloseKey(hkey); ++ } ++ return dpi; ++} ++ ++/********************************************************************** ++ * device_init ++ * ++ * Perform initializations needed upon creation of the first device. ++ */ ++static void device_init(void) ++{ ++ Display *display; ++ Screen *screen; ++ ++ /* opens default X11 Display */ ++ if( (display = XOpenDisplay(NULL)) == NULL) ++ return; ++ ++ /* gets default screen */ ++ screen = XDefaultScreenOfDisplay(display); ++ ++ /* gets screen sizes */ ++ screen_width = XWidthOfScreen(screen); ++ screen_height = XHeightOfScreen(screen); ++ ++ /* not sure about these ones... */ ++ screen_bpp = XDefaultDepthOfScreen(screen); ++ screen_depth = XPlanesOfScreen(screen); ++ virtual_screen_rect.left = 0; ++ virtual_screen_rect.top = 0; ++ virtual_screen_rect.right = screen_width; ++ virtual_screen_rect.bottom = screen_height; ++ ++ /* dummy ? */ ++ palette_size = 0; ++ ++ /* Initialize device caps */ ++ log_pixels_x = log_pixels_y = get_dpi(); ++ horz_size = MulDiv( screen_width, 254, log_pixels_x * 10 ); ++ vert_size = MulDiv( screen_height, 254, log_pixels_y * 10 ); ++ ++ device_init_done = TRUE; ++} ++ + /********************************************************************** + * DIBDRV_CreateDC + */ +@@ -34,8 +128,8 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + DIBDRVPHYSDEV *physDev; + PHYSDEV X11PhysDev; + +- TRACE("hdc:%p, pdev:%p, driver:%s, device:%s, output:%s, initData:%p\n", +- hdc, pdev, debugstr_w(driver), debugstr_w(device), debugstr_w(output), initData); ++ MAYBE(TRACE("hdc:%p, pdev:%p, driver:%s, device:%s, output:%s, initData:%p\n", ++ hdc, pdev, debugstr_w(driver), debugstr_w(device), debugstr_w(output), initData)); + + /* allocates physical device */ + physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DIBDRVPHYSDEV) ); +@@ -52,12 +146,53 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + /* sets X11 Device pointer in DIB Engine device */ + physDev->X11PhysDev = X11PhysDev; + ++ /* stores the HDC */ ++ physDev->hdc = hdc; ++ ++ /* initializes device data (for GetDeviceCaps() ) ++ on first DC creation */ ++ if (!device_init_done) ++ device_init(); ++ + /* stock bitmap selected on DC creation */ + physDev->hbitmap = GetStockObject(DEFAULT_BITMAP); + + /* no DIB selected into DC on creation */ + physDev->hasDIB = FALSE; + ++ /* clear physical bitmap */ ++ _DIBDRVBITMAP_Clear(&physDev->physBitmap); ++ ++ /* clears pen and brush */ ++ physDev->rop2 = R2_COPYPEN; ++ ++ physDev->backgroundColor = 0; ++ _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->backgroundAnd, &physDev->backgroundXor); ++ ++ physDev->penColor = 0; ++ _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->penAnd, &physDev->penXor); ++ ++ physDev->brushColor = 0; ++ _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->brushAnd, &physDev->brushXor); ++ physDev->brushAnds = NULL; ++ physDev->brushXors = NULL; ++ ++ physDev->brushStyle = BS_NULL; ++ ++ physDev->isBrushBitmap = FALSE; ++ _DIBDRVBITMAP_Clear(&physDev->brushBitmap); ++ _DIBDRVBITMAP_Clear(&physDev->brushBmpCache); ++ ++ /* text color */ ++ physDev->textColor = 0; ++ physDev->textBackground = 0; ++ ++ /* text color table for antialiased fonts */ ++ memset(physDev->textColorTable, 0, 256); ++ ++ /* freetype face associated to current DC HFONT */ ++ physDev->face = NULL; ++ + /* sets the result value and returns */ + *pdev = physDev; + +@@ -71,16 +206,31 @@ BOOL DIBDRV_DeleteDC( DIBDRVPHYSDEV *physDev ) + { + BOOL res; + +- TRACE("physDev:%p\n", physDev); ++ MAYBE(TRACE("physDev:%p\n", physDev)); + + /* frees X11 device */ + res = _DIBDRV_GetDisplayDriver()->pDeleteDC(physDev->X11PhysDev); + physDev->X11PhysDev = NULL; + ++ /* frees physical bitmap */ ++ _DIBDRVBITMAP_Free(&physDev->physBitmap); ++ ++ /* frees brush bitmap */ ++ _DIBDRVBITMAP_Free(&physDev->brushBitmap); ++ _DIBDRVBITMAP_Free(&physDev->brushBmpCache); ++ ++ /* free brush ands and xors */ ++ if(physDev->brushAnds) ++ { ++ HeapFree(GetProcessHeap(), 0, physDev->brushAnds); ++ HeapFree(GetProcessHeap(), 0, physDev->brushXors); ++ } ++ physDev->brushAnds = NULL; ++ physDev->brushXors = NULL; ++ + /* frees DIB Engine device */ + HeapFree(GetProcessHeap(), 0, physDev); + +- ONCE(FIXME("stub\n")); + return res; + } + +@@ -92,8 +242,8 @@ INT DIBDRV_ExtEscape( DIBDRVPHYSDEV *physDev, INT escape, INT in_count, LPCVOID + { + INT res; + +- TRACE("physDev:%p, escape:%d, in_count:%d, in_data:%p, out_count:%d, out_data:%p\n", +- physDev, escape, in_count, in_data, out_count, out_data); ++ MAYBE(TRACE("physDev:%p, escape:%d, in_count:%d, in_data:%p, out_count:%d, out_data:%p\n", ++ physDev, escape, in_count, in_data, out_count, out_data)); + + if(physDev->hasDIB) + { +@@ -116,13 +266,125 @@ INT DIBDRV_GetDeviceCaps( DIBDRVPHYSDEV *physDev, INT cap ) + { + INT res; + +- TRACE("physDev:%p, cap:%d\n", physDev, cap); ++ MAYBE(TRACE("physDev:%p, cap:%d\n", physDev, cap)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetDeviceCaps(physDev->X11PhysDev, cap); ++ switch(cap) ++ { ++ case DRIVERVERSION: ++ res = 0x300; ++ break; ++ case TECHNOLOGY: ++ res = DT_RASDISPLAY; ++ break; ++ case HORZSIZE: ++ res = horz_size; ++ break; ++ case VERTSIZE: ++ res = vert_size; ++ break; ++ case HORZRES: ++ res = screen_width; ++ break; ++ case VERTRES: ++ res = screen_height; ++ break; ++ case DESKTOPHORZRES: ++ res = virtual_screen_rect.right - virtual_screen_rect.left; ++ break; ++ case DESKTOPVERTRES: ++ res = virtual_screen_rect.bottom - virtual_screen_rect.top; ++ break; ++ case BITSPIXEL: ++ res = screen_bpp; ++ break; ++ case PLANES: ++ res = 1; ++ break; ++ case NUMBRUSHES: ++ res = -1; ++ break; ++ case NUMPENS: ++ res = -1; ++ break; ++ case NUMMARKERS: ++ res = 0; ++ break; ++ case NUMFONTS: ++ res = 0; ++ break; ++ case NUMCOLORS: ++ /* MSDN: Number of entries in the device's color table, if the device has ++ * a color depth of no more than 8 bits per pixel.For devices with greater ++ * color depths, -1 is returned. */ ++ res = (screen_depth > 8) ? -1 : (1 << screen_depth); ++ break; ++ case CURVECAPS: ++ res = (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE | ++ CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT); ++ break; ++ case LINECAPS: ++ res = (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE | ++ LC_STYLED | LC_WIDESTYLED | LC_INTERIORS); ++ break; ++ case POLYGONALCAPS: ++ res = (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE | ++ PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS); ++ break; ++ case TEXTCAPS: ++ res = text_caps; ++ break; ++ case CLIPCAPS: ++ res = CP_REGION; ++ break; ++ case RASTERCAPS: ++ res = (RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 | RC_DI_BITMAP | ++ RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS | ++ (palette_size ? RC_PALETTE : 0)); ++ break; ++ case SHADEBLENDCAPS: ++ res = (SB_GRAD_RECT | SB_GRAD_TRI | SB_CONST_ALPHA | SB_PIXEL_ALPHA); ++ case ASPECTX: ++ case ASPECTY: ++ res = 36; ++ break; ++ case ASPECTXY: ++ res = 51; ++ break; ++ case LOGPIXELSX: ++ res = log_pixels_x; ++ break; ++ case LOGPIXELSY: ++ res = log_pixels_y; ++ break; ++ case CAPS1: ++ FIXME("(%p): CAPS1 is unimplemented, will return 0\n", physDev->hdc ); ++ /* please see wingdi.h for the possible bit-flag values that need ++ to be returned. */ ++ res = 0; ++ break; ++ case SIZEPALETTE: ++ res = palette_size; ++ break; ++ case NUMRESERVED: ++ case COLORRES: ++ case PHYSICALWIDTH: ++ case PHYSICALHEIGHT: ++ case PHYSICALOFFSETX: ++ case PHYSICALOFFSETY: ++ case SCALINGFACTORX: ++ case SCALINGFACTORY: ++ case VREFRESH: ++ case BLTALIGNMENT: ++ res = 0; ++ break; ++ default: ++ FIXME("(%p): unsupported capability %d, will return 0\n", physDev->hdc, cap ); ++ res = 0; ++ break; ++ } + } + else + { +diff --git a/dlls/winedib.drv/dib.c b/dlls/winedib.drv/dib.c +index 28330fa..b72c34a 100644 +--- a/dlls/winedib.drv/dib.c ++++ b/dlls/winedib.drv/dib.c +@@ -33,11 +33,11 @@ HBITMAP DIBDRV_CreateDIBSection( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, + { + HBITMAP res; + +- TRACE("physDev:%p, hbitmap:%p, bmi:%p, usage:%d\n", physDev, hbitmap, bmi, usage); ++ MAYBE(TRACE("physDev:%p, hbitmap:%p, bmi:%p, usage:%d\n", physDev, hbitmap, bmi, usage)); + + /* createDIBSection is only DIB-related, so we just use the engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pCreateDIBSection(physDev->X11PhysDev, hbitmap, bmi, usage); ++ ONCE(FIXME("STUB\n")); ++ res = hbitmap; + + return res; + } +@@ -50,8 +50,8 @@ INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + { + INT res; + +- TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", +- physDev, hbitmap, startscan, lines, bits, bmi, coloruse); ++ MAYBE(TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", ++ physDev, hbitmap, startscan, lines, bits, bmi, coloruse)); + + /* GetDIBits reads bits from a DDB, so we should use the X11 driver */ + res = _DIBDRV_GetDisplayDriver()->pGetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, bmi, coloruse); +@@ -67,11 +67,11 @@ UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + { + UINT res; + +- TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors); ++ MAYBE(TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors)); + + /* SetDIBColorTable operates on a DIB, so we use the engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetDIBColorTable(physDev->X11PhysDev, start, count, colors); ++ ONCE(FIXME("STUB\n")); ++ res = 0; + + return res; + } +@@ -84,8 +84,8 @@ INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + { + INT res; + +- TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", +- physDev, hbitmap, startscan, lines, bits, info, coloruse); ++ MAYBE(TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", ++ physDev, hbitmap, startscan, lines, bits, info, coloruse)); + + /* SetDIBits writes bits to a DDB, so we should use the X11 driver */ + res = _DIBDRV_GetDisplayDriver()->pSetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse); +@@ -103,8 +103,8 @@ INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDest, INT yDest, DWOR + { + INT res; + +- TRACE("physDev:%p, xDest:%d, yDest:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", +- physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse); ++ MAYBE(TRACE("physDev:%p, xDest:%d, yDest:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", ++ physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse)); + + /* SetDIBitsToDevice operates on a physical device, so we should use the X11 driver */ + res = _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc, +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 8a2e139..773941e 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -35,10 +35,15 @@ + #include "winreg.h" + #include "wine/winbase16.h" /* GlobalLock16 */ + ++#include "freetype.h" ++ + /* data structures needed to access opaque pointers + * defined in gdi32.h */ + #include "dibdrv_gdi32.h" + ++/* enable this if you want debugging (i.e. TRACEs) output */ ++#define DIBDRV_ENABLE_MAYBE ++ + /* provide a way to make debugging output appear + only once. Usage example: + ONCE(FIXME("Some message\n")); */ +@@ -52,25 +57,197 @@ + } \ + } + ++/* provide a way to make debugging output appear ++ only if enabled here. Can speed up stuffs ++ avoiding long traces.Usage example: ++ MAYBE(TRACE("Some message\n")); */ ++#ifdef DIBDRV_ENABLE_MAYBE ++#define MAYBE(x) x ++#else ++#define MAYBE(x) ++#endif ++ ++ + /* extra stock object: default 1x1 bitmap for memory DCs + grabbed from gdi_private.h */ + #define DEFAULT_BITMAP (STOCK_LAST+1) + ++struct _DIBDRVBITMAP; ++struct _DIBDRVPHYSDEV; ++typedef struct _DIBDRV_PRIMITIVE_FUNCS ++{ ++ /* color to pixel data conversion */ ++ DWORD (* ColorToPixel) (const struct _DIBDRVBITMAP *bmp, COLORREF color); ++ ++ /* pixel primitives */ ++ void* (* GetPixelPointer) (const struct _DIBDRVBITMAP *bmp, int x, int y); ++ void (* SetPixel) ( struct _DIBDRVBITMAP *bmp, int x, int y, DWORD and, DWORD xor); ++ DWORD (* GetPixel) (const struct _DIBDRVBITMAP *bmp, int x, int y); ++ ++ /* line drawing primitives */ ++ void (* SolidHLine) ( struct _DIBDRVBITMAP *bmp, int x1, int x2, int y, DWORD and, DWORD xor); ++ void (* PatternHLine) ( struct _DIBDRVBITMAP *bmp, int x1, int x2, int y, const void *and, const void *xor, DWORD offset, DWORD count); ++ void (* SolidVLine) ( struct _DIBDRVBITMAP *bmp, int x, int y1, int y2, DWORD and, DWORD xor); ++ ++ /* bitmap conversion helpers */ ++ BOOL (* GetLine) (const struct _DIBDRVBITMAP *bmp, int line, int startx, int width, void *buf); ++ BOOL (* PutLine) ( struct _DIBDRVBITMAP *bmp, int line, int startx, int width, void *buf); ++ ++ /* BitBlt primitives */ ++ BOOL (* BitBlt) ( struct _DIBDRVPHYSDEV *physDevDst, int xDst, int yDst, int width, int height, ++ const struct _DIBDRVPHYSDEV *physDevSrc, int xSrc, int ySrc, DWORD rop ); ++ BOOL (* StretchBlt) ( struct _DIBDRVPHYSDEV *physDevDst, int xDst, int yDst, int widthDst, int heightDst, ++ const struct _DIBDRVPHYSDEV *physDevSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, DWORD rop ); ++ ++ /* font drawing helper */ ++ void (* FreetypeBlit) ( struct _DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp); ++ ++} DIBDRV_PRIMITIVE_FUNCS; ++ ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_RGB; ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_BITFIELDS; ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB24; ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_RGB; ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_BITFIELDS; ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB8; ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB4; ++extern DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB1; ++ ++/* DIB bitmaps formats */ ++typedef enum _DIBFORMAT ++{ ++ DIBFMT_UNKNOWN = 0, ++ DIBFMT_DIB1 = 1, ++ DIBFMT_DIB4 = 2, ++ DIBFMT_DIB4_RLE = 3, ++ DIBFMT_DIB8 = 4, ++ DIBFMT_DIB8_RLE = 5, ++ DIBFMT_DIB16_RGB = 6, ++ DIBFMT_DIB16_BITFIELDS = 7, ++ DIBFMT_DIB24 = 8, ++ DIBFMT_DIB32_RGB = 9, ++ DIBFMT_DIB32_BITFIELDS = 10 ++} DIBFORMAT; ++ ++/* DIB driver's generic bitmap structure */ ++typedef struct _DIBDRVBITMAP ++{ ++ /* bitmap format of dib */ ++ DIBFORMAT format; ++ ++ /* pointer to top left corner of bitmap */ ++ void *bits; ++ ++ /* flags indicating if bits array is owned ++ by the bitmap */ ++ BOOL ownsBits; ++ ++ /* bitmap dimensions */ ++ int width; ++ int height; ++ ++ /* bitmap stride (== width in bytes) of a bitmap line */ ++ /* negative for a bottom-up bitmap */ ++ int stride; ++ ++ /* number of bits/pixel in bitmap */ ++ int bitCount; ++ ++ /* calculated numbers for bitfields */ ++ ++ /* bitfields masks */ ++ DWORD redMask, greenMask, blueMask; ++ /* shifting required within a COLORREF's BYTE */ ++ int redShift, greenShift, blueShift; ++ /* size of the fields */ ++ int redLen, greenLen, blueLen; ++ ++ /* color table and its size */ ++ RGBQUAD *colorTable; ++ DWORD colorTableSize; ++ ++ /* flag indicating that color table has been grabbed */ ++ BOOL colorTableGrabbed; ++ ++ /* primitive function pointers */ ++ DIBDRV_PRIMITIVE_FUNCS *funcs; ++ ++} DIBDRVBITMAP; ++ ++/* dash patterns */ ++typedef struct _DASHPATTERN ++{ ++ DWORD count; ++ DWORD dashes[6]; ++ ++} DASHPATTERN; ++ + /* DIB driver physical device */ + typedef struct _DIBDRVPHYSDEV + { + /* X11 driver physical device */ + PHYSDEV X11PhysDev; + ++ /* HDC associated with physDev */ ++ HDC hdc; ++ + /* is a DIB selected into DC ? */ + BOOL hasDIB; + + /* currently selected HBITMAP */ + HBITMAP hbitmap; ++ ++ /* physical bitmap */ ++ DIBDRVBITMAP physBitmap; + + /* active ROP2 */ + INT rop2; + ++ /* background color and active ROP2 precalculated ++ AND and XOR values for it */ ++ COLORREF backgroundColor; ++ DWORD backgroundAnd, backgroundXor; ++ ++ /* pen color and active ROP2 precalculated ++ AND and XOR values for it */ ++ COLORREF penColorref; ++ DWORD penColor; ++ DWORD penAnd, penXor; ++ const DASHPATTERN *penPattern; ++ DWORD curDash, leftInDash; ++ enum MARKSPACE { mark, space } markSpace; ++ ++ /* pen drawing functions */ ++ void (* penHLine) (struct _DIBDRVPHYSDEV *physDev, int x1, int x2, int y); ++ void (* penVLine) (struct _DIBDRVPHYSDEV *physDev, int x, int y1, int y2); ++ void (* penLine) (struct _DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2); ++ void (* brushHLine)(struct _DIBDRVPHYSDEV *physDev, int x1, int x2, int y); ++ ++ /* brush color and active ROP2 precalculated ++ AND and XOR values for it */ ++ COLORREF brushColorref; ++ DWORD brushColor; ++ DWORD brushAnd, brushXor; ++ DWORD *brushAnds, *brushXors; ++ ++ /* brush style */ ++ UINT brushStyle; ++ ++ /* brush bitmap, if needed, and its converted/resized cache copy */ ++ BOOL isBrushBitmap; ++ DIBDRVBITMAP brushBitmap; ++ DIBDRVBITMAP brushBmpCache; ++ ++ /* text color */ ++ COLORREF textColor; ++ COLORREF textBackground; ++ ++ /* text color table for antialiased fonts */ ++ COLORREF textColorTable[256]; ++ ++ /* freetype face associated to current DC HFONT */ ++ FT_Face face; ++ + } DIBDRVPHYSDEV; + + +@@ -90,4 +267,117 @@ void _DIBDRV_FreeDisplayDriver(void); + Gets a pointer to display drives'function table */ + inline DC_FUNCTIONS *_DIBDRV_GetDisplayDriver(void); + +-#endif /* __WINE_DIBDRV_H */ ++/* ********************************************************************* ++ * ROP2 AND OTHER DRAWING RELATED FUNCTIONS ++ * ********************************************************************/ ++ ++void _DIBDRV_CalcAndXorMasks(INT rop, DWORD color, DWORD *and, DWORD *xor); ++ ++inline void _DIBDRV_rop32(DWORD *ptr, DWORD and, DWORD xor); ++inline void _DIBDRV_rop16(WORD *ptr, WORD and, WORD xor); ++inline void _DIBDRV_rop8(BYTE *ptr, BYTE and, BYTE xor); ++ ++void _DIBDRV_ResetDashOrigin(DIBDRVPHYSDEV *physDev); ++ ++/* ********************************************************************* ++ * ROP2 FUNCTIONS ++ * ********************************************************************/ ++ ++/* the ROP3 operations ++ this is a BIG case block; beware that some ++ commons ROP3 operations will be optimized ++ from inside blt routines */ ++DWORD _DIBDRV_ROP3(DWORD p, DWORD s, DWORD d, BYTE rop); ++ ++/* ********************************************************************* ++ * PHYSICAL BITMAP FUNCTIONS ++ * ********************************************************************/ ++ ++/* gets human-readable dib format name */ ++const char *_DIBDRVBITMAP_GetFormatName(DIBDRVBITMAP const *bmp); ++ ++/* initializes dib from a bitmap : ++ dib dib being initialized ++ bi source BITMAPINFOHEADER with required DIB format info ++ bit_fields color masks ++ color_table color table, if any ++ bits pointer to image data array ++ NOTE : DIBDRVBITMAP doesn't owns bits, but do own color table */ ++BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields, ++ const RGBQUAD *color_table, void *bits); ++ ++BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, BITMAPINFO *bmi); ++ ++/* initializes a DIBRDVBITMAP copying it from a source one ++ Parameters : ++ dib destination DIBDRVBITMAP ++ src source DIBDRVBITMAP ++ copy TRUE->copy source pixel array FALSE->link to source pixel array */ ++BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *src, BOOL copy); ++ ++/* creates a DIBRDVBITMAP copying format info from a source one ++ Parameters : ++ dib destination DIBDRVBITMAP ++ src source DIBDRVBITMAP ++ widht, height sizes of newly created bitmap */ ++BOOL _DIBDRVBITMAP_CreateFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *src, int width, int height); ++ ++/* Clears a DIBDRVBITMAP structure data ++ WARNING : doesn't free anything */ ++void _DIBDRVBITMAP_Clear(DIBDRVBITMAP *bmp); ++ ++/* Frees a DIBDRVBITMAP structure data */ ++void _DIBDRVBITMAP_Free(DIBDRVBITMAP *bmp); ++ ++/* checks whether the format of 2 DIBs are identical ++ it checks the pixel bit count and the color table size ++ and content, if needed */ ++BOOL _DIBDRVBITMAP_FormatMatch(const DIBDRVBITMAP *d1, const DIBDRVBITMAP *d2); ++ ++/* convert a given dib into another format given by 'format' parameter */ ++BOOL _DIBDRVBITMAP_Convert(DIBDRVBITMAP *dst, const DIBDRVBITMAP *src, const DIBDRVBITMAP *format); ++ ++/* creates a solid-filled DIB of given color and format ++ DIB format is given by 'format' parameter */ ++BOOL _DIBDRVBITMAP_CreateSolid(DIBDRVBITMAP *bmp, DIBDRVBITMAP *format, int width, int height, DWORD Color); ++ ++/* expands horizontally a bitmap to reach a minimum size, ++ keeping its width as a multiple of a base width ++ Used to widen brushes in order to optimize blitting */ ++BOOL _DIBDRVBITMAP_ExpandHoriz(DIBDRVBITMAP *dib, int baseWidth, int minWidth); ++ ++/* ********************************************************************* ++ * DIB <--> DDB CONVERSION ROUTINES ++ * ********************************************************************/ ++ ++/*********************************************************************** ++ * Creates DDB that is compatible with source hdc. ++ * hdc is the HDC on where the DIB MUST be selected in ++ * srcBmp is the source DIB ++ * startScan and scanLines specify the portion of DIB to convert ++ * in order to avoid unneeded conversion of large DIBs on blitting ++ * ++ * NOTE : the srcBmp DIB MUST NOT be selected in any DC */ ++HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int scanLines ); ++ ++/*********************************************************************** ++ * Creates DIB that is compatible with the target hdc. ++ * startScan and scanLines specify the portion of DDB to convert ++ * in order to avoid unneeded conversion of large DDBs on blitting ++ * ++ * NOTE : the srcBmp DDB MUST NOT be selected in any DC */ ++HBITMAP _DIBDRV_ConvertDDBtoDIB( HDC hdc, HBITMAP srcBmp, int startScan, int scanLines ); ++ ++/*********************************************************************** ++ * Creates DIB that is compatible with the target hdc for a device (non memory) source DC */ ++HBITMAP _DIBDRV_ConvertDevDDBtoDIB( HDC hdcSrc, HDC hdcDst, int xSrc, int ySrc, int width, int height ); ++ ++/* ********************************************************************* ++ * QUERY FUNCTIONS ++ * ********************************************************************/ ++ ++/*********************************************************************** ++ * DIBDRV_GetDeviceCaps */ ++INT DIBDRV_GetDeviceCaps( DIBDRVPHYSDEV *physDev, INT cap ); ++ ++#endif +diff --git a/dlls/winedib.drv/dibdrv_gdi32.h b/dlls/winedib.drv/dibdrv_gdi32.h +new file mode 100644 +index 0000000..8e4eb05 +--- /dev/null ++++ b/dlls/winedib.drv/dibdrv_gdi32.h +@@ -0,0 +1,168 @@ ++/* ++ * GDI structures - grabbed from dlls/gdi32/gdi_private.h ++ * Those are needed to access some opaque gdi32 pointers ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef __WINE_DIBDRV_GDI32_H ++#define __WINE_DIBDRV_GDI32_H ++ ++ ++/* driver function pointers - used here to forward calls to X11 driver when needed */ ++typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */ ++typedef struct tagDC_FUNCS ++{ ++ INT (CDECL *pAbortDoc)(PHYSDEV); ++ BOOL (CDECL *pAbortPath)(PHYSDEV); ++ BOOL (CDECL *pAlphaBlend)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,BLENDFUNCTION); ++ BOOL (CDECL *pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT); ++ BOOL (CDECL *pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); ++ BOOL (CDECL *pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); ++ BOOL (CDECL *pBeginPath)(PHYSDEV); ++ BOOL (CDECL *pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD); ++ INT (CDECL *pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *); ++ BOOL (CDECL *pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); ++ BOOL (CDECL *pCloseFigure)(PHYSDEV); ++ BOOL (CDECL *pCreateBitmap)(PHYSDEV,HBITMAP,LPVOID); ++ BOOL (CDECL *pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*); ++ HBITMAP (CDECL *pCreateDIBSection)(PHYSDEV,HBITMAP,const BITMAPINFO *,UINT); ++ BOOL (CDECL *pDeleteBitmap)(HBITMAP); ++ BOOL (CDECL *pDeleteDC)(PHYSDEV); ++ BOOL (CDECL *pDeleteObject)(PHYSDEV,HGDIOBJ); ++ INT (CDECL *pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *); ++ DWORD (CDECL *pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA); ++ BOOL (CDECL *pEllipse)(PHYSDEV,INT,INT,INT,INT); ++ INT (CDECL *pEndDoc)(PHYSDEV); ++ INT (CDECL *pEndPage)(PHYSDEV); ++ BOOL (CDECL *pEndPath)(PHYSDEV); ++ BOOL (CDECL *pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM); ++ INT (CDECL *pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT); ++ INT (CDECL *pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD); ++ INT (CDECL *pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID); ++ BOOL (CDECL *pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT); ++ INT (CDECL *pExtSelectClipRgn)(PHYSDEV,HRGN,INT); ++ BOOL (CDECL *pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*); ++ BOOL (CDECL *pFillPath)(PHYSDEV); ++ BOOL (CDECL *pFillRgn)(PHYSDEV,HRGN,HBRUSH); ++ BOOL (CDECL *pFlattenPath)(PHYSDEV); ++ BOOL (CDECL *pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT); ++ BOOL (CDECL *pGdiComment)(PHYSDEV,UINT,CONST BYTE*); ++ LONG (CDECL *pGetBitmapBits)(HBITMAP,void*,LONG); ++ BOOL (CDECL *pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT); ++ BOOL (CDECL *pGetDCOrgEx)(PHYSDEV,LPPOINT); ++ UINT (CDECL *pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*); ++ INT (CDECL *pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT); ++ INT (CDECL *pGetDeviceCaps)(PHYSDEV,INT); ++ BOOL (CDECL *pGetDeviceGammaRamp)(PHYSDEV,LPVOID); ++ BOOL (CDECL *pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR); ++ COLORREF (CDECL *pGetNearestColor)(PHYSDEV,COLORREF); ++ COLORREF (CDECL *pGetPixel)(PHYSDEV,INT,INT); ++ INT (CDECL *pGetPixelFormat)(PHYSDEV); ++ UINT (CDECL *pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY); ++ BOOL (CDECL *pGetTextExtentExPoint)(PHYSDEV,LPCWSTR,INT,INT,LPINT,LPINT,LPSIZE); ++ BOOL (CDECL *CDECL pGetTextMetrics)(PHYSDEV,TEXTMETRICW*); ++ INT (CDECL *pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT); ++ BOOL (CDECL *pInvertRgn)(PHYSDEV,HRGN); ++ BOOL (CDECL *pLineTo)(PHYSDEV,INT,INT); ++ BOOL (CDECL *pModifyWorldTransform)(PHYSDEV,const XFORM*,INT); ++ BOOL (CDECL *pMoveTo)(PHYSDEV,INT,INT); ++ INT (CDECL *pOffsetClipRgn)(PHYSDEV,INT,INT); ++ INT (CDECL *pOffsetViewportOrg)(PHYSDEV,INT,INT); ++ INT (CDECL *pOffsetWindowOrg)(PHYSDEV,INT,INT); ++ BOOL (CDECL *pPaintRgn)(PHYSDEV,HRGN); ++ BOOL (CDECL *pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD); ++ BOOL (CDECL *pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); ++ BOOL (CDECL *pPolyBezier)(PHYSDEV,const POINT*,DWORD); ++ BOOL (CDECL *pPolyBezierTo)(PHYSDEV,const POINT*,DWORD); ++ BOOL (CDECL *pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD); ++ BOOL (CDECL *pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT); ++ BOOL (CDECL *pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD); ++ BOOL (CDECL *pPolygon)(PHYSDEV,const POINT*,INT); ++ BOOL (CDECL *pPolyline)(PHYSDEV,const POINT*,INT); ++ BOOL (CDECL *pPolylineTo)(PHYSDEV,const POINT*,INT); ++ UINT (CDECL *pRealizeDefaultPalette)(PHYSDEV); ++ UINT (CDECL *pRealizePalette)(PHYSDEV,HPALETTE,BOOL); ++ BOOL (CDECL *pRectangle)(PHYSDEV,INT,INT,INT,INT); ++ HDC (CDECL *pResetDC)(PHYSDEV,const DEVMODEW*); ++ BOOL (CDECL *pRestoreDC)(PHYSDEV,INT); ++ BOOL (CDECL *pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT); ++ INT (CDECL *pSaveDC)(PHYSDEV); ++ INT (CDECL *pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT); ++ INT (CDECL *pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT); ++ HBITMAP (CDECL *pSelectBitmap)(PHYSDEV,HBITMAP); ++ HBRUSH (CDECL *pSelectBrush)(PHYSDEV,HBRUSH); ++ BOOL (CDECL *pSelectClipPath)(PHYSDEV,INT); ++ HFONT (CDECL *pSelectFont)(PHYSDEV,HFONT,HANDLE); ++ HPALETTE (CDECL *pSelectPalette)(PHYSDEV,HPALETTE,BOOL); ++ HPEN (CDECL *pSelectPen)(PHYSDEV,HPEN); ++ INT (CDECL *pSetArcDirection)(PHYSDEV,INT); ++ LONG (CDECL *pSetBitmapBits)(HBITMAP,const void*,LONG); ++ COLORREF (CDECL *pSetBkColor)(PHYSDEV,COLORREF); ++ INT (CDECL *pSetBkMode)(PHYSDEV,INT); ++ COLORREF (CDECL *pSetDCBrushColor)(PHYSDEV, COLORREF); ++ DWORD (CDECL *pSetDCOrg)(PHYSDEV,INT,INT); ++ COLORREF (CDECL *pSetDCPenColor)(PHYSDEV, COLORREF); ++ UINT (CDECL *pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*); ++ INT (CDECL *pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT); ++ INT (CDECL *pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID, ++ const BITMAPINFO*,UINT); ++ VOID (CDECL *pSetDeviceClipping)(PHYSDEV,HRGN,HRGN); ++ BOOL (CDECL *pSetDeviceGammaRamp)(PHYSDEV,LPVOID); ++ INT (CDECL *pSetMapMode)(PHYSDEV,INT); ++ DWORD (CDECL *pSetMapperFlags)(PHYSDEV,DWORD); ++ COLORREF (CDECL *pSetPixel)(PHYSDEV,INT,INT,COLORREF); ++ BOOL (CDECL *pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *); ++ INT (CDECL *pSetPolyFillMode)(PHYSDEV,INT); ++ INT (CDECL *pSetROP2)(PHYSDEV,INT); ++ INT (CDECL *pSetRelAbs)(PHYSDEV,INT); ++ INT (CDECL *pSetStretchBltMode)(PHYSDEV,INT); ++ UINT (CDECL *pSetTextAlign)(PHYSDEV,UINT); ++ INT (CDECL *pSetTextCharacterExtra)(PHYSDEV,INT); ++ DWORD (CDECL *pSetTextColor)(PHYSDEV,DWORD); ++ INT (CDECL *pSetTextJustification)(PHYSDEV,INT,INT); ++ INT (CDECL *pSetViewportExt)(PHYSDEV,INT,INT); ++ INT (CDECL *pSetViewportOrg)(PHYSDEV,INT,INT); ++ INT (CDECL *pSetWindowExt)(PHYSDEV,INT,INT); ++ INT (CDECL *pSetWindowOrg)(PHYSDEV,INT,INT); ++ BOOL (CDECL *pSetWorldTransform)(PHYSDEV,const XFORM*); ++ INT (CDECL *pStartDoc)(PHYSDEV,const DOCINFOW*); ++ INT (CDECL *pStartPage)(PHYSDEV); ++ BOOL (CDECL *pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD); ++ INT (CDECL *pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *, ++ const BITMAPINFO*,UINT,DWORD); ++ BOOL (CDECL *pStrokeAndFillPath)(PHYSDEV); ++ BOOL (CDECL *pStrokePath)(PHYSDEV); ++ BOOL (CDECL *pSwapBuffers)(PHYSDEV); ++ BOOL (CDECL *pUnrealizePalette)(HPALETTE); ++ BOOL (CDECL *pWidenPath)(PHYSDEV); ++ ++ /* OpenGL32 */ ++ BOOL (CDECL *pwglCopyContext)(HGLRC, HGLRC, UINT); ++ HGLRC (CDECL *pwglCreateContext)(PHYSDEV); ++ BOOL (CDECL *pwglDeleteContext)(HGLRC); ++ PROC (CDECL *pwglGetProcAddress)(LPCSTR); ++ HDC (CDECL *pwglGetPbufferDCARB)(PHYSDEV, void*); ++ BOOL (CDECL *pwglMakeCurrent)(PHYSDEV, HGLRC); ++ BOOL (CDECL *pwglMakeContextCurrentARB)(PHYSDEV, PHYSDEV, HGLRC); ++ BOOL (CDECL *pwglSetPixelFormatWINE)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *); ++ BOOL (CDECL *pwglShareLists)(HGLRC hglrc1, HGLRC hglrc2); ++ BOOL (CDECL *pwglUseFontBitmapsA)(PHYSDEV, DWORD, DWORD, DWORD); ++ BOOL (CDECL *pwglUseFontBitmapsW)(PHYSDEV, DWORD, DWORD, DWORD); ++} DC_FUNCTIONS; ++ ++#endif +diff --git a/dlls/winedib.drv/dibdrv_main.c b/dlls/winedib.drv/dibdrv_main.c +index 28429d2..e436440 100644 +--- a/dlls/winedib.drv/dibdrv_main.c ++++ b/dlls/winedib.drv/dibdrv_main.c +@@ -35,15 +35,26 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) + switch(reason) + { + case DLL_PROCESS_ATTACH: ++ + /* Loads display driver */ + _DIBDRV_LoadDisplayDriver(); ++ ++ /* initializes freetype library */ ++ if(!_DIBDRV_FreeType_Init()) ++ ERR("Couldn't initialize freetype library.\n"); ++ + break; + case DLL_THREAD_DETACH: + /* do thread detach */ + break; + case DLL_PROCESS_DETACH: ++ ++ /* terminates freetype library */ ++ _DIBDRV_FreeType_Terminate(); ++ + /* unloads display driver */ + _DIBDRV_FreeDisplayDriver(); ++ + break; + } + return ret; +diff --git a/dlls/winedib.drv/dibdrvbitmap.c b/dlls/winedib.drv/dibdrvbitmap.c +new file mode 100644 +index 0000000..2c8c367 +--- /dev/null ++++ b/dlls/winedib.drv/dibdrvbitmap.c +@@ -0,0 +1,650 @@ ++/* ++ * DIB Engine DIBDRVBITMAP handling ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* gets human-readable dib format name */ ++const char *_DIBDRVBITMAP_GetFormatName(DIBDRVBITMAP const *bmp) ++{ ++ if(!bmp) ++ { ++ ERR("Null bitmap\n"); ++ return "NULL BITMAP DETECTED"; ++ } ++ switch(bmp->format) ++ { ++ case DIBFMT_DIB1: ++ return "DIBFMT_DIB1"; ++ case DIBFMT_DIB4: ++ return "DIBFMT_DIB4"; ++ case DIBFMT_DIB4_RLE: ++ return "DIBFMT_DIB4_RLE"; ++ case DIBFMT_DIB8: ++ return "DIBFMT_DIB8"; ++ case DIBFMT_DIB8_RLE: ++ return "DIBFMT_DIB8_RLE"; ++ case DIBFMT_DIB16_RGB: ++ return "DIBFMT_DIB_RGB"; ++ case DIBFMT_DIB16_BITFIELDS: ++ return "DIBFMT_DIB16_BITFIELDS"; ++ case DIBFMT_DIB24: ++ return "DIBFMT_DIB24"; ++ case DIBFMT_DIB32_RGB: ++ return "DIBFMT_DIB32_RGB"; ++ case DIBFMT_DIB32_BITFIELDS: ++ return "DIBFMT_DIB32_BITFIELDS"; ++ case DIBFMT_UNKNOWN: ++ default: ++ return "DIBFMT_UNKNOWN"; ++ } ++} ++ ++/* calculates shift and length given a bit mask */ ++static void CalcShiftAndLen(DWORD mask, int *shift, int *len) ++{ ++ int s, l; ++ ++ /* FIXME----*/ ++ if(mask == 0) ++ { ++ FIXME("color mask == 0 -- problem on init_dib\n"); ++ *shift = 0; ++ *len = 0; ++ return; ++ } ++ ++ /* calculates bit shift ++ (number of 0's on right of bit field */ ++ s = 0; ++ while ((mask & 1) == 0) ++ { ++ mask >>= 1; ++ s++; ++ } ++ ++ /* calculates bitfield length ++ (number of 1's in bit field */ ++ l = 0; ++ while ((mask & 1) == 1) ++ { ++ mask >>= 1; ++ l++; ++ } ++ *shift = s; ++ *len = l; ++} ++ ++/* initializes bit fields from bit masks */ ++static void InitBitFields(DIBDRVBITMAP *dib, const DWORD *bit_fields) ++{ ++ dib->redMask = bit_fields[0]; ++ dib->greenMask = bit_fields[1]; ++ dib->blueMask = bit_fields[2]; ++ CalcShiftAndLen(dib->redMask, &dib->redShift, &dib->redLen); ++ CalcShiftAndLen(dib->greenMask, &dib->greenShift, &dib->greenLen); ++ CalcShiftAndLen(dib->blueMask, &dib->blueShift, &dib->blueLen); ++} ++ ++/* initializes dib from a bitmap : ++ dib dib being initialized ++ bi source BITMAPINFOHEADER with required DIB format info ++ bit_fields color masks ++ colorTable color table, if any ++ bits pointer to image data array ++ NOTE : DIBDRVBITMAP doesn't owns bits, but do own color table ++*/ ++BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields, ++ const RGBQUAD *colorTable, void *bits) ++{ ++ MAYBE(TRACE("dib=%p, bi=%p, bit_fields=%p, colorTable=%p, bits=%p\n", dib, bi, bit_fields, colorTable, bits)); ++ ++ /* initializes DIB dimensions and color depth */ ++ dib->bitCount = bi->biBitCount; ++ dib->width = bi->biWidth; ++ dib->height = bi->biHeight; ++ dib->stride = ((dib->width * dib->bitCount + 31) >> 3) & ~3; ++ ++ /* initializes image data pointer */ ++ dib->bits = bits; ++ dib->ownsBits = FALSE; ++ ++ /* initializes color table */ ++ dib->colorTableSize = 0; ++ dib->colorTable = NULL; ++ dib->colorTableGrabbed = FALSE; ++ ++ /* checks whether dib is top-down or bottom-up one */ ++ if(dib->height < 0) ++ { ++ /* top-down dib */ ++ dib->height = -dib->height; ++ } ++ else ++ { ++ /* bottom-up dib */ ++ /* data->bits always points to the top-left corner and the stride is -ve */ ++ dib->bits = (BYTE*)dib->bits + (dib->height - 1) * dib->stride; ++ dib->stride = -dib->stride; ++ } ++ ++ /* gets and stores bitmap format */ ++ switch(dib->bitCount) ++ { ++ case 24: ++ dib->format = DIBFMT_DIB24; ++ dib->funcs = &DIBDRV_funcs_DIB24; ++ break; ++ ++ case 32: ++ ++ if(bi->biCompression == BI_RGB) ++ { ++ dib->format = DIBFMT_DIB32_RGB; ++ dib->funcs = &DIBDRV_funcs_DIB32_RGB; ++ } ++ else ++ { ++ InitBitFields(dib, bit_fields); ++ dib->format = DIBFMT_DIB32_BITFIELDS; ++ dib->funcs = &DIBDRV_funcs_DIB32_BITFIELDS; ++ } ++ break; ++ ++ case 16: ++ if(bi->biCompression == BI_RGB) ++ { ++ dib->format = DIBFMT_DIB16_RGB; ++ dib->funcs = &DIBDRV_funcs_DIB16_RGB; ++ } ++ else ++ { ++ InitBitFields(dib, bit_fields); ++ dib->format = DIBFMT_DIB16_BITFIELDS; ++ dib->funcs = &DIBDRV_funcs_DIB16_BITFIELDS; ++ } ++ break; ++ ++ case 8: ++ dib->format = DIBFMT_DIB8; ++ dib->funcs = &DIBDRV_funcs_DIB8; ++ dib->colorTableSize = 256; ++ if(bi->biClrUsed) dib->colorTableSize = bi->biClrUsed; ++ break; ++ ++ case 4: ++ dib->format = DIBFMT_DIB4; ++ dib->funcs = &DIBDRV_funcs_DIB4; ++ dib->colorTableSize = 16; ++ if(bi->biClrUsed) dib->colorTableSize = bi->biClrUsed; ++ break; ++ ++ case 1: ++ dib->format = DIBFMT_DIB1; ++ dib->funcs = &DIBDRV_funcs_DIB1; ++ dib->colorTableSize = 2; ++ if(bi->biClrUsed) dib->colorTableSize = bi->biClrUsed; ++ break; ++ ++ default: ++ dib->format = DIBFMT_UNKNOWN; ++ dib->funcs = NULL; ++ FIXME("bpp %d not supported\n", dib->bitCount); ++ return FALSE; ++ } ++ MAYBE(TRACE("DIB FORMAT : %s\n", _DIBDRVBITMAP_GetFormatName(dib))); ++ ++ /* allocates color table and copy it from source, *if* source is ++ not null */ ++ if(dib->colorTableSize && colorTable) ++ { ++ if(!(dib->colorTable = HeapAlloc(GetProcessHeap(), 0, ++ dib->colorTableSize * sizeof(dib->colorTable[0])) ++ )) ++ { ++ ERR("HeapAlloc failed\n"); ++ return FALSE; ++ } ++ memcpy(dib->colorTable, colorTable, ++ dib->colorTableSize * sizeof(dib->colorTable[0])); ++ dib->colorTableGrabbed = TRUE; ++ } ++ else if(!dib->colorTableSize) ++ /* no color table on more than 8 bits/pixel */ ++ dib->colorTableGrabbed = TRUE; ++ ++ MAYBE(TRACE("END\n")); ++ return TRUE; ++} ++ ++BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, BITMAPINFO *bmi) ++{ ++ static const DWORD bit_fields_DIB32_RGB[3] = {0xff0000, 0x00ff00, 0x0000ff}; ++ static const DWORD bit_fields_DIB16_RGB[3] = {0x7c00, 0x03e0, 0x001f}; ++ BITMAPINFOHEADER *bi = (BITMAPINFOHEADER *)bmi; ++ const DWORD *masks = NULL; ++ RGBQUAD *colorTable = NULL; ++ BYTE *ptr = (BYTE*)bmi + bi->biSize; ++ int num_colors = bi->biClrUsed; ++ BOOL res; ++ ++ MAYBE(TRACE("dib=%p, bmi=%p\n", dib, bmi)); ++ ++ if(bi->biCompression == BI_BITFIELDS) ++ { ++ masks = (DWORD *)ptr; ++ ptr += 3 * sizeof(DWORD); ++ } ++ else if(bi->biBitCount == 32) ++ masks = bit_fields_DIB32_RGB; ++ else if(bi->biBitCount == 16) ++ masks = bit_fields_DIB16_RGB; ++ ++ if(!num_colors && bi->biBitCount <= 8) ++ num_colors = 1 << bi->biBitCount; ++ if(num_colors) ++ colorTable = (RGBQUAD*)ptr; ++ ptr += num_colors * sizeof(*colorTable); ++ ++ res = _DIBDRVBITMAP_InitFromBMIH(dib, bi, masks, colorTable, ptr); ++ MAYBE(TRACE("END\n")); ++ return res; ++} ++ ++/* initializes a DIBRDVBITMAP copying it from a source one ++ Parameters : ++ dib destination DIBDRVBITMAP ++ src source DIBDRVBITMAP ++ copy TRUE->copy source pixel array FALSE->link to source pixel array ++*/ ++BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *src, BOOL copy) ++{ ++ MAYBE(TRACE("dib=%p, src=%p, copy=%d\n", dib, src, copy)); ++ ++ dib->format = src->format; ++ dib->width = src->width; ++ dib->height = src->height; ++ dib->stride = src->stride; ++ dib->bitCount = src->bitCount; ++ ++ dib->redMask = src->redMask; ++ dib->greenMask = src->greenMask; ++ dib->blueMask = src->blueMask; ++ dib->redShift = src->redShift; ++ dib->greenShift = src->greenShift; ++ dib->blueShift = src->blueShift; ++ dib->redLen = src->redLen; ++ dib->greenLen = src->greenLen; ++ dib->blueLen = src->blueLen; ++ ++ dib->funcs = src->funcs; ++ ++ if(copy) ++ { ++ int size = dib->height*abs(dib->stride); ++ if(!(dib->bits = HeapAlloc(GetProcessHeap(), 0, size))) ++ { ++ ERR("Failed to allocate bits buffer\n"); ++ return FALSE; ++ } ++ dib->ownsBits = TRUE; ++ ++ /* check for bottom-up DIB */ ++ if(dib->stride < 0) ++ { ++ /* copy the bitmap array */ ++ memcpy(dib->bits, (BYTE *)src->bits + (src->height - 1) * src->stride, size); ++ ++ dib->bits = (BYTE *)dib->bits - (dib->height-1) * dib->stride; ++ } ++ else ++ { ++ /* copy the bitmap array */ ++ memcpy(dib->bits, src->bits, size); ++ } ++ } ++ else ++ { ++ dib->bits = src->bits; ++ dib->ownsBits = FALSE; ++ } ++ ++ if(src->colorTable) ++ { ++ dib->colorTable = HeapAlloc(GetProcessHeap(), 0, src->colorTableSize * sizeof(src->colorTable[0])); ++ memcpy(dib->colorTable, src->colorTable, src->colorTableSize * sizeof(src->colorTable[0])); ++ } ++ else ++ dib->colorTable = NULL; ++ dib->colorTableSize = src->colorTableSize; ++ dib->colorTableGrabbed = TRUE; ++ MAYBE(TRACE("END\n")); ++ return TRUE; ++} ++ ++/* creates a DIBRDVBITMAP copying format info from a source one ++ Parameters : ++ dib destination DIBDRVBITMAP ++ src source DIBDRVBITMAP ++ widht, height sizes of newly created bitmap ++*/ ++BOOL _DIBDRVBITMAP_CreateFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *src, int width, int height) ++{ ++ MAYBE(TRACE("dib=%p, src=%p, width=%d, height=%d\n", dib, src, width, height)); ++ ++ /* grab color and format info from source DIB */ ++ if(!_DIBDRVBITMAP_InitFromDibdrvbitmap(dib, src, FALSE)) ++ { ++ ERR("Failed grabbing source dib format\n"); ++ return FALSE; ++ } ++ ++ /* sets up new DIB dimensions */ ++ dib->width = width; ++ dib->height = height; ++ ++ /* calculates new stride basing of new width */ ++ dib->stride = ((width * dib->bitCount +31) &~31) / 8; ++ if(src->stride < 0) ++ dib->stride = -dib->stride; ++ ++ /* allocates bits for newly created DIB */ ++ if(!(dib->bits = HeapAlloc(GetProcessHeap(), 0, height*abs(dib->stride)))) ++ { ++ ERR("Failed to allocate bits buffer\n"); ++ return FALSE; ++ } ++ /* check for bottom-up DIB */ ++ if(dib->stride < 0) ++ dib->bits = (BYTE *)dib->bits - (dib->height-1) * dib->stride; ++ dib->ownsBits = TRUE; ++ ++ MAYBE(TRACE("END\n")); ++ return TRUE; ++ } ++ ++/* Clears a DIBDRVBITMAP structure data ++ WARNING : doesn't free anything */ ++void _DIBDRVBITMAP_Clear(DIBDRVBITMAP *bmp) ++{ ++ MAYBE(TRACE("bmp=%p\n", bmp)); ++ ++ bmp->bits = NULL; ++ bmp->ownsBits = FALSE; ++ bmp->colorTable = NULL; ++ bmp->colorTableSize = 0; ++ bmp->colorTableGrabbed = FALSE; ++ ++ MAYBE(TRACE("END\n")); ++} ++ ++/* Frees a DIBDRVBITMAP structure data */ ++void _DIBDRVBITMAP_Free(DIBDRVBITMAP *bmp) ++{ ++ MAYBE(TRACE("bmp=%p\n", bmp)); ++ ++ /* frees bits, if needed */ ++ if(bmp->bits && bmp->ownsBits) ++ { ++ /* on bottom-up dibs, bits doesn't point to starting ++ of buffer.... bad design choice */ ++ if(bmp->stride < 0) ++ bmp->bits = (BYTE *)bmp->bits + bmp->stride * (bmp->height -1); ++ HeapFree(GetProcessHeap(), 0, bmp->bits); ++ } ++ bmp->ownsBits = FALSE; ++ bmp->bits = NULL; ++ ++ /* frees color table */ ++ if(bmp->colorTable) ++ HeapFree(GetProcessHeap(), 0, bmp->colorTable); ++ bmp->colorTable = NULL; ++ bmp->colorTableSize = 0; ++ bmp->colorTableGrabbed = FALSE; ++ ++ MAYBE(TRACE("END\n")); ++} ++ ++ ++/* checks whether the format of 2 DIBs are identical ++ it checks the pixel bit count and the color table size ++ and content, if needed */ ++BOOL _DIBDRVBITMAP_FormatMatch(const DIBDRVBITMAP *d1, const DIBDRVBITMAP *d2) ++{ ++ /* checks at first the format (bit count and color masks) */ ++ if(d1->format != d2->format) ++ return FALSE; ++ ++ /* formats matches, now checks color tables if needed */ ++ switch(d1->format) ++ { ++ case DIBFMT_DIB32_RGB : ++ case DIBFMT_DIB32_BITFIELDS : ++ case DIBFMT_DIB24 : ++ case DIBFMT_DIB16_RGB : ++ case DIBFMT_DIB16_BITFIELDS : ++ return TRUE; ++ ++ case DIBFMT_DIB1 : ++ case DIBFMT_DIB4 : ++ /*case DIBFMT_DIB4_RLE :*/ ++ case DIBFMT_DIB8 : ++ /*case DIBFMT_DIB8_RLE :*/ ++ if(d1->colorTableSize != d2->colorTableSize) ++ return FALSE; ++ return !memcmp(d1->colorTable, d2->colorTable, d1->colorTableSize * sizeof(d1->colorTable[0])); ++ ++ default: ++ ERR("Unexpected depth %d\n", d1->bitCount); ++ return FALSE; ++ } ++} ++ ++/* convert a given dib into another format given by 'format' parameter */ ++BOOL _DIBDRVBITMAP_Convert(DIBDRVBITMAP *dst, const DIBDRVBITMAP *src, const DIBDRVBITMAP *format) ++{ ++ int width, height; ++ int iLine; ++ void *buf; ++ BOOL res; ++ ++ MAYBE(TRACE("dst=%p, src=%p, format=%p\n", dst, src, format)); ++ ++ /* free, if needed, destination bitmap */ ++ _DIBDRVBITMAP_Free(dst); ++ ++ /* if format and source bitmaps format match, ++ just copy source on destination */ ++ if(_DIBDRVBITMAP_FormatMatch(src, format)) ++ { ++ res = _DIBDRVBITMAP_InitFromDibdrvbitmap(dst, src, TRUE); ++ MAYBE(TRACE("END - Identical formats\n")); ++ return res; ++ } ++ ++ /* formats don't match, we create the dest bitmap with same format as format's one ++ but with source's one dimensions */ ++ width = src->width; ++ height = src->height; ++ if(!_DIBDRVBITMAP_CreateFromDibdrvbitmap(dst, format, width, height)) ++ { ++ ERR("Couldn't create destination bmp\n"); ++ return FALSE; ++ } ++ ++ /* we now copy/convert from source to dest */ ++ if(!(buf = HeapAlloc(GetProcessHeap(), 0, width * 4))) ++ { ++ ERR("HeapAlloc failed\n"); ++ return FALSE; ++ } ++ ++ for(iLine = 0; iLine < height; iLine++) ++ { ++ src->funcs->GetLine(src, iLine, 0, width, buf); ++ dst->funcs->PutLine(dst, iLine, 0, width, buf); ++ } ++ HeapFree(GetProcessHeap(), 0, buf); ++ ++ MAYBE(TRACE("END - different formats\n")); ++ return TRUE; ++} ++ ++/* creates a solid-filled DIB of given color and format ++ DIB format is given by 'format' parameter */ ++BOOL _DIBDRVBITMAP_CreateSolid(DIBDRVBITMAP *bmp, DIBDRVBITMAP *format, int width, int height, DWORD Color) ++{ ++ DWORD *buf, *bufPnt; ++ int i; ++ ++ MAYBE(TRACE("bmp=%p, format=%p, width=%d, height=%d, Color=%08x\n", bmp, format, width, height, Color)); ++ ++ /* swaps color bytes....*/ ++ Color = RGB((Color >> 8) & 0xff, (Color >> 16) &0xff, Color &0xff); ++ ++ /* creates the destination bitmap */ ++ if(!_DIBDRVBITMAP_CreateFromDibdrvbitmap(bmp, format, width, height)) ++ { ++ ERR("Couldn't create destination bmp\n"); ++ return FALSE; ++ } ++ ++ /* creates a temporary line filled with given color */ ++ if(!(buf = HeapAlloc(GetProcessHeap(), 0, width * 4))) ++ { ++ ERR("HeapAlloc failed\n"); ++ return FALSE; ++ } ++ ++ for(i = 0, bufPnt = buf; i < width; i++) ++ *bufPnt++ = Color; ++ ++ /* fills the bitmap */ ++ for(i = 0; i < height; i++) ++ bmp->funcs->PutLine(bmp, i, 0, width, buf); ++ ++ /* frees temporaty line */ ++ HeapFree(GetProcessHeap(), 0, buf); ++ ++ MAYBE(TRACE("END\n")); ++ return TRUE; ++} ++ ++/* expands horizontally a bitmap to reach a minimum size, ++ keeping its width as a multiple of a base width ++ Used to widen brushes in order to optimize blitting */ ++BOOL _DIBDRVBITMAP_ExpandHoriz(DIBDRVBITMAP *dib, int baseWidth, int minWidth) ++{ ++ BYTE *srcBuf, *dstBuf; ++ int chunkSize; ++ int iLine, iCol; ++ DIBDRVBITMAP tmpDib; ++ void *bits; ++ BOOL ownsBits; ++ ++ MAYBE(TRACE("dib=%p, baseWidth=%d, minWidth=%d\n", dib, baseWidth, minWidth)); ++ ++ /* if dst dib already wide enough, just do nothing */ ++ if(dib->width >= minWidth) ++ { ++ MAYBE(TRACE("END - No need to expand\n")); ++ return TRUE; ++ } ++ ++ /* source DIB can't be NULL */ ++ if(!dib->bits) ++ { ++ ERR("Empty source DIB detected\n"); ++ return FALSE; ++ } ++ ++ /* round up minWidth to be a multiple of source width */ ++ minWidth += (baseWidth - (minWidth % baseWidth)); ++ ++ /* creates a temporary destination bitmap with required sizes */ ++ _DIBDRVBITMAP_Clear(&tmpDib); ++ if(!_DIBDRVBITMAP_CreateFromDibdrvbitmap(&tmpDib, dib, minWidth, dib->height)) ++ { ++ ERR("Couldn't create the temporary DIB for brush cache\n"); ++ return FALSE; ++ } ++ ++ /* if format uses almost 1 byte/pixel, fast copy path */ ++ if(dib->bitCount >= 8) ++ { ++ chunkSize = dib->width * dib->bitCount / 8; ++ for(iLine = 0; iLine < dib->height; iLine++) ++ { ++ srcBuf = (BYTE *)dib->bits + iLine * dib->stride; ++ dstBuf = (BYTE *)tmpDib.bits + iLine * tmpDib.stride; ++ for(iCol = 0; iCol < tmpDib.width; iCol += dib->width) ++ { ++ memcpy(dstBuf, srcBuf, chunkSize); ++ dstBuf += chunkSize; ++ } ++ } ++ } ++ /* otherwise slow path -- could be optimized */ ++ else ++ { ++ chunkSize = dib->width * 4; ++ /* allocates a line buffer */ ++ if(!(srcBuf = HeapAlloc(GetProcessHeap(), 0, tmpDib.width * 4))) ++ { ++ ERR("HeapAlloc failed\n"); ++ return FALSE; ++ } ++ ++ FIXME("dib:format=%s, funcs=%p, bits=%p, width=%d, height=%d, stride=%d\n", ++ _DIBDRVBITMAP_GetFormatName(dib), dib->funcs, dib->bits, dib->width, dib->height, dib->stride); ++ for(iLine = 0; iLine < dib->height; iLine++) ++ { ++ /* fills the line buffer repeating source's line data */ ++ dib->funcs->GetLine(dib, iLine, 0, dib->width, srcBuf); ++ dstBuf = srcBuf + chunkSize; ++ for(iCol = dib->width; iCol < tmpDib.width; iCol += dib->width) ++ { ++ memcpy(dstBuf, srcBuf, chunkSize); ++ dstBuf += chunkSize; ++ } ++ /* stores the line on destination bmp */ ++ tmpDib.funcs->PutLine(&tmpDib, iLine, 0, tmpDib.width, srcBuf); ++ } ++ HeapFree(GetProcessHeap(), 0, srcBuf); ++ } ++ ++ /* swaps temp DIB and source one */ ++ bits = dib->bits; ++ ownsBits = dib->ownsBits; ++ dib->bits = tmpDib.bits; ++ dib->ownsBits = tmpDib.ownsBits; ++ tmpDib.bits = bits; ++ tmpDib.ownsBits = ownsBits; ++ ++ /* frees the temporary DIB */ ++ _DIBDRVBITMAP_Free(&tmpDib); ++ ++ MAYBE(TRACE("END\n")); ++ return TRUE; ++} +diff --git a/dlls/winedib.drv/driver.c b/dlls/winedib.drv/driver.c +new file mode 100644 +index 0000000..46fa7a1 +--- /dev/null ++++ b/dlls/winedib.drv/driver.c +@@ -0,0 +1,254 @@ ++/* ++ * Access to display driver ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++#include ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* CreateDriver ++ * Allocate and fill the function pointer structure for a given module. */ ++static DC_FUNCTIONS *CreateDriver( HMODULE module ) ++{ ++ DC_FUNCTIONS *funcs; ++ ++ if (!(funcs = HeapAlloc( GetProcessHeap(), 0, sizeof(*funcs)))) ++ return NULL; ++ ++ /* fill the function table */ ++ if (module) ++ { ++#define GET_FUNC(name) funcs->p##name = (void*)GetProcAddress( module, #name ) ++ GET_FUNC(AbortDoc); ++ GET_FUNC(AbortPath); ++ GET_FUNC(AlphaBlend); ++ GET_FUNC(AngleArc); ++ GET_FUNC(Arc); ++ GET_FUNC(ArcTo); ++ GET_FUNC(BeginPath); ++ GET_FUNC(BitBlt); ++ GET_FUNC(ChoosePixelFormat); ++ GET_FUNC(Chord); ++ GET_FUNC(CloseFigure); ++ GET_FUNC(CreateBitmap); ++ GET_FUNC(CreateDC); ++ GET_FUNC(CreateDIBSection); ++ GET_FUNC(DeleteBitmap); ++ GET_FUNC(DeleteDC); ++ GET_FUNC(DescribePixelFormat); ++ GET_FUNC(DeviceCapabilities); ++ GET_FUNC(Ellipse); ++ GET_FUNC(EndDoc); ++ GET_FUNC(EndPage); ++ GET_FUNC(EndPath); ++ GET_FUNC(EnumDeviceFonts); ++ GET_FUNC(ExcludeClipRect); ++ GET_FUNC(ExtDeviceMode); ++ GET_FUNC(ExtEscape); ++ GET_FUNC(ExtFloodFill); ++ GET_FUNC(ExtSelectClipRgn); ++ GET_FUNC(ExtTextOut); ++ GET_FUNC(FillPath); ++ GET_FUNC(FillRgn); ++ GET_FUNC(FlattenPath); ++ GET_FUNC(FrameRgn); ++ GET_FUNC(GdiComment); ++ GET_FUNC(GetBitmapBits); ++ GET_FUNC(GetCharWidth); ++ GET_FUNC(GetDCOrgEx); ++ GET_FUNC(GetDIBColorTable); ++ GET_FUNC(GetDIBits); ++ GET_FUNC(GetDeviceCaps); ++ GET_FUNC(GetDeviceGammaRamp); ++ GET_FUNC(GetICMProfile); ++ GET_FUNC(GetNearestColor); ++ GET_FUNC(GetPixel); ++ GET_FUNC(GetPixelFormat); ++ GET_FUNC(GetSystemPaletteEntries); ++ GET_FUNC(GetTextExtentExPoint); ++ GET_FUNC(GetTextMetrics); ++ GET_FUNC(IntersectClipRect); ++ GET_FUNC(InvertRgn); ++ GET_FUNC(LineTo); ++ GET_FUNC(MoveTo); ++ GET_FUNC(ModifyWorldTransform); ++ GET_FUNC(OffsetClipRgn); ++ GET_FUNC(OffsetViewportOrg); ++ GET_FUNC(OffsetWindowOrg); ++ GET_FUNC(PaintRgn); ++ GET_FUNC(PatBlt); ++ GET_FUNC(Pie); ++ GET_FUNC(PolyBezier); ++ GET_FUNC(PolyBezierTo); ++ GET_FUNC(PolyDraw); ++ GET_FUNC(PolyPolygon); ++ GET_FUNC(PolyPolyline); ++ GET_FUNC(Polygon); ++ GET_FUNC(Polyline); ++ GET_FUNC(PolylineTo); ++ GET_FUNC(RealizeDefaultPalette); ++ GET_FUNC(RealizePalette); ++ GET_FUNC(Rectangle); ++ GET_FUNC(ResetDC); ++ GET_FUNC(RestoreDC); ++ GET_FUNC(RoundRect); ++ GET_FUNC(SaveDC); ++ GET_FUNC(ScaleViewportExt); ++ GET_FUNC(ScaleWindowExt); ++ GET_FUNC(SelectBitmap); ++ GET_FUNC(SelectBrush); ++ GET_FUNC(SelectClipPath); ++ GET_FUNC(SelectFont); ++ GET_FUNC(SelectPalette); ++ GET_FUNC(SelectPen); ++ GET_FUNC(SetArcDirection); ++ GET_FUNC(SetBitmapBits); ++ GET_FUNC(SetBkColor); ++ GET_FUNC(SetBkMode); ++ GET_FUNC(SetDCBrushColor); ++ GET_FUNC(SetDCOrg); ++ GET_FUNC(SetDCPenColor); ++ GET_FUNC(SetDIBColorTable); ++ GET_FUNC(SetDIBits); ++ GET_FUNC(SetDIBitsToDevice); ++ GET_FUNC(SetDeviceClipping); ++ GET_FUNC(SetDeviceGammaRamp); ++ GET_FUNC(SetMapMode); ++ GET_FUNC(SetMapperFlags); ++ GET_FUNC(SetPixel); ++ GET_FUNC(SetPixelFormat); ++ GET_FUNC(SetPolyFillMode); ++ GET_FUNC(SetROP2); ++ GET_FUNC(SetRelAbs); ++ GET_FUNC(SetStretchBltMode); ++ GET_FUNC(SetTextAlign); ++ GET_FUNC(SetTextCharacterExtra); ++ GET_FUNC(SetTextColor); ++ GET_FUNC(SetTextJustification); ++ GET_FUNC(SetViewportExt); ++ GET_FUNC(SetViewportOrg); ++ GET_FUNC(SetWindowExt); ++ GET_FUNC(SetWindowOrg); ++ GET_FUNC(SetWorldTransform); ++ GET_FUNC(StartDoc); ++ GET_FUNC(StartPage); ++ GET_FUNC(StretchBlt); ++ GET_FUNC(StretchDIBits); ++ GET_FUNC(StrokeAndFillPath); ++ GET_FUNC(StrokePath); ++ GET_FUNC(SwapBuffers); ++ GET_FUNC(UnrealizePalette); ++ GET_FUNC(WidenPath); ++ ++ /* OpenGL32 */ ++ GET_FUNC(wglCreateContext); ++ GET_FUNC(wglDeleteContext); ++ GET_FUNC(wglGetProcAddress); ++ GET_FUNC(wglGetPbufferDCARB); ++ GET_FUNC(wglMakeContextCurrentARB); ++ GET_FUNC(wglMakeCurrent); ++ GET_FUNC(wglSetPixelFormatWINE); ++ GET_FUNC(wglShareLists); ++ GET_FUNC(wglUseFontBitmapsA); ++ GET_FUNC(wglUseFontBitmapsW); ++#undef GET_FUNC ++ } ++ else ++ memset( funcs, 0, sizeof(*funcs) ); ++ ++ /* add it to the list */ ++ return funcs; ++} ++ ++ ++/* LoadDisplayDriver ++ * Loads display driver - partially grabbed from gdi32 */ ++static DC_FUNCTIONS *X11DrvFuncs = NULL; ++static HMODULE X11DrvModule = 0; ++DC_FUNCTIONS *_DIBDRV_LoadDisplayDriver(void) ++{ ++ char buffer[MAX_PATH], libname[32], *name, *next; ++ HMODULE module = 0; ++ HKEY hkey; ++ ++ if (X11DrvFuncs) /* already loaded */ ++ return X11DrvFuncs; ++ ++ strcpy( buffer, "x11" ); /* default value */ ++ /* @@ Wine registry key: HKCU\Software\Wine\Drivers */ ++ if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey )) ++ { ++ DWORD type, count = sizeof(buffer); ++ RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count ); ++ RegCloseKey( hkey ); ++ } ++ ++ name = buffer; ++ while (name) ++ { ++ next = strchr( name, ',' ); ++ if (next) ++ *next++ = 0; ++ ++ snprintf( libname, sizeof(libname), "wine%s.drv", name ); ++ if ((module = LoadLibraryA( libname )) != 0) ++ break; ++ name = next; ++ } ++ ++ if (!(X11DrvFuncs = CreateDriver(module))) ++ { ++ ERR( "Could not create graphics driver '%s'\n", buffer ); ++ FreeLibrary( module ); ++ ExitProcess(1); ++ } ++ ++ X11DrvModule = module; ++ return X11DrvFuncs; ++} ++ ++/* FreeDisplayDriver ++ Frees resources allocated by Display driver */ ++void _DIBDRV_FreeDisplayDriver(void) ++{ ++ /* frees function table */ ++ if(X11DrvFuncs) ++ { ++ HeapFree(GetProcessHeap(), 0, X11DrvFuncs); ++ X11DrvFuncs = 0; ++ } ++ /* and unload the module */ ++ if(X11DrvModule) ++ { ++ FreeLibrary(X11DrvModule); ++ X11DrvModule = 0; ++ } ++} ++ ++/* GetDisplayDriver ++ Gets a pointer to display drives'function table */ ++inline DC_FUNCTIONS *_DIBDRV_GetDisplayDriver(void) ++{ ++ return X11DrvFuncs; ++ ++} +diff --git a/dlls/winedib.drv/font.c b/dlls/winedib.drv/font.c +index 675145f..215b27d 100644 +--- a/dlls/winedib.drv/font.c ++++ b/dlls/winedib.drv/font.c +@@ -32,14 +32,40 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + { + COLORREF res; ++ INT r, g, b; ++ INT i; + +- TRACE("physDev:%p, color:%08x\n", physDev, color); ++ MAYBE(TRACE("physDev:%p, color:%08x\n", physDev, color)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetTextColor(physDev->X11PhysDev, color); ++ ++ /* do nothing if color is the same as actual one */ ++ if(color == physDev->textColor) ++ return color; ++ ++ /* stores old color */ ++ res = physDev->textColor; ++ ++ /* fills the text color table used on antialiased font display */ ++ if(physDev->physBitmap.funcs) ++ { ++ r = GetRValue(color); ++ g = GetGValue(color); ++ b = GetBValue(color); ++ for(i = 0; i < 256; i++) ++ { ++ physDev->textColorTable[i] = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, RGB( ++ MulDiv(r, i, 256), ++ MulDiv(g, i, 256), ++ MulDiv(b, i, 256) ++ )); ++ } ++ } ++ ++ /* returns previous text color */ ++ return res; + } + else + { +@@ -52,17 +78,75 @@ COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + /*********************************************************************** + * DIBDRV_SelectFont + */ +-HFONT DIBDRV_SelectFont( DIBDRVPHYSDEV *physDev, HFONT hfont, HANDLE gdiFont ) ++HFONT DIBDRV_SelectFont( DIBDRVPHYSDEV *physDev, HFONT hfont, GdiFont *gdiFont ) + { + HFONT res; ++ FT_Int i; ++ FT_Error error; ++ FT_CharMap charmap = NULL; ++ LOGFONTW lf; + +- TRACE("physDev:%p, hfont:%p, gdiFont:%p\n", physDev, hfont, gdiFont); ++ MAYBE(TRACE("physDev:%p, hfont:%p, gdiFont:%p\n", physDev, hfont, gdiFont)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSelectFont(physDev->X11PhysDev, hfont, gdiFont); ++ ++ /* gets font information */ ++ GetObjectW(hfont, sizeof(lf), &lf); ++ MAYBE(TRACE("Font is : '%s'\n", debugstr_w(lf.lfFaceName))); ++ ++ /* FIXME: just handles gdifont, don't know if it needs to handle hfont too ++ BTW, still don't know how to get FT_Face from non-gdi font here ++ */ ++ if(!gdiFont) ++ { ++ FIXME("No gdi font - unhandled by now.\n"); ++ return hfont; ++ } ++ ++ physDev->face = gdiFont->ft_face; ++ if(!physDev->face) ++ { ++ FIXME("Error, null Ft_Face\n"); ++ return hfont; ++ } ++ ++ /* setup the correct charmap.... maybe */ ++ for (i = 0; i < physDev->face->num_charmaps; ++i) ++ { ++ if (physDev->face->charmaps[i]->platform_id != TT_PLATFORM_MICROSOFT) ++ continue; ++ ++ if (physDev->face->charmaps[i]->encoding_id == TT_MS_ID_UNICODE_CS) ++ { ++ charmap = physDev->face->charmaps[i]; ++ break; ++ } ++ ++ if (charmap == NULL) ++ { ++ WARN("Selected fallout charmap #%d\n", i); ++ charmap = physDev->face->charmaps[i]; ++ } ++ } ++ if (charmap == NULL) ++ { ++ WARN("No Windows character map found\n"); ++ charmap = physDev->face->charmaps[0]; ++ return 0; ++ } ++ ++ error = pFT_Set_Charmap(physDev->face, charmap); ++ if (error != FT_Err_Ok) ++ { ++ ERR("%s returned %i\n", "FT_Set_Charmap", error); ++ return 0; ++ } ++ ++ /* we use GDI fonts, so just return false */ ++ return 0; ++ + } + else + { +@@ -80,13 +164,13 @@ BOOL DIBDRV_EnumDeviceFonts( DIBDRVPHYSDEV *physDev, LPLOGFONTW plf, + { + BOOL res; + +- TRACE("physDev:%p, plf:%p, proc:%p, lp:%lx\n", physDev, plf, proc, lp); ++ MAYBE(TRACE("physDev:%p, plf:%p, proc:%p, lp:%lx\n", physDev, plf, proc, lp)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pEnumDeviceFonts(physDev->X11PhysDev, plf, proc, lp); ++ ONCE(FIXME("STUB\n")); ++ res = 0; + } + else + { +@@ -103,13 +187,13 @@ BOOL DIBDRV_GetTextMetrics( DIBDRVPHYSDEV *physDev, TEXTMETRICW *metrics ) + { + BOOL res; + +- TRACE("physDev:%p, metrics:%p\n", physDev, metrics); ++ MAYBE(TRACE("physDev:%p, metrics:%p\n", physDev, metrics)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetTextMetrics(physDev->X11PhysDev, metrics); ++ ONCE(FIXME("STUB\n")); ++ res = 0; + } + else + { +@@ -127,13 +211,13 @@ BOOL DIBDRV_GetCharWidth( DIBDRVPHYSDEV *physDev, UINT firstChar, UINT lastChar, + { + BOOL res; + +- TRACE("physDev:%p, firstChar:%d, lastChar:%d, buffer:%pn", physDev, firstChar, lastChar, buffer); ++ MAYBE(TRACE("physDev:%p, firstChar:%d, lastChar:%d, buffer:%pn", physDev, firstChar, lastChar, buffer)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetCharWidth(physDev->X11PhysDev, firstChar, lastChar, buffer); ++ ONCE(FIXME("STUB\n")); ++ res = 0; + } + else + { +diff --git a/dlls/winedib.drv/freetype.c b/dlls/winedib.drv/freetype.c +new file mode 100644 +index 0000000..111a18b +--- /dev/null ++++ b/dlls/winedib.drv/freetype.c +@@ -0,0 +1,136 @@ ++/* ++ * Truetype font functions ++ * ++ * Copyright 2008 Massimo Del Fedele ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++#define MAKE_FUNCPTR(f) typeof(f) * p##f = NULL; ++MAKE_FUNCPTR(FT_Done_Face) ++MAKE_FUNCPTR(FT_Done_FreeType) ++MAKE_FUNCPTR(FT_Get_Char_Index) ++MAKE_FUNCPTR(FT_Get_Glyph_Name) ++MAKE_FUNCPTR(FT_Get_Sfnt_Name) ++MAKE_FUNCPTR(FT_Get_Sfnt_Name_Count) ++MAKE_FUNCPTR(FT_Get_Sfnt_Table) ++MAKE_FUNCPTR(FT_Init_FreeType) ++MAKE_FUNCPTR(FT_Load_Glyph) ++MAKE_FUNCPTR(FT_Load_Char) ++MAKE_FUNCPTR(FT_Get_Glyph) ++MAKE_FUNCPTR(FT_Glyph_Copy) ++MAKE_FUNCPTR(FT_Glyph_To_Bitmap) ++MAKE_FUNCPTR(FT_Done_Glyph) ++MAKE_FUNCPTR(FT_New_Face) ++MAKE_FUNCPTR(FT_Set_Charmap) ++MAKE_FUNCPTR(FT_Set_Char_Size) ++MAKE_FUNCPTR(FT_Set_Pixel_Sizes) ++MAKE_FUNCPTR(FT_Get_First_Char) ++MAKE_FUNCPTR(FT_Render_Glyph) ++MAKE_FUNCPTR(FT_Glyph_Transform) ++#undef MAKE_FUNCPTR ++ ++/* freetype initialization flag */ ++static BOOL FreeType_Initialized = FALSE; ++ ++/* freetype dll handle */ ++static void *ft_handle = NULL; ++ ++/* freetype library handle */ ++FT_Library DIBDRV_ftLibrary = NULL; ++ ++/* initialize freetype library */ ++BOOL _DIBDRV_FreeType_Init(void) ++{ ++ FT_Int error; ++ ++ ft_handle = wine_dlopen(SONAME_LIBFREETYPE, RTLD_NOW, NULL, 0); ++ if(!ft_handle) ++ { ++ WINE_MESSAGE( ++ "Wine cannot find the FreeType font library. To enable Wine to\n" ++ "use TrueType fonts please install a version of FreeType greater than\n" ++ "or equal to 2.0.5.\n" ++ "http://www.freetype.org\n"); ++ return FALSE; ++ } ++ ++#define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(ft_handle, #f, NULL, 0)) == NULL) goto sym_not_found; ++ LOAD_FUNCPTR(FT_Done_Face) ++ LOAD_FUNCPTR(FT_Done_FreeType) ++ LOAD_FUNCPTR(FT_Get_Char_Index) ++ LOAD_FUNCPTR(FT_Get_Glyph_Name) ++ LOAD_FUNCPTR(FT_Get_Sfnt_Name) ++ LOAD_FUNCPTR(FT_Get_Sfnt_Name_Count) ++ LOAD_FUNCPTR(FT_Get_Sfnt_Table) ++ LOAD_FUNCPTR(FT_Init_FreeType) ++ LOAD_FUNCPTR(FT_Load_Glyph) ++ LOAD_FUNCPTR(FT_Load_Char) ++ LOAD_FUNCPTR(FT_Get_Glyph) ++ LOAD_FUNCPTR(FT_Glyph_Copy) ++ LOAD_FUNCPTR(FT_Glyph_To_Bitmap) ++ LOAD_FUNCPTR(FT_Done_Glyph) ++ LOAD_FUNCPTR(FT_New_Face) ++ LOAD_FUNCPTR(FT_Set_Charmap) ++ LOAD_FUNCPTR(FT_Set_Char_Size) ++ LOAD_FUNCPTR(FT_Set_Pixel_Sizes) ++ LOAD_FUNCPTR(FT_Get_First_Char) ++ LOAD_FUNCPTR(FT_Render_Glyph) ++ LOAD_FUNCPTR(FT_Glyph_Transform) ++#undef LOAD_FUNCPTR ++ ++ error = pFT_Init_FreeType(&DIBDRV_ftLibrary); ++ if (error != FT_Err_Ok) ++ { ++ ERR("%s returned %i\n", "FT_Init_FreeType", error); ++ wine_dlclose(ft_handle, NULL, 0); ++ return FALSE; ++ } ++ ++ /* marks library as initialized */ ++ FreeType_Initialized = TRUE; ++ ++ return TRUE; ++ ++sym_not_found: ++ WINE_MESSAGE( ++ "Wine cannot find certain functions that it needs inside the FreeType\n" ++ "font library. To enable Wine to use TrueType fonts please upgrade\n" ++ "FreeType to at least version 2.0.5.\n" ++ "http://www.freetype.org\n"); ++ wine_dlclose(ft_handle, NULL, 0); ++ ft_handle = NULL; ++ return FALSE; ++} ++ ++/* terminates freetype library */ ++void _DIBDRV_FreeType_Terminate(void) ++{ ++ if(!FreeType_Initialized) ++ return; ++ ++ /* terminates and unload freetype library */ ++ pFT_Done_FreeType(DIBDRV_ftLibrary); ++ wine_dlclose(ft_handle, NULL, 0); ++ ft_handle = NULL; ++ FreeType_Initialized = FALSE; ++ ++} +diff --git a/dlls/winedib.drv/freetype.h b/dlls/winedib.drv/freetype.h +new file mode 100644 +index 0000000..93619ff +--- /dev/null ++++ b/dlls/winedib.drv/freetype.h +@@ -0,0 +1,186 @@ ++/* ++ * Truetype font functions ++ * ++ * Copyright 2008 Massimo Del Fedele ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++#ifndef __WINE_DIBDRV_FREETYPE_H ++#define __WINE_DIBDRV__FREETYPE_H ++ ++/* freetype library for font support */ ++#ifdef HAVE_FREETYPE ++ ++#include ++#include FT_FREETYPE_H ++#include FT_GLYPH_H ++#include FT_TRUETYPE_TABLES_H ++#include FT_SFNT_NAMES_H ++#include FT_TRUETYPE_IDS_H ++ ++/* freetype library handle */ ++extern FT_Library DIBDRV_ftLibrary; ++ ++/******************************************************************************************/ ++/* FREETYPE STUFFS */ ++/* grabbed from winex11.drv/freetype.c */ ++/******************************************************************************************/ ++ ++/* This is basically a copy of FT_Bitmap_Size with an extra element added */ ++typedef struct { ++ FT_Short height; ++ FT_Short width; ++ FT_Pos size; ++ FT_Pos x_ppem; ++ FT_Pos y_ppem; ++ FT_Short internal_leading; ++} Bitmap_Size; ++ ++/* FT_Bitmap_Size gained 3 new elements between FreeType 2.1.4 and 2.1.5 ++ So to let this compile on older versions of FreeType we'll define the ++ new structure here. */ ++typedef struct { ++ FT_Short height, width; ++ FT_Pos size, x_ppem, y_ppem; ++} My_FT_Bitmap_Size; ++ ++struct enum_data ++{ ++ ENUMLOGFONTEXW elf; ++ NEWTEXTMETRICEXW ntm; ++ DWORD type; ++}; ++ ++typedef struct tagFace { ++ struct list entry; ++ WCHAR *StyleName; ++ char *file; ++ void *font_data_ptr; ++ DWORD font_data_size; ++ FT_Long face_index; ++ FONTSIGNATURE fs; ++ FONTSIGNATURE fs_links; ++ DWORD ntmFlags; ++ FT_Fixed font_version; ++ BOOL scalable; ++ Bitmap_Size size; /* set if face is a bitmap */ ++ BOOL external; /* TRUE if we should manually add this font to the registry */ ++ struct tagFamily *family; ++ /* Cached data for Enum */ ++ struct enum_data *cached_enum_data; ++} Face; ++ ++typedef struct tagFamily { ++ struct list entry; ++ const WCHAR *FamilyName; ++ struct list faces; ++} Family; ++ ++typedef struct { ++ GLYPHMETRICS gm; ++ INT adv; /* These three hold to widths of the unrotated chars */ ++ INT lsb; ++ INT bbx; ++ BOOL init; ++} GM; ++ ++typedef struct { ++ FLOAT eM11, eM12; ++ FLOAT eM21, eM22; ++} FMAT2; ++ ++typedef struct { ++ DWORD hash; ++ LOGFONTW lf; ++ FMAT2 matrix; ++ BOOL can_use_bitmap; ++} FONT_DESC; ++ ++typedef struct tagHFONTLIST { ++ struct list entry; ++ HFONT hfont; ++} HFONTLIST; ++ ++typedef struct { ++ struct list entry; ++ Face *face; ++ struct tagGdiFont *font; ++} CHILD_FONT; ++ ++typedef struct tagGdiFont { ++ struct list entry; ++ GM **gm; ++ DWORD gmsize; ++ struct list hfontlist; ++ OUTLINETEXTMETRICW *potm; ++ DWORD total_kern_pairs; ++ KERNINGPAIR *kern_pairs; ++ struct list child_fonts; ++ ++ /* the following members can be accessed without locking, they are never modified after creation */ ++ FT_Face ft_face; ++ struct font_mapping *mapping; ++ LPWSTR name; ++ int charset; ++ int codepage; ++ BOOL fake_italic; ++ BOOL fake_bold; ++ BYTE underline; ++ BYTE strikeout; ++ INT orientation; ++ FONT_DESC font_desc; ++ LONG aveWidth, ppem; ++ double scale_y; ++ SHORT yMax; ++ SHORT yMin; ++ DWORD ntmFlags; ++ FONTSIGNATURE fs; ++ struct tagGdiFont *base_font; ++ VOID *GSUB_Table; ++ DWORD cache_num; ++} GdiFont; ++ ++/* initialize freetype library */ ++BOOL _DIBDRV_FreeType_Init(void); ++ ++/* terminates freetype library */ ++void _DIBDRV_FreeType_Terminate(void); ++ ++#define MAKE_FUNCPTR(f) extern typeof(f) * p##f; ++MAKE_FUNCPTR(FT_Done_Face) ++MAKE_FUNCPTR(FT_Done_FreeType) ++MAKE_FUNCPTR(FT_Get_Char_Index) ++MAKE_FUNCPTR(FT_Get_Glyph_Name) ++MAKE_FUNCPTR(FT_Get_Sfnt_Name) ++MAKE_FUNCPTR(FT_Get_Sfnt_Name_Count) ++MAKE_FUNCPTR(FT_Get_Sfnt_Table) ++MAKE_FUNCPTR(FT_Init_FreeType) ++MAKE_FUNCPTR(FT_Load_Glyph) ++MAKE_FUNCPTR(FT_Load_Char) ++MAKE_FUNCPTR(FT_Get_Glyph) ++MAKE_FUNCPTR(FT_Glyph_Copy) ++MAKE_FUNCPTR(FT_Glyph_To_Bitmap) ++MAKE_FUNCPTR(FT_Done_Glyph) ++MAKE_FUNCPTR(FT_New_Face) ++MAKE_FUNCPTR(FT_Set_Charmap) ++MAKE_FUNCPTR(FT_Set_Char_Size) ++MAKE_FUNCPTR(FT_Set_Pixel_Sizes) ++MAKE_FUNCPTR(FT_Get_First_Char) ++MAKE_FUNCPTR(FT_Render_Glyph) ++MAKE_FUNCPTR(FT_Glyph_Transform) ++#undef MAKE_FUNCPTR ++ ++#endif /* HAVE_FREETYPE */ ++ ++#endif +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +index b74c08e..8dda082 100644 +--- a/dlls/winedib.drv/graphics.c ++++ b/dlls/winedib.drv/graphics.c +@@ -25,23 +25,33 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++static inline void OrderInt(int *i1, int *i2) ++{ ++ if(*i1 > *i2) ++ { ++ int tmp; ++ tmp = *i1; ++ *i1 = *i2; ++ *i2 = tmp; ++ } ++} ++ + /*********************************************************************** + * DIBDRV_Arc + */ +-BOOL DIBDRV_Arc( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, +- INT xstart, INT ystart, INT xend, INT yend ) ++BOOL DIBDRV_Arc( DIBDRVPHYSDEV *physDev, int left, int top, int right, int bottom, ++ int xstart, int ystart, int xend, int yend ) + { + BOOL res; + +- TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", +- physDev, left, top, right, bottom, xstart, ystart, xend, yend); ++ MAYBE(TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", ++ physDev, left, top, right, bottom, xstart, ystart, xend, yend)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pArc(physDev->X11PhysDev, left, top, right, bottom, +- xstart, ystart, xend, yend); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -55,20 +65,19 @@ BOOL DIBDRV_Arc( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT botto + /*********************************************************************** + * DIBDRV_Chord + */ +-BOOL DIBDRV_Chord( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, +- INT xstart, INT ystart, INT xend, INT yend ) ++BOOL DIBDRV_Chord( DIBDRVPHYSDEV *physDev, int left, int top, int right, int bottom, ++ int xstart, int ystart, int xend, int yend ) + { + BOOL res; + +- TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", +- physDev, left, top, right, bottom, xstart, ystart, xend, yend); ++ MAYBE(TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", ++ physDev, left, top, right, bottom, xstart, ystart, xend, yend)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pChord(physDev->X11PhysDev, left, top, right, bottom, +- xstart, ystart, xend, yend); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -82,18 +91,18 @@ BOOL DIBDRV_Chord( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bot + /*********************************************************************** + * DIBDRV_Ellipse + */ +-BOOL DIBDRV_Ellipse( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom ) ++BOOL DIBDRV_Ellipse( DIBDRVPHYSDEV *physDev, int left, int top, int right, int bottom ) + { + BOOL res; + +- TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", +- physDev, left, top, right, bottom); ++ MAYBE(TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", ++ physDev, left, top, right, bottom)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pEllipse(physDev->X11PhysDev, left, top, right, bottom); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -106,19 +115,19 @@ BOOL DIBDRV_Ellipse( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT b + /********************************************************************** + * DIBDRV_ExtFloodFill + */ +-BOOL DIBDRV_ExtFloodFill( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color, ++BOOL DIBDRV_ExtFloodFill( DIBDRVPHYSDEV *physDev, int x, int y, COLORREF color, + UINT fillType ) + { + BOOL res; + +- TRACE("physDev:%p, x:%d, y:%d, color:%x, fillType:%d\n", +- physDev, x, y, color, fillType); ++ MAYBE(TRACE("physDev:%p, x:%d, y:%d, color:%x, fillType:%d\n", ++ physDev, x, y, color, fillType)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pExtFloodFill(physDev->X11PhysDev, x, y, color, fillType); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -135,13 +144,13 @@ BOOL DIBDRV_GetDCOrgEx( DIBDRVPHYSDEV *physDev, LPPOINT lpp ) + { + BOOL res; + +- TRACE("physDev:%p, lpp:%p\n", physDev, lpp); ++ MAYBE(TRACE("physDev:%p, lpp:%p\n", physDev, lpp)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetDCOrgEx(physDev->X11PhysDev, lpp); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -154,17 +163,15 @@ BOOL DIBDRV_GetDCOrgEx( DIBDRVPHYSDEV *physDev, LPPOINT lpp ) + /*********************************************************************** + * DIBDRV_GetPixel + */ +-COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y ) ++COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, int x, int y ) + { + COLORREF res; + +- TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); ++ MAYBE(TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetPixel(physDev->X11PhysDev, x, y); ++ res = physDev->physBitmap.funcs->GetPixel(&physDev->physBitmap, x, y); + } + else + { +@@ -177,17 +184,26 @@ COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y ) + /*********************************************************************** + * DIBDRV_LineTo + */ +-BOOL DIBDRV_LineTo( DIBDRVPHYSDEV *physDev, INT x, INT y ) ++BOOL DIBDRV_LineTo( DIBDRVPHYSDEV *physDev, int x, int y ) + { + BOOL res; ++ POINT curPos; + +- TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); ++ MAYBE(TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pLineTo(physDev->X11PhysDev, x, y); ++ GetCurrentPositionEx(physDev->hdc, &curPos); ++ ++ _DIBDRV_ResetDashOrigin(physDev); ++ ++ if(curPos.y == y) ++ physDev->penHLine(physDev, curPos.x, x, y); ++ else if(curPos.x == x) ++ physDev->penVLine(physDev, x, curPos.y, y); ++ else ++ physDev->penLine(physDev, curPos.x, curPos.y, x, y); ++ res = TRUE; + } + else + { +@@ -200,17 +216,43 @@ BOOL DIBDRV_LineTo( DIBDRVPHYSDEV *physDev, INT x, INT y ) + /*********************************************************************** + * DIBDRV_PaintRgn + */ ++BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, int left, int top, int right, int bottom); + BOOL DIBDRV_PaintRgn( DIBDRVPHYSDEV *physDev, HRGN hrgn ) + { +- BOOL res; ++ BOOL res = FALSE; ++ int i; ++ RECT *rect; ++ RGNDATA *data; ++ int size; + +- TRACE("physDev:%p, hrgn:%p\n", physDev, hrgn); ++ MAYBE(TRACE("physDev:%p, hrgn:%p\n", physDev, hrgn)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pPaintRgn(physDev->X11PhysDev, hrgn); ++ /* gets needed region data size */ ++ if(!(size = GetRegionData(hrgn, 0, NULL))) ++ goto fin; ++ ++ /* allocates buffer and gets actual region data */ ++ if(!(data = HeapAlloc(GetProcessHeap(), 0, size))) ++ goto fin; ++ if(!GetRegionData(hrgn, size, data)) ++ { ++ HeapFree(GetProcessHeap(), 0, data); ++ goto fin; ++ } ++ ++ /* paints the filled rectangles */ ++ rect = (RECT *)data->Buffer; ++ for(i = 0; i < data->rdh.nCount; i++) ++ { ++ DIBDRV_Rectangle( physDev, rect->left, rect->top, rect->right, rect->bottom); ++ rect++; ++ } ++ HeapFree( GetProcessHeap(), 0, data ); ++ res = TRUE; ++fin: ++ ; + } + else + { +@@ -223,20 +265,19 @@ BOOL DIBDRV_PaintRgn( DIBDRVPHYSDEV *physDev, HRGN hrgn ) + /*********************************************************************** + * DIBDRV_Pie + */ +-BOOL DIBDRV_Pie( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, +- INT xstart, INT ystart, INT xend, INT yend ) ++BOOL DIBDRV_Pie( DIBDRVPHYSDEV *physDev, int left, int top, int right, int bottom, ++ int xstart, int ystart, int xend, int yend ) + { + BOOL res; + +- TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", +- physDev, left, top, right, bottom, xstart, ystart, xend, yend); ++ MAYBE(TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", ++ physDev, left, top, right, bottom, xstart, ystart, xend, yend)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pPie(physDev->X11PhysDev, left, top, right, bottom, +- xstart, ystart, xend, yend); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -250,17 +291,17 @@ BOOL DIBDRV_Pie( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT botto + /********************************************************************** + * DIBDRV_Polygon + */ +-BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) ++BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* pt, int count ) + { + BOOL res; + +- TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count); ++ MAYBE(TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pPolygon(physDev->X11PhysDev, pt, count); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -273,17 +314,17 @@ BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) + /********************************************************************** + * DIBDRV_Polyline + */ +-BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) ++BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* pt, int count ) + { + BOOL res; + +- TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count); ++ MAYBE(TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pPolyline(physDev->X11PhysDev, pt, count); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -296,17 +337,17 @@ BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) + /********************************************************************** + * DIBDRV_PolyPolygon + */ +-BOOL DIBDRV_PolyPolygon( DIBDRVPHYSDEV *physDev, const POINT* pt, const INT* counts, UINT polygons) ++BOOL DIBDRV_PolyPolygon( DIBDRVPHYSDEV *physDev, const POINT* pt, const int* counts, UINT polygons) + { + BOOL res; + +- TRACE("physDev:%p, pt:%p, counts:%p, polygons:%d\n", physDev, pt, counts, polygons); ++ MAYBE(TRACE("physDev:%p, pt:%p, counts:%p, polygons:%d\n", physDev, pt, counts, polygons)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pPolyPolygon(physDev->X11PhysDev, pt, counts, polygons); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -324,13 +365,13 @@ BOOL DIBDRV_PolyPolyline( DIBDRVPHYSDEV *physDev, const POINT* pt, const DWORD* + { + BOOL res; + +- TRACE("physDev:%p, pt:%p, counts:%p, polylines:%d\n", physDev, pt, counts, polylines); ++ MAYBE(TRACE("physDev:%p, pt:%p, counts:%p, polylines:%d\n", physDev, pt, counts, polylines)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pPolyPolyline(physDev->X11PhysDev, pt, counts, polylines); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -343,23 +384,65 @@ BOOL DIBDRV_PolyPolyline( DIBDRVPHYSDEV *physDev, const POINT* pt, const DWORD* + /*********************************************************************** + * DIBDRV_Rectangle + */ +-BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom) ++BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2) + { +- BOOL res; ++ BOOL res = TRUE; ++ int i; ++ DIBDRVBITMAP *bmp = &physDev->physBitmap; + +- TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", +- physDev, left, top, right, bottom); ++ MAYBE(TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", physDev, x1, y1, x2, y2)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pRectangle(physDev->X11PhysDev, left, top, right, bottom); ++ OrderInt(&x1, &x2); ++ OrderInt(&y1, &y2); ++ ++ /* temporary fix.... should be done by clipping */ ++ if(x1 < 0) x1 = 0; ++ if(x2 < 0) x2 = 0; ++ if(y1 < 0) y1 = 0; ++ if(y2 < 0) y2 = 0; ++ if(x1 >= bmp->width) x1 = bmp->width - 1; ++ if(y1 >= bmp->height) y1 = bmp->height - 1; ++ if(x2 > bmp->width) x2 = bmp->width; ++ if(y2 > bmp->height) y2 = bmp->height ; ++ if(x1 >= x2 || y1 >= y2) ++ goto fin; ++ ++ _DIBDRV_ResetDashOrigin(physDev); ++ ++ /* particular case where the rectangle ++ degenerates to a line or a point */ ++ if(x1 >= x2 - 1) ++ { ++ physDev->penVLine(physDev, x1, y1, y2); ++ goto fin; ++ } ++ else if (y1 >= y2 -1) ++ { ++ physDev->penHLine(physDev, x1, x2, y1); ++ goto fin; ++ } ++ ++ /* Draw the perimeter */ ++ physDev->penHLine(physDev, x1 , x2 , y1 ); ++ physDev->penHLine(physDev, x1 , x2 , y2 - 1); ++ physDev->penVLine(physDev, x1 , y1 + 1, y2 - 1); ++ physDev->penVLine(physDev, x2 - 1, y1 + 1, y2 - 1); ++ ++ /* fill the inside */ ++ if(x2 >= x1 + 2) ++ for (i = y1 + 1; i < y2 - 1; i++) ++ physDev->brushHLine(physDev, x1 + 1, x2 - 1, i); ++ ++ res = TRUE; ++fin: ++ ; + } + else + { + /* DDB selected in, use X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pRectangle(physDev->X11PhysDev, left, top, right, bottom); ++ res = _DIBDRV_GetDisplayDriver()->pRectangle(physDev->X11PhysDev, x1, y1, x2, y2); + } + return res; + } +@@ -367,20 +450,19 @@ BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT + /*********************************************************************** + * DIBDRV_RoundRect + */ +-BOOL DIBDRV_RoundRect( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, +- INT bottom, INT ell_width, INT ell_height ) ++BOOL DIBDRV_RoundRect( DIBDRVPHYSDEV *physDev, int left, int top, int right, ++ int bottom, int ell_width, int ell_height ) + { + BOOL res; + +- TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, ell_width:%d, ell_height:%d\n", +- physDev, left, top, right, bottom, ell_width, ell_height); ++ MAYBE(TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, ell_width:%d, ell_height:%d\n", ++ physDev, left, top, right, bottom, ell_width, ell_height)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pRoundRect(physDev->X11PhysDev, left, top, right, bottom, +- ell_width, ell_height); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +@@ -394,17 +476,23 @@ BOOL DIBDRV_RoundRect( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, + /*********************************************************************** + * DIBDRV_SetPixel + */ +-COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color ) ++COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, int x, int y, COLORREF color ) + { + COLORREF res; ++ DWORD and, xor; + +- TRACE("physDev:%p, x:%d, y:%d, color:%x\n", physDev, x, y, color); ++ MAYBE(TRACE("physDev:%p, x:%d, y:%d, color:%x\n", physDev, x, y, color)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetPixel(physDev->X11PhysDev, x, y, color); ++ /* gets previous pixel */ ++ res = physDev->physBitmap.funcs->GetPixel(&physDev->physBitmap, x, y); ++ ++ /* calculates AND and XOR from color */ ++ _DIBDRV_CalcAndXorMasks(GetROP2(physDev->hdc), color, &and, &xor); ++ ++ /* sets the pixel */ ++ physDev->physBitmap.funcs->SetPixel(&physDev->physBitmap, x, y, and, xor); + } + else + { +@@ -417,17 +505,17 @@ COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color ) + /*********************************************************************** + * DIBDRV_SetDCOrg + */ +-DWORD DIBDRV_SetDCOrg( DIBDRVPHYSDEV *physDev, INT x, INT y ) ++DWORD DIBDRV_SetDCOrg( DIBDRVPHYSDEV *physDev, int x, int y ) + { + DWORD res; + +- TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); ++ MAYBE(TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetDCOrg(physDev->X11PhysDev, x, y); ++ ONCE(FIXME("STUB\n")); ++ res = 0; + } + else + { +diff --git a/dlls/winedib.drv/opengl.c b/dlls/winedib.drv/opengl.c +index e8ec96c..f7855f6 100644 +--- a/dlls/winedib.drv/opengl.c ++++ b/dlls/winedib.drv/opengl.c +@@ -32,7 +32,7 @@ int DIBDRV_ChoosePixelFormat( DIBDRVPHYSDEV *physDev, + { + int res; + +- TRACE("physDev:%p, ppfd:%p\n", physDev, ppfd); ++ MAYBE(TRACE("physDev:%p, ppfd:%p\n", physDev, ppfd)); + + if(physDev->hasDIB) + { +@@ -55,7 +55,7 @@ int DIBDRV_DescribePixelFormat( DIBDRVPHYSDEV *physDev, + { + int res; + +- TRACE("physDev:%p, iPixelFormat:%d, nBytes:%d, ppfd:%p\n", physDev, iPixelFormat, nBytes, ppfd); ++ MAYBE(TRACE("physDev:%p, iPixelFormat:%d, nBytes:%d, ppfd:%p\n", physDev, iPixelFormat, nBytes, ppfd)); + + if(physDev->hasDIB) + { +@@ -75,7 +75,7 @@ int DIBDRV_GetPixelFormat( DIBDRVPHYSDEV *physDev) + { + int res; + +- TRACE("physDev:%p\n", physDev); ++ MAYBE(TRACE("physDev:%p\n", physDev)); + + if(physDev->hasDIB) + { +@@ -97,7 +97,7 @@ BOOL DIBDRV_SetPixelFormat( DIBDRVPHYSDEV *physDev, + { + BOOL res; + +- TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd); ++ MAYBE(TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd)); + + if(physDev->hasDIB) + { +@@ -117,7 +117,7 @@ BOOL DIBDRV_SwapBuffers( DIBDRVPHYSDEV *physDev ) + { + BOOL res; + +- TRACE("physDev:%p\n", physDev); ++ MAYBE(TRACE("physDev:%p\n", physDev)); + + if(physDev->hasDIB) + { +@@ -142,7 +142,7 @@ BOOL CDECL DIBDRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) + { + BOOL res; + +- TRACE("hglrcSrc:%p, hglrcDst:%p, mask:%x\n", hglrcSrc, hglrcDst, mask); ++ MAYBE(TRACE("hglrcSrc:%p, hglrcDst:%p, mask:%x\n", hglrcSrc, hglrcDst, mask)); + + ONCE(FIXME("stub\n")); + res = _DIBDRV_GetDisplayDriver()->pwglCopyContext(hglrcSrc, hglrcDst, mask); +@@ -159,7 +159,7 @@ HGLRC CDECL DIBDRV_wglCreateContext(DIBDRVPHYSDEV *physDev) + { + HGLRC res; + +- TRACE("physDev:%p\n", physDev); ++ MAYBE(TRACE("physDev:%p\n", physDev)); + + if(physDev->hasDIB) + { +@@ -184,7 +184,7 @@ BOOL CDECL DIBDRV_wglDeleteContext(HGLRC hglrc) + { + BOOL res; + +- TRACE("hglrc:%p\n", hglrc); ++ MAYBE(TRACE("hglrc:%p\n", hglrc)); + + ONCE(FIXME("stub\n")); + res = _DIBDRV_GetDisplayDriver()->pwglDeleteContext(hglrc); +@@ -200,7 +200,7 @@ PROC CDECL DIBDRV_wglGetProcAddress(LPCSTR lpszProc) + { + PROC res; + +- TRACE("lpszProc:%p\n", lpszProc); ++ MAYBE(TRACE("lpszProc:%p\n", lpszProc)); + + ONCE(FIXME("stub\n")); + res = _DIBDRV_GetDisplayDriver()->pwglGetProcAddress(lpszProc); +@@ -220,7 +220,7 @@ HDC CDECL DIBDRV_wglGetPbufferDCARB(DIBDRVPHYSDEV *physDev, HPBUFFERARB hPbuffer + { + HDC res; + +- TRACE("physDev:%p, hPbuffer:%p\n", physDev, hPbuffer); ++ MAYBE(TRACE("physDev:%p, hPbuffer:%p\n", physDev, hPbuffer)); + + if(physDev->hasDIB) + { +@@ -245,7 +245,7 @@ BOOL CDECL DIBDRV_wglMakeContextCurrentARB(DIBDRVPHYSDEV* pDrawDev, DIBDRVPHYSDE + { + BOOL res; + +- TRACE("pDrawDev:%p, pReadDev:%p, hglrc:%p\n", pDrawDev, pReadDev, hglrc); ++ MAYBE(TRACE("pDrawDev:%p, pReadDev:%p, hglrc:%p\n", pDrawDev, pReadDev, hglrc)); + + if(pDrawDev->hasDIB && pReadDev->hasDIB) + { +@@ -282,7 +282,7 @@ BOOL CDECL DIBDRV_wglMakeCurrent(DIBDRVPHYSDEV *physDev, HGLRC hglrc) + { + BOOL res; + +- TRACE("physDev:%p, hglrc:%p\n", physDev, hglrc); ++ MAYBE(TRACE("physDev:%p, hglrc:%p\n", physDev, hglrc)); + + if(physDev->hasDIB) + { +@@ -308,7 +308,7 @@ BOOL CDECL DIBDRV_wglSetPixelFormatWINE(DIBDRVPHYSDEV *physDev, int iPixelFormat + { + BOOL res; + +- TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd); ++ MAYBE(TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd)); + + if(physDev->hasDIB) + { +@@ -333,7 +333,7 @@ BOOL CDECL DIBDRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) + { + BOOL res; + +- TRACE("hglrc1:%p, hglrc2:%p\n", hglrc1, hglrc2); ++ MAYBE(TRACE("hglrc1:%p, hglrc2:%p\n", hglrc1, hglrc2)); + + ONCE(FIXME("stub\n")); + res = _DIBDRV_GetDisplayDriver()->pwglShareLists(hglrc1, hglrc2); +@@ -350,7 +350,7 @@ BOOL CDECL DIBDRV_wglUseFontBitmapsA(DIBDRVPHYSDEV *physDev, DWORD first, DWORD + { + BOOL res; + +- TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase); ++ MAYBE(TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase)); + + if(physDev->hasDIB) + { +@@ -375,7 +375,7 @@ BOOL CDECL DIBDRV_wglUseFontBitmapsW(DIBDRVPHYSDEV *physDev, DWORD first, DWORD + { + BOOL res; + +- TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase); ++ MAYBE(TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase)); + + if(physDev->hasDIB) + { +diff --git a/dlls/winedib.drv/palette.c b/dlls/winedib.drv/palette.c +index 9daf47d..148a6d5 100644 +--- a/dlls/winedib.drv/palette.c ++++ b/dlls/winedib.drv/palette.c +@@ -32,7 +32,7 @@ UINT DIBDRV_RealizePalette( DIBDRVPHYSDEV *physDev, HPALETTE hpal, BOOL primary + { + UINT res; + +- TRACE("physDev:%p, hpal:%p, primary:%s\n", physDev, hpal, (primary ? "TRUE" : "FALSE")); ++ MAYBE(TRACE("physDev:%p, hpal:%p, primary:%s\n", physDev, hpal, (primary ? "TRUE" : "FALSE"))); + + /* we should in any case call X11 function, as UnrealizePalette() doesn't + * take a physDev parameter */ +@@ -54,7 +54,7 @@ BOOL DIBDRV_UnrealizePalette( HPALETTE hpal ) + { + BOOL res; + +- TRACE("hpal:%p\n", hpal); ++ MAYBE(TRACE("hpal:%p\n", hpal)); + + /* we should in any case call X11 function, as UnrealizePalette() doesn't + * take a physDev parameter */ +@@ -74,13 +74,13 @@ UINT DIBDRV_GetSystemPaletteEntries( DIBDRVPHYSDEV *physDev, UINT start, UINT co + { + UINT res; + +- TRACE("physDev:%p, start:%d, count:%d, entries:%p\n", physDev, start, count, entries); ++ MAYBE(TRACE("physDev:%p, start:%d, count:%d, entries:%p\n", physDev, start, count, entries)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetSystemPaletteEntries(physDev->X11PhysDev, start, count, entries); ++ ONCE(FIXME("STUB\n")); ++ res = 0; + } + else + { +@@ -97,13 +97,13 @@ COLORREF DIBDRV_GetNearestColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + { + COLORREF res; + +- TRACE("physDev:%p, color:%x\n", physDev, color); ++ MAYBE(TRACE("physDev:%p, color:%x\n", physDev, color)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetNearestColor(physDev->X11PhysDev, color); ++ ONCE(FIXME("STUB\n")); ++ res = 0; + } + else + { +@@ -119,14 +119,36 @@ COLORREF DIBDRV_GetNearestColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + UINT DIBDRV_RealizeDefaultPalette( DIBDRVPHYSDEV *physDev ) + { + UINT res; ++#ifdef DIBDRV_ENABLE_MAYBE ++ int i; ++ RGBQUAD *q; ++#endif + +- TRACE("physDev:%p\n", physDev); ++ MAYBE(TRACE("physDev:%p\n", physDev)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pRealizeDefaultPalette(physDev->X11PhysDev); ++ ONCE(FIXME("STUB\n")); ++ /* HACK - we can't get the dib color table during SelectBitmap since it hasn't ++ been initialized yet. This is called from DC_InitDC so it's a convenient place ++ to grab the color table. */ ++ MAYBE(TRACE("Color table size = %d, Color table = %p\n", physDev->physBitmap.colorTableSize, physDev->physBitmap.colorTable)); ++ if(!physDev->physBitmap.colorTableGrabbed) ++ { ++ MAYBE(TRACE("Grabbing palette\n")); ++ physDev->physBitmap.colorTable = HeapAlloc(GetProcessHeap(), 0, sizeof(physDev->physBitmap.colorTable[0]) * physDev->physBitmap.colorTableSize); ++ GetDIBColorTable(physDev->hdc, 0, physDev->physBitmap.colorTableSize, physDev->physBitmap.colorTable); ++#ifdef DIBDRV_ENABLE_MAYBE ++ for(i = 0; i < physDev->physBitmap.colorTableSize; i++) ++ { ++ q = physDev->physBitmap.colorTable + i; ++ TRACE(" %03d : R%03d G%03d B%03d\n", i, q->rgbRed, q->rgbGreen, q->rgbBlue); ++ } ++#endif ++ physDev->physBitmap.colorTableGrabbed = TRUE; ++ } ++ res = 0; + } + else + { +@@ -140,13 +162,14 @@ BOOL DIBDRV_GetICMProfile(DIBDRVPHYSDEV *physDev, LPDWORD lpcbName, LPWSTR lpszF + { + BOOL res; + +- TRACE("physDev:%p, lpcpName:%p, lpszFilename:%p\n", physDev, lpcbName, lpszFilename); ++ MAYBE(TRACE("physDev:%p, lpcpName:%p, lpszFilename:%p\n", physDev, lpcbName, lpszFilename)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetICMProfile(physDev->X11PhysDev, lpcbName, lpszFilename); ++ ONCE(FIXME("STUB\n")); ++ ++ res = 0; + } + else + { +diff --git a/dlls/winedib.drv/pen_brush.c b/dlls/winedib.drv/pen_brush.c +index bde2f23..31c9cd2 100644 +--- a/dlls/winedib.drv/pen_brush.c ++++ b/dlls/winedib.drv/pen_brush.c +@@ -26,20 +26,317 @@ + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + + ++static const DASHPATTERN dashPatterns[4] = ++{ ++ {2, {18, 6}}, ++ {2, {3, 3}}, ++ {4, {9, 6, 3, 6}}, ++ {6, {9, 3, 3, 3, 3, 3}} ++}; ++ ++static inline void OrderEndPoints(int *s, int *e) ++{ ++ if(*s > *e) ++ { ++ int tmp; ++ tmp = *s + 1; ++ *s = *e + 1; ++ *e = tmp; ++ } ++} ++ ++static void SolidPenHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) ++{ ++ OrderEndPoints(&x1, &x2); ++ physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x1, x2, y, physDev->penAnd, physDev->penXor); ++} ++ ++static void SolidPenVline(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) ++{ ++ OrderEndPoints(&y1, &y2); ++ physDev->physBitmap.funcs->SolidVLine(&physDev->physBitmap, x, y1, y2, physDev->penAnd, physDev->penXor); ++} ++ ++static void WINAPI SolidPenLineCallback(int x, int y, LPARAM lparam) ++{ ++ DIBDRVPHYSDEV *physDev = (DIBDRVPHYSDEV *)lparam; ++ ++ physDev->physBitmap.funcs->SetPixel(&physDev->physBitmap, x, y, physDev->penAnd, physDev->penXor); ++ return; ++} ++ ++void SolidPenLine(DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2) ++{ ++ LineDDA(x1, y1, x2, y2, SolidPenLineCallback, (LPARAM)physDev); ++} ++ ++static inline void GetDashColors(DIBDRVPHYSDEV *physDev, DWORD *and, DWORD *xor) ++{ ++ if(physDev->markSpace == mark) ++ { ++ *and = physDev->penAnd; ++ *xor = physDev->penXor; ++ } ++ else if(GetBkMode(physDev->hdc) == OPAQUE) ++ { ++ *and = physDev->backgroundAnd; ++ *xor = physDev->backgroundXor; ++ } ++ else ++ { ++ *and = 0xffffffff; ++ *xor = 0; ++ } ++} ++ ++static inline void NextDash(DIBDRVPHYSDEV *physDev) ++{ ++ if(physDev->leftInDash != 0) ++ return; ++ ++ physDev->curDash++; ++ if(physDev->curDash == physDev->penPattern->count) ++ physDev->curDash = 0; ++ physDev->leftInDash = physDev->penPattern->dashes[physDev->curDash]; ++ if(physDev->markSpace == mark) ++ physDev->markSpace = space; ++ else ++ physDev->markSpace = mark; ++} ++ ++static void DashedPenHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) ++{ ++ int x = x1; ++ DWORD and, xor; ++ DWORD dashLen; ++ ++ if(x1 <= x2) ++ { ++ while(x != x2) ++ { ++ GetDashColors(physDev, &and, &xor); ++ ++ dashLen = physDev->leftInDash; ++ if(x + dashLen > x2) ++ dashLen = x2 - x; ++ ++ physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x, x + dashLen, y, and, xor); ++ x += dashLen; ++ ++ physDev->leftInDash -= dashLen; ++ NextDash(physDev); ++ } ++ } ++ else ++ { ++ while(x != x2) ++ { ++ GetDashColors(physDev, &and, &xor); ++ ++ dashLen = physDev->leftInDash; ++ if(x - (int)dashLen < x2) ++ dashLen = x - x2; ++ ++ physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x - dashLen + 1, x + 1, y, and, xor); ++ x -= dashLen; ++ ++ physDev->leftInDash -= dashLen; ++ NextDash(physDev); ++ } ++ } ++} ++ ++static void DashedPenVLine(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) ++{ ++ int y = y1; ++ DWORD and, xor; ++ DWORD dashLen; ++ ++ if(y1 <= y2) ++ { ++ while(y != y2) ++ { ++ GetDashColors(physDev, &and, &xor); ++ ++ dashLen = physDev->leftInDash; ++ if(y + dashLen > y2) ++ dashLen = y2 - y; ++ ++ physDev->physBitmap.funcs->SolidVLine(&physDev->physBitmap, x, y, y + dashLen, and, xor); ++ y += dashLen; ++ ++ physDev->leftInDash -= dashLen; ++ NextDash(physDev); ++ } ++ } ++ else ++ { ++ while(y != y2) ++ { ++ GetDashColors(physDev, &and, &xor); ++ ++ dashLen = physDev->leftInDash; ++ if(y - (int)dashLen < y2) ++ dashLen = y - y2; ++ ++ physDev->physBitmap.funcs->SolidVLine(&physDev->physBitmap, x, y - dashLen + 1, y + 1, and, xor); ++ y -= dashLen; ++ ++ physDev->leftInDash -= dashLen; ++ NextDash(physDev); ++ } ++ } ++} ++ ++static void WINAPI DashedPenLineCallback(int x, int y, LPARAM lparam) ++{ ++ DIBDRVPHYSDEV *physDev = (DIBDRVPHYSDEV *)lparam; ++ DWORD and, xor; ++ ++ GetDashColors(physDev, &and, &xor); ++ ++ physDev->physBitmap.funcs->SetPixel(&physDev->physBitmap, x, y, and, xor); ++ ++ physDev->leftInDash--; ++ NextDash(physDev); ++ ++ return; ++} ++ ++static void DashedPenLine(DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2) ++{ ++ LineDDA(x1, y1, x2, y2, DashedPenLineCallback, (LPARAM)physDev); ++} ++ ++void _DIBDRV_ResetDashOrigin(DIBDRVPHYSDEV *physDev) ++{ ++ physDev->curDash = 0; ++ if(physDev->penPattern) ++ physDev->leftInDash = physDev->penPattern->dashes[0]; ++ physDev->markSpace = mark; ++} ++ ++ ++/* For 1bpp bitmaps, unless the selected foreground color exactly ++ matches foreground's colortable OR it's the WHITE color, ++ the background color is used -- tested on WinXP */ ++static DWORD AdjustFgColor(DIBDRVPHYSDEV *physDev, COLORREF color) ++{ ++ RGBQUAD *fore = physDev->physBitmap.colorTable+1; ++ ++ if((color & 0x00ffffff) == 0x00ffffff || ++ ( ++ fore->rgbRed == GetRValue(color) && ++ fore->rgbGreen == GetGValue(color) && ++ fore->rgbBlue == GetBValue(color) ++ )) ++ return 1; ++ return 0; ++} ++ ++static void FixupFgColors1(DIBDRVPHYSDEV *physDev) ++{ ++ int rop = GetROP2(physDev->hdc); ++ ++ physDev->penColor = AdjustFgColor(physDev, physDev->penColorref); ++ physDev->brushColor = AdjustFgColor(physDev, physDev->brushColorref); ++ ++ _DIBDRV_CalcAndXorMasks(rop, physDev->penColor, &physDev->penAnd, &physDev->penXor); ++ _DIBDRV_CalcAndXorMasks(rop, physDev->brushColor, &physDev->brushAnd, &physDev->brushXor); ++ HeapFree(GetProcessHeap(), 0, physDev->brushAnds); ++ HeapFree(GetProcessHeap(), 0, physDev->brushXors); ++ physDev->brushAnds = NULL; ++ physDev->brushXors = NULL; ++} ++ ++static void SolidBrushHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) ++{ ++ OrderEndPoints(&x1, &x2); ++ physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x1, x2, y, physDev->brushAnd, physDev->brushXor); ++} ++ ++ ++static void GenerateMasks(DIBDRVPHYSDEV *physDev, DIBDRVBITMAP *bmp, DWORD **and, DWORD **xor) ++{ ++ int rop = GetROP2(physDev->hdc); ++ DWORD *color_ptr, *and_ptr, *xor_ptr; ++ DWORD size = bmp->height * abs(bmp->stride); ++ ++ *and = HeapAlloc(GetProcessHeap(), 0, size); ++ *xor = HeapAlloc(GetProcessHeap(), 0, size); ++ ++ color_ptr = bmp->bits; ++ and_ptr = *and; ++ xor_ptr = *xor; ++ ++ while(size) ++ { ++ _DIBDRV_CalcAndXorMasks(rop, *color_ptr++, and_ptr++, xor_ptr++); ++ size -= 4; ++ } ++} ++ ++static void PatternBrushHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) ++{ ++ DWORD *and, *xor, brushY = y % physDev->brushBitmap.height; ++ ++ if(!physDev->brushAnds) ++ GenerateMasks(physDev, &physDev->brushBitmap, &physDev->brushAnds, &physDev->brushXors); ++ ++ OrderEndPoints(&x1, &x2); ++ and = (DWORD *)((char *)physDev->brushAnds + brushY * physDev->brushBitmap.stride); ++ xor = (DWORD *)((char *)physDev->brushXors + brushY * physDev->brushBitmap.stride); ++ ++ physDev->physBitmap.funcs->PatternHLine(&physDev->physBitmap, x1, x2, y, and, xor, physDev->brushBitmap.width, x1 % physDev->brushBitmap.width); ++} ++ + /*********************************************************************** + * DIBDRV_SelectPen + */ + HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen ) + { + HPEN res; ++ LOGPEN logpen; + +- TRACE("physDev:%p, hpen:%p\n", physDev, hpen); ++ MAYBE(TRACE("physDev:%p, hpen:%p\n", physDev, hpen)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSelectPen(physDev->X11PhysDev, hpen); ++ GetObjectW(hpen, sizeof(logpen), &logpen); ++ ++ physDev->penColorref = logpen.lopnColor; ++ ++ if(physDev->physBitmap.bitCount == 1) ++ FixupFgColors1(physDev); ++ else ++ physDev->penColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, logpen.lopnColor); ++ ++ _DIBDRV_CalcAndXorMasks(GetROP2(physDev->hdc), physDev->penColor, &physDev->penAnd, &physDev->penXor); ++ ++ switch(logpen.lopnStyle) ++ { ++ default: ++ ONCE(FIXME("Unhandled pen style %d\n", logpen.lopnStyle)); ++ /* fall through */ ++ case PS_SOLID: ++ physDev->penHLine = SolidPenHLine; ++ physDev->penVLine = SolidPenVline; ++ physDev->penLine = SolidPenLine; ++ physDev->penPattern = NULL; ++ break; ++ ++ case PS_DASH: ++ case PS_DOT: ++ case PS_DASHDOT: ++ case PS_DASHDOTDOT: ++ physDev->penHLine = DashedPenHLine; ++ physDev->penVLine = DashedPenVLine; ++ physDev->penLine = DashedPenLine; ++ physDev->penPattern = &dashPatterns[logpen.lopnStyle - PS_DASH]; ++ _DIBDRV_ResetDashOrigin(physDev); ++ break; ++ } ++ res = hpen; + } + else + { +@@ -56,13 +353,13 @@ COLORREF DIBDRV_SetDCPenColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) + { + COLORREF res; + +- TRACE("physDev:%p, crColor:%x\n", physDev, crColor); ++ MAYBE(TRACE("physDev:%p, crColor:%x\n", physDev, crColor)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetDCPenColor(physDev->X11PhysDev, crColor); ++ ONCE(FIXME("STUB\n")); ++ res = crColor; + } + else + { +@@ -77,19 +374,151 @@ COLORREF DIBDRV_SetDCPenColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) + */ + HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + { +- HBRUSH res; ++ HBRUSH res = hbrush; ++ LOGBRUSH logbrush; ++ + +- TRACE("physDev:%p, hbrush:%p\n", physDev, hbrush); ++ MAYBE(TRACE("physDev:%p, hbrush:%p\n", physDev, hbrush)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush); ++ GetObjectW(hbrush, sizeof(logbrush), &logbrush); ++ ++ /* frees any currently selected DIB brush and cache */ ++ _DIBDRVBITMAP_Free(&physDev->brushBitmap); ++ _DIBDRVBITMAP_Free(&physDev->brushBmpCache); ++ if(physDev->brushAnds) ++ { ++ HeapFree(GetProcessHeap(), 0, physDev->brushAnds); ++ HeapFree(GetProcessHeap(), 0, physDev->brushXors); ++ } ++ physDev->brushAnds = NULL; ++ physDev->brushXors = NULL; ++ ++ switch (logbrush.lbStyle) ++ { ++ default: ++ FIXME("Unhandled brush style %d\n", logbrush.lbStyle); ++ physDev->brushColorref = 0; ++ goto solid; ++ ++ case BS_SOLID: ++ physDev->brushColorref = logbrush.lbColor; ++ solid: ++ MAYBE(TRACE("SOLID Pattern -- color is %x\n", physDev->brushColorref)); ++ physDev->brushStyle = BS_SOLID; ++ physDev->brushHLine = SolidBrushHLine; ++ ++ if(physDev->physBitmap.bitCount == 1) ++ FixupFgColors1(physDev); ++ else ++ physDev->brushColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, logbrush.lbColor); ++ ++ _DIBDRV_CalcAndXorMasks(physDev->rop2, physDev->brushColor, ++ &physDev->brushAnd, &physDev->brushXor); ++ ++ /* set the physDev brush style */ ++ physDev->brushStyle = BS_SOLID; ++ physDev->isBrushBitmap = FALSE; ++ ++ break; ++ ++ case BS_DIBPATTERN8X8: ++ case BS_DIBPATTERN: ++ { ++ DIBDRVBITMAP src; ++ BITMAPINFO *bmi; ++ ++ FIXME("DIB Pattern\n"); ++ ++ /* if no DIB selected in, fallback to null brush */ ++ if(!physDev->physBitmap.bits) ++ { ++ physDev->brushColorref = 0; ++ goto solid; ++ } ++ ++ /* gets brush DIB's pointer */ ++ bmi = GlobalLock16(logbrush.lbHatch); ++ ++ /* initializes a temporary DIB with brush's one */ ++ if(!_DIBDRVBITMAP_InitFromBitmapinfo(&src, bmi)) ++ { ++ ERR("Failed to initialize brush DIB\n"); ++ res = 0; ++ goto err; ++ } ++ ++ /* converts brush bitmap to match currently selected one's format */ ++ if(!_DIBDRVBITMAP_Convert(&physDev->brushBitmap, &src, &physDev->physBitmap)) ++ { ++ ERR("Failed to convert brush DIB\n"); ++ _DIBDRVBITMAP_Free(&src); ++ res = 0; ++ goto err; ++ } ++ ++ /* frees temporary DIB's data */ ++ _DIBDRVBITMAP_Free(&src); ++ ++ /* use DIB pattern for brush lines */ ++ physDev->brushHLine = PatternBrushHLine; ++ ++ err: ++ /* frees brush's DIB pointer */ ++ GlobalUnlock16(logbrush.lbHatch); ++ ++ break; ++ } ++ case BS_DIBPATTERNPT: ++ FIXME("BS_DIBPATTERNPT not supported\n"); ++ physDev->brushColorref = 0; ++ goto solid; ++ ++ case BS_HATCHED: ++ FIXME("BS_HATCHED not supported\n"); ++ physDev->brushColorref = 0; ++ goto solid; ++ ++ case BS_NULL: ++ { ++ MAYBE(TRACE("NULL Pattern\n")); ++ physDev->brushColorref = 0; ++ goto solid; ++ } ++ ++ case BS_PATTERN: ++ case BS_PATTERN8X8: ++ FIXME("BS_PATTERN not supported\n"); ++ physDev->brushColorref = 0; ++ goto solid; ++ } ++ ++ MAYBE(TRACE("END\n")); ++ return hbrush; + } + else + { + /* DDB selected in, use X11 driver */ ++ ++ /* we must check if a DIB pattern is requested */ ++ GetObjectW(hbrush, sizeof(logbrush), &logbrush); ++ switch (logbrush.lbStyle) ++ { ++ case BS_DIBPATTERN8X8: ++ case BS_DIBPATTERN: ++ case BS_DIBPATTERNPT: ++ FIXME("A DIB pattern was requested for a DDB bitmap\n"); ++ break; ++ ++ case BS_SOLID: ++ case BS_HATCHED: ++ case BS_NULL: ++ case BS_PATTERN: ++ case BS_PATTERN8X8: ++ default: ++ break; ++ } + res = _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush); + } + return res; +@@ -102,13 +531,13 @@ COLORREF DIBDRV_SetDCBrushColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) + { + COLORREF res; + +- TRACE("physDev:%p, crColor:%x\n", physDev, crColor); ++ MAYBE(TRACE("physDev:%p, crColor:%x\n", physDev, crColor)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetDCBrushColor(physDev->X11PhysDev, crColor); ++ ONCE(FIXME("STUB\n")); ++ res = crColor; + } + else + { +@@ -121,14 +550,29 @@ COLORREF DIBDRV_SetDCBrushColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) + /*********************************************************************** + * SetROP2 + */ +-INT DIBDRV_SetROP2( DIBDRVPHYSDEV *physDev, INT rop ) ++int DIBDRV_SetROP2( DIBDRVPHYSDEV *physDev, int rop ) + { +- INT prevRop; ++ int prevRop; + +- TRACE("physDev:%p, rop:%x\n", physDev, rop); ++ MAYBE(TRACE("physDev:%p, rop:%x\n", physDev, rop)); + + prevRop = physDev->rop2; + physDev->rop2 = rop; ++ ++ if(prevRop != rop) ++ { ++ _DIBDRV_CalcAndXorMasks(rop, physDev->penColor, &physDev->penAnd, &physDev->penXor); ++ _DIBDRV_CalcAndXorMasks(rop, physDev->brushColor, &physDev->brushAnd, &physDev->brushXor); ++ _DIBDRV_CalcAndXorMasks(rop, physDev->backgroundColor, &physDev->backgroundAnd, &physDev->backgroundXor); ++ if(physDev->brushAnds) ++ { ++ HeapFree(GetProcessHeap(), 0, physDev->brushAnds); ++ HeapFree(GetProcessHeap(), 0, physDev->brushXors); ++ } ++ physDev->brushAnds = NULL; ++ physDev->brushXors = NULL; ++ } ++ + return prevRop; + /* note : X11 Driver don't have SetROP2() function exported */ + } +@@ -140,13 +584,17 @@ COLORREF DIBDRV_SetBkColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + { + COLORREF res; + +- TRACE("physDev:%p, color:%x\n", physDev, color); ++ MAYBE(TRACE("physDev:%p, color:%x\n", physDev, color)); + + if(physDev->hasDIB) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetBkColor(physDev->X11PhysDev, color); ++ physDev->backgroundColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, color); ++ ++ if(physDev->physBitmap.bitCount == 1) ++ FixupFgColors1(physDev); ++ _DIBDRV_CalcAndXorMasks(physDev->rop2, physDev->backgroundColor, &physDev->backgroundAnd, &physDev->backgroundXor); ++ ++ res = TRUE; + } + else + { +diff --git a/dlls/winedib.drv/primitives.c b/dlls/winedib.drv/primitives.c +new file mode 100644 +index 0000000..cbad239 +--- /dev/null ++++ b/dlls/winedib.drv/primitives.c +@@ -0,0 +1,274 @@ ++/* ++ * DIB Engine Primitives function pointers ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* ------------------------------------------------------------*/ ++/* COLOR FUNCTIONS */ ++DWORD _DIBDRV_ColorToPixel32_RGB (const DIBDRVBITMAP *dib, COLORREF color); ++DWORD _DIBDRV_ColorToPixel32_BITFIELDS(const DIBDRVBITMAP *dib, COLORREF color); ++DWORD _DIBDRV_ColorToPixel24 (const DIBDRVBITMAP *dib, COLORREF color); ++DWORD _DIBDRV_ColorToPixel16_RGB (const DIBDRVBITMAP *dib, COLORREF color); ++DWORD _DIBDRV_ColorToPixel16_BITFIELDS(const DIBDRVBITMAP *dib, COLORREF color); ++DWORD _DIBDRV_ColorToPixelColortable (const DIBDRVBITMAP *dib, COLORREF color); ++ ++/* ------------------------------------------------------------*/ ++/* PIXEL POINTER READING */ ++void *_DIBDRV_GetPixelPointer32(const DIBDRVBITMAP *dib, int x, int y); ++void *_DIBDRV_GetPixelPointer24(const DIBDRVBITMAP *dib, int x, int y); ++void *_DIBDRV_GetPixelPointer16(const DIBDRVBITMAP *dib, int x, int y); ++void *_DIBDRV_GetPixelPointer8 (const DIBDRVBITMAP *dib, int x, int y); ++void *_DIBDRV_GetPixelPointer4 (const DIBDRVBITMAP *dib, int x, int y); ++void *_DIBDRV_GetPixelPointer1 (const DIBDRVBITMAP *dib, int x, int y); ++ ++/* ------------------------------------------------------------*/ ++/* PIXEL WRITING */ ++void _DIBDRV_SetPixel32(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor); ++void _DIBDRV_SetPixel24(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor); ++void _DIBDRV_SetPixel16(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor); ++void _DIBDRV_SetPixel8 (DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor); ++void _DIBDRV_SetPixel4 (DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor); ++void _DIBDRV_SetPixel1 (DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor); ++ ++/* ------------------------------------------------------------*/ ++/* PIXEL READING */ ++DWORD _DIBDRV_GetPixel32_RGB (const DIBDRVBITMAP *dib, int x, int y); ++DWORD _DIBDRV_GetPixel32_BITFIELDS(const DIBDRVBITMAP *dib, int x, int y); ++DWORD _DIBDRV_GetPixel24 (const DIBDRVBITMAP *dib, int x, int y); ++DWORD _DIBDRV_GetPixel16_RGB (const DIBDRVBITMAP *dib, int x, int y); ++DWORD _DIBDRV_GetPixel16_BITFIELDS(const DIBDRVBITMAP *dib, int x, int y); ++DWORD _DIBDRV_GetPixel8 (const DIBDRVBITMAP *dib, int x, int y); ++DWORD _DIBDRV_GetPixel4 (const DIBDRVBITMAP *dib, int x, int y); ++DWORD _DIBDRV_GetPixel1 (const DIBDRVBITMAP *dib, int x, int y); ++ ++/* ------------------------------------------------------------*/ ++/* HORIZONTAL SOLID LINES */ ++void _DIBDRV_SolidHLine32(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor); ++void _DIBDRV_SolidHLine24(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor); ++void _DIBDRV_SolidHLine16(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor); ++void _DIBDRV_SolidHLine8 (DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor); ++void _DIBDRV_SolidHLine4 (DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor); ++void _DIBDRV_SolidHLine1 (DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor); ++ ++/* ------------------------------------------------------------*/ ++/* HORIZONTAL PATTERN LINES */ ++void _DIBDRV_PatternHLine32(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset); ++void _DIBDRV_PatternHLine24(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset); ++void _DIBDRV_PatternHLine16(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset); ++void _DIBDRV_PatternHLine8 (DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset); ++void _DIBDRV_PatternHLine4 (DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset); ++void _DIBDRV_PatternHLine1 (DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset); ++ ++/* ------------------------------------------------------------*/ ++/* VERTICAL LINES */ ++void _DIBDRV_SolidVLine32(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor); ++void _DIBDRV_SolidVLine24(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor); ++void _DIBDRV_SolidVLine16(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor); ++void _DIBDRV_SolidVLine8 (DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor); ++void _DIBDRV_SolidVLine4 (DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor); ++void _DIBDRV_SolidVLine1 (DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor); ++ ++/* ----------------------------------------------------------------*/ ++/* CONVERT PRIMITIVES */ ++/* converts (part of) line of any DIB format from/to DIB32_RGB one */ ++BOOL _DIBDRV_GetLine32_RGB (const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_GetLine32_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_GetLine24 (const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_GetLine16_RGB (const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_GetLine16_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_GetLine8 (const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_GetLine4 (const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_GetLine1 (const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++ ++BOOL _DIBDRV_PutLine32_RGB (DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_PutLine32_BITFIELDS(DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_PutLine24 (DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_PutLine16_RGB (DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_PutLine16_BITFIELDS(DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_PutLine8 (DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_PutLine4 (DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++BOOL _DIBDRV_PutLine1 (DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf); ++ ++/* ------------------------------------------------------------*/ ++/* BLITTING PRIMITIVES */ ++BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop); ++BOOL _DIBDRV_BitBlt_32(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop); ++BOOL _DIBDRV_BitBlt_24(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop); ++BOOL _DIBDRV_BitBlt_16(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop); ++BOOL _DIBDRV_BitBlt_8(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop); ++ ++BOOL _DIBDRV_StretchBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT widthDst, INT heightDst, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, int widthSrc, int heightSrc, DWORD rop); ++ ++/* ------------------------------------------------------------*/ ++/* FREETYPE FONT BITMAP BLITTING */ ++void _DIBDRV_freetype_blit_8888 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_32_RGB (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_24 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_16_RGB (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_8 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_4 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++void _DIBDRV_freetype_blit_1 (DIBDRVPHYSDEV *dib, int x, int y, FT_Bitmap *bmp); ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_RGB = ++{ ++ _DIBDRV_ColorToPixel32_RGB, ++ _DIBDRV_GetPixelPointer32, ++ _DIBDRV_SetPixel32, ++ _DIBDRV_GetPixel32_RGB, ++ _DIBDRV_SolidHLine32, ++ _DIBDRV_PatternHLine32, ++ _DIBDRV_SolidVLine32, ++ _DIBDRV_GetLine32_RGB, ++ _DIBDRV_PutLine32_RGB, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_32_RGB ++}; ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB32_BITFIELDS = ++{ ++ _DIBDRV_ColorToPixel32_BITFIELDS, ++ _DIBDRV_GetPixelPointer32, ++ _DIBDRV_SetPixel32, ++ _DIBDRV_GetPixel32_BITFIELDS, ++ _DIBDRV_SolidHLine32, ++ _DIBDRV_PatternHLine32, ++ _DIBDRV_SolidVLine32, ++ _DIBDRV_GetLine32_BITFIELDS, ++ _DIBDRV_PutLine32_BITFIELDS, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_32_BITFIELDS ++}; ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB24 = ++{ ++ _DIBDRV_ColorToPixel24, ++ _DIBDRV_GetPixelPointer24, ++ _DIBDRV_SetPixel24, ++ _DIBDRV_GetPixel24, ++ _DIBDRV_SolidHLine24, ++ _DIBDRV_PatternHLine24, ++ _DIBDRV_SolidVLine24, ++ _DIBDRV_GetLine24, ++ _DIBDRV_PutLine24, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_24 ++}; ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_RGB = ++{ ++ _DIBDRV_ColorToPixel16_RGB, ++ _DIBDRV_GetPixelPointer16, ++ _DIBDRV_SetPixel16, ++ _DIBDRV_GetPixel16_RGB, ++ _DIBDRV_SolidHLine16, ++ _DIBDRV_PatternHLine16, ++ _DIBDRV_SolidVLine16, ++ _DIBDRV_GetLine16_RGB, ++ _DIBDRV_PutLine16_RGB, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_16_RGB ++}; ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB16_BITFIELDS = ++{ ++ _DIBDRV_ColorToPixel16_BITFIELDS, ++ _DIBDRV_GetPixelPointer16, ++ _DIBDRV_SetPixel16, ++ _DIBDRV_GetPixel16_BITFIELDS, ++ _DIBDRV_SolidHLine16, ++ _DIBDRV_PatternHLine16, ++ _DIBDRV_SolidVLine16, ++ _DIBDRV_GetLine16_BITFIELDS, ++ _DIBDRV_PutLine16_BITFIELDS, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_16_BITFIELDS ++}; ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB8 = ++{ ++ _DIBDRV_ColorToPixelColortable, ++ _DIBDRV_GetPixelPointer8, ++ _DIBDRV_SetPixel8, ++ _DIBDRV_GetPixel8, ++ _DIBDRV_SolidHLine8, ++ _DIBDRV_PatternHLine8, ++ _DIBDRV_SolidVLine8, ++ _DIBDRV_GetLine8, ++ _DIBDRV_PutLine8, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_8 ++}; ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB4 = ++{ ++ _DIBDRV_ColorToPixelColortable, ++ _DIBDRV_GetPixelPointer4, ++ _DIBDRV_SetPixel4, ++ _DIBDRV_GetPixel4, ++ _DIBDRV_SolidHLine4, ++ _DIBDRV_PatternHLine4, ++ _DIBDRV_SolidVLine4, ++ _DIBDRV_GetLine4, ++ _DIBDRV_PutLine4, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_4 ++}; ++ ++DIBDRV_PRIMITIVE_FUNCS DIBDRV_funcs_DIB1 = ++{ ++ _DIBDRV_ColorToPixelColortable, ++ _DIBDRV_GetPixelPointer1, ++ _DIBDRV_SetPixel1, ++ _DIBDRV_GetPixel1, ++ _DIBDRV_SolidHLine1, ++ _DIBDRV_PatternHLine1, ++ _DIBDRV_SolidVLine1, ++ _DIBDRV_GetLine1, ++ _DIBDRV_PutLine1, ++ _DIBDRV_BitBlt_generic, ++ _DIBDRV_StretchBlt_generic, ++ _DIBDRV_freetype_blit_1 ++}; +diff --git a/dlls/winedib.drv/primitives_bitblt.c b/dlls/winedib.drv/primitives_bitblt.c +new file mode 100644 +index 0000000..da48352 +--- /dev/null ++++ b/dlls/winedib.drv/primitives_bitblt.c +@@ -0,0 +1,1075 @@ ++/* ++ * DIB Engine BitBlt Primitives ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* shrinks a line -- srcWidth >= dstWidth */ ++static void ShrinkLine(DWORD *dst, int dstWidth, DWORD *src, int srcWidth) ++{ ++ int srcPos, dstPos; ++ int delta; ++ ++ srcPos = 0; ++ dstPos = 0; ++ delta = 0; ++ while(dstPos < dstWidth) ++ { ++ *dst++ = *src; ++ while(delta < srcWidth) ++ { ++ srcPos++; ++ src++; ++ delta += dstWidth; ++ } ++ delta -= srcWidth; ++ dstPos++; ++ } ++} ++ ++/* expands a line -- srcWidth <= dstWidth */ ++static void ExpandLine(DWORD *dst, int dstWidth, DWORD *src, int srcWidth) ++{ ++ int srcPos; ++ int delta; ++ ++ srcPos = 0; ++ delta = 0; ++ while(srcPos < srcWidth) ++ { ++ while(delta < dstWidth) ++ { ++ *dst++ = *src; ++ delta += srcWidth; ++ } ++ delta -= dstWidth; ++ src++; ++ srcPos++; ++ } ++} ++ ++/* stretch a line */ ++static void StretchLine(DWORD *dst, int dstWidth, DWORD *src, int srcWidth) ++{ ++ if(srcWidth > dstWidth) ++ ShrinkLine(dst, dstWidth, src, srcWidth); ++ else if(srcWidth < dstWidth) ++ ExpandLine(dst, dstWidth, src, srcWidth); ++ else ++ memcpy(dst, src, 4 * srcWidth); ++} ++ ++/* ------------------------------------------------------------*/ ++/* BLITTING PRIMITIVES */ ++BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop) ++{ ++ int ys, yd; ++ int i; ++ DWORD *dwBuf; ++ DIBDRVBITMAP *dstBmp, *patBmp; ++ const DIBDRVBITMAP *srcBmp; ++ DWORD *wDstPnt, *wSrcPnt, *wPatPnt; ++ BOOL usePat, useSrc, useDst; ++ DWORD patColor; ++ BOOL res = FALSE; ++ ++ /* 32 bit RGB source and destination buffer, if needed */ ++ DWORD *sBuf = 0, *dBuf = 0, *pBuf = 0; ++ ++ /* get elements usage */ ++ usePat = (((rop >> 4) & 0x0f0000) != (rop & 0x0f0000)); ++ useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000)); ++ useDst = (((rop >> 1) & 0x550000) != (rop & 0x550000)); ++ ++ /* gets source, dest and pattern bitmaps, if available */ ++ if(usePat && physDevDst->isBrushBitmap) ++ patBmp = &physDevDst->brushBmpCache; ++ else ++ patBmp = NULL; ++ ++ if(useSrc) ++ srcBmp = &physDevSrc->physBitmap; ++ else ++ srcBmp = NULL; ++ dstBmp = &physDevDst->physBitmap; ++ ++ /* gets pattern color, in case it's needed */ ++ if(usePat) ++ patColor = physDevDst->brushColor; ++ else ++ patColor = 0; ++ ++ /* allocate 32 bit RGB destination buffer */ ++ if(!(dBuf = (DWORD *)HeapAlloc( GetProcessHeap(), 0, width * 4))) ++ goto error; ++ ++ MAYBE(TRACE("dstBmp:%p(%s), xDst:%d, yDst:%d, width:%d, height:%d, srcBmp:%p(%s), xSrc:%d, ySrc:%d, rop:%8x\n", ++ dstBmp, _DIBDRVBITMAP_GetFormatName(dstBmp), xDst, yDst, width, height, ++ srcBmp, _DIBDRVBITMAP_GetFormatName(srcBmp), xSrc, ySrc, rop)); ++ ++ /* some simple ROPs optimizations */ ++ switch(rop) ++ { ++ case BLACKNESS: ++ MAYBE(TRACE("BLACKNESS\n")); ++ memset(dBuf, 0x00, width * 4); ++ for(yd = yDst; yd < yDst+height; yd++) ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ break; ++ ++ case WHITENESS: ++ MAYBE(TRACE("WHITENESS\n")); ++ for(dwBuf = dBuf, i = width; i; i--) ++ *dwBuf++ = 0x00ffffff; ++ for(yd = yDst; yd < yDst+height; yd++) ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ break; ++ ++ case SRCCOPY: ++ MAYBE(TRACE("SRCCOPY\n")); ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, width, dBuf); ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ break; ++ ++ /* fallback for generic ROP operation */ ++ default: ++ rop >>= 16; ++ if(useSrc && useDst && usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("BitBlt use: src+dst+pat - pattern brush\n")); ++ if(!(sBuf = HeapAlloc( GetProcessHeap(), 0, width * 4))) ++ goto error; ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, width * 4))) ++ goto error; ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, width, sBuf); ++ dstBmp->funcs->GetLine(dstBmp, ys, xDst, width, dBuf); ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, width, pBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBuf; ++ wPatPnt = pBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else if(useSrc && useDst) ++ { ++ if(usePat) ++ MAYBE(TRACE("BitBlt use: src+dst+pat - solid brush\n")); ++ else ++ MAYBE(TRACE("BitBlt use: src+dst\n")); ++ if(!(sBuf = HeapAlloc( GetProcessHeap(), 0, width * 4))) ++ goto error; ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, width, sBuf); ++ dstBmp->funcs->GetLine(dstBmp, yd, xDst, width, dBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else if(useSrc && usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("BitBlt use: src+pat -- pattern brush\n")); ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, width * 4))) ++ goto error; ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, width, dBuf); ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, width, pBuf); ++ wDstPnt = sBuf; ++ wSrcPnt = sBuf; ++ wPatPnt = pBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else if(useSrc) ++ { ++ if(usePat) ++ MAYBE(TRACE("BitBlt use: src+pat - solid brush\n")); ++ else ++ MAYBE(TRACE("BitBlt use: src\n")); ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, width, dBuf); ++ wDstPnt = sBuf; ++ wSrcPnt = sBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else if(useDst && usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("BitBlt use: dst+pat -- pattern brush\n")); ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, width * 4))) ++ goto error; ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ dstBmp->funcs->GetLine(srcBmp, ys, xDst, width, dBuf); ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, width, pBuf); ++ wDstPnt = sBuf; ++ wPatPnt = pBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else if(useDst) ++ { ++ if(usePat) ++ MAYBE(TRACE("BitBlt use: dst+pat - solid brush\n")); ++ else ++ MAYBE(TRACE("BitBlt use: dst\n")); ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ dstBmp->funcs->GetLine(srcBmp, ys, xDst, width, dBuf); ++ wDstPnt = sBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else if(usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("BitBlt use: pat -- pattern brush\n")); ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, width * 4))) ++ goto error; ++ for(ys = ySrc, yd = yDst; ys < ySrc+height; ys++, yd++) ++ { ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, width, pBuf); ++ wDstPnt = dBuf; ++ wPatPnt = pBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else if(usePat) ++ { ++ MAYBE(TRACE("BitBlt use: pat -- solid brush -- rop is %02x, color is %08x\n", rop, patColor)); ++ MAYBE(TRACE("Dest BMP is a '%s'\n", _DIBDRVBITMAP_GetFormatName(dstBmp))); ++ MAYBE(TRACE("xDst = %d, yDst = %d, width = %d, height = %d\n", xDst, yDst, width, height)); ++ for(yd = yDst; yd < yDst+height; yd++) ++ { ++ wDstPnt = dBuf; ++ for(i = width; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, width, dBuf); ++ } ++ } ++ else ++ ERR("What happened ?????? \n"); ++ break; ++ } /* switch */ ++ res = TRUE; ++error: ++ if(sBuf) HeapFree( GetProcessHeap(), 0, sBuf ); ++ if(dBuf) HeapFree( GetProcessHeap(), 0, dBuf ); ++ if(pBuf) HeapFree( GetProcessHeap(), 0, pBuf ); ++ return res; ++} ++ ++/* ------------------------------------------------------------*/ ++/* STRETCHING PRIMITIVES */ ++BOOL _DIBDRV_StretchBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT widthDst, INT heightDst, const DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, int widthSrc, int heightSrc, DWORD rop) ++{ ++ int ys, yd; ++ int i, delta; ++ DWORD *dwBuf; ++ DIBDRVBITMAP *dstBmp, *patBmp; ++ const DIBDRVBITMAP *srcBmp; ++ DWORD *wDstPnt, *wSrcPnt, *wPatPnt; ++ BOOL usePat, useSrc, useDst; ++ DWORD patColor; ++ BOOL res = FALSE; ++ ++ /* 32 bit RGB source and destination buffer, if needed */ ++ DWORD *sBufOrig = 0, *sBufStr = 0, *dBuf = 0, *pBuf = 0; ++ ++ /* get elements usage */ ++ usePat = (((rop >> 4) & 0x0f0000) != (rop & 0x0f0000)); ++ useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000)); ++ useDst = (((rop >> 1) & 0x550000) != (rop & 0x550000)); ++ ++ /* gets source, dest and pattern bitmaps, if available */ ++ if(usePat && physDevDst->isBrushBitmap) ++ patBmp = &physDevDst->brushBmpCache; ++ else ++ patBmp = NULL; ++ ++ if(useSrc) ++ srcBmp = &physDevSrc->physBitmap; ++ else ++ srcBmp = NULL; ++ dstBmp = &physDevDst->physBitmap; ++ ++ /* gets pattern color, in case it's needed */ ++ if(usePat) ++ patColor = physDevDst->brushColor; ++ else ++ patColor = 0; ++ ++ /* allocate 32 bit RGB destination buffer */ ++ if(!(dBuf = (DWORD *)HeapAlloc( GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ ++ MAYBE(TRACE("dstBmp:%p(%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, srcBmp:%p(%s), xSrc:%d, ySrc:%d, , widthSrc:%d, heightSrc:%drop:%8x\n", ++ dstBmp, _DIBDRVBITMAP_GetFormatName(dstBmp), xDst, yDst, widthDst, heightDst, ++ srcBmp, _DIBDRVBITMAP_GetFormatName(srcBmp), xSrc, ySrc, widthSrc, heightSrc, rop)); ++ ++ /* some simple ROPs optimizations */ ++ switch(rop) ++ { ++ case BLACKNESS: ++ MAYBE(TRACE("BLACKNESS\n")); ++ memset(dBuf, 0x00, widthDst * 4); ++ for(yd = yDst; yd < yDst+heightDst; yd++) ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ break; ++ ++ case WHITENESS: ++ MAYBE(TRACE("WHITENESS\n")); ++ for(dwBuf = dBuf, i = widthDst; i; i--) ++ *dwBuf++ = 0x00ffffff; ++ for(yd = yDst; yd < yDst+heightDst; yd++) ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ break; ++ ++ case SRCCOPY: ++ MAYBE(TRACE("SRCCOPY\n")); ++ sBufOrig = HeapAlloc(GetProcessHeap(), 0, widthSrc * 4); ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(dBuf, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(dBuf, widthDst, sBufOrig, widthSrc); ++ while(delta < heightDst) ++ { ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBufOrig); ++ StretchLine(dBuf, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ break; ++ ++ /* fallback for generic ROP operation */ ++ default: ++ rop >>= 16; ++ if(useSrc && useDst && usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("StretchBlt use: src+dst+pat - pattern brush\n")); ++ if(!(sBufOrig = HeapAlloc(GetProcessHeap(), 0, widthSrc * 4))) ++ goto error; ++ if(!(sBufStr = HeapAlloc(GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->GetLine(dstBmp, ys, xDst, widthDst, dBuf); ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else if(useSrc && useDst) ++ { ++ if(usePat) ++ MAYBE(TRACE("StretchBlt use: src+dst+pat - solid brush\n")); ++ else ++ MAYBE(TRACE("StretchBlt use: src+dst\n")); ++ if(!(sBufOrig = HeapAlloc(GetProcessHeap(), 0, widthSrc * 4))) ++ goto error; ++ if(!(sBufStr = HeapAlloc(GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ dstBmp->funcs->GetLine(dstBmp, ys, xDst, widthDst, dBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else if(useSrc && usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("StretchBlt use: src+pat -- pattern brush\n")); ++ if(!(sBufOrig = HeapAlloc(GetProcessHeap(), 0, widthSrc * 4))) ++ goto error; ++ if(!(sBufStr = HeapAlloc(GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else if(useSrc) ++ { ++ if(usePat) ++ MAYBE(TRACE("StretchBlt use: src+pat - solid brush\n")); ++ else ++ MAYBE(TRACE("StretchBlt use: src\n")); ++ if(!(sBufOrig = HeapAlloc(GetProcessHeap(), 0, widthSrc * 4))) ++ goto error; ++ if(!(sBufStr = HeapAlloc(GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys + ySrc, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ srcBmp->funcs->GetLine(srcBmp, ys, xSrc, widthSrc, sBufOrig); ++ StretchLine(sBufStr, widthDst, sBufOrig, widthSrc); ++ wDstPnt = dBuf; ++ wSrcPnt = sBufStr; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, *wSrcPnt++, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else if(useDst && usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("StretchBlt use: dst+pat -- pattern brush\n")); ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ dstBmp->funcs->GetLine(dstBmp, ys, xDst, widthDst, dBuf); ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else if(useDst) ++ { ++ if(usePat) ++ MAYBE(TRACE("StretchBlt use: dst+pat - solid brush\n")); ++ else ++ MAYBE(TRACE("StretchBlt use: dst\n")); ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ wDstPnt = dBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ dstBmp->funcs->GetLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ dstBmp->funcs->GetLine(dstBmp, ys, xDst, widthDst, dBuf); ++ wDstPnt = dBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, *wDstPnt, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else if(usePat && physDevDst->isBrushBitmap) ++ { ++ MAYBE(TRACE("StretchBlt use: pat -- pattern brush\n")); ++ if(!(pBuf = HeapAlloc( GetProcessHeap(), 0, widthDst * 4))) ++ goto error; ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ patBmp->funcs->GetLine(patBmp, (yd + yDst)%patBmp->height, 0, widthDst, pBuf); ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ patBmp->funcs->GetLine(patBmp, ys%patBmp->height, 0, widthDst, pBuf); ++ wDstPnt = dBuf; ++ wPatPnt = pBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(*wPatPnt++, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else if(usePat) ++ { ++ MAYBE(TRACE("StretchBlt use: pat -- solid brush -- rop is %02x, color is %08x\n", rop, patColor)); ++ MAYBE(TRACE("Dest BMP is a '%s'\n", _DIBDRVBITMAP_GetFormatName(dstBmp))); ++ MAYBE(TRACE("xDst = %d, yDst = %d, widthDst = %d, heightDst = %d\n", xDst, yDst, widthDst, heightDst)); ++ if(heightSrc > heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(yd < heightDst) ++ { ++ wDstPnt = dBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ while(delta < heightSrc) ++ { ++ ys++; ++ delta += heightDst; ++ } ++ delta -= heightSrc; ++ yd++; ++ } ++ } ++ else if(heightSrc < heightDst) ++ { ++ ys = 0; ++ yd = 0; ++ delta = 0; ++ while(ys < heightSrc) ++ { ++ while(delta < heightDst) ++ { ++ wDstPnt = dBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd + yDst, xDst, widthDst, dBuf); ++ yd++; ++ delta += heightSrc; ++ } ++ delta -= heightDst; ++ ys++; ++ } ++ } ++ else ++ { ++ for(ys = ySrc, yd = yDst; ys < ySrc+heightSrc; ys++, yd++) ++ { ++ wDstPnt = dBuf; ++ for(i = widthDst; i > 0 ; i--) ++ { ++ *wDstPnt = _DIBDRV_ROP3(patColor, 0, 0, rop); ++ wDstPnt++; ++ } ++ dstBmp->funcs->PutLine(dstBmp, yd, xDst, widthDst, dBuf); ++ } ++ } ++ } ++ else ++ ERR("What happened ?????? \n"); ++ break; ++ } /* switch */ ++ res = TRUE; ++error: ++ if(sBufOrig) HeapFree( GetProcessHeap(), 0, sBufOrig ); ++ if(sBufStr) HeapFree( GetProcessHeap(), 0, sBufStr ); ++ if(dBuf) HeapFree( GetProcessHeap(), 0, dBuf ); ++ if(pBuf) HeapFree( GetProcessHeap(), 0, pBuf ); ++ return res; ++} +diff --git a/dlls/winedib.drv/primitives_color.c b/dlls/winedib.drv/primitives_color.c +new file mode 100644 +index 0000000..3ccc2e0 +--- /dev/null ++++ b/dlls/winedib.drv/primitives_color.c +@@ -0,0 +1,142 @@ ++/* ++ * DIB Engine color Primitives ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* ------------------------------------------------------------*/ ++/* BITFIELD HELPERS */ ++static inline DWORD PutField32(DWORD field, int shift, int len) ++{ ++ shift = shift - (8 - len); ++ if (len <= 8) ++ field &= (((1 << len) - 1) << (8 - len)); ++ if (shift < 0) ++ field >>= -shift; ++ else ++ field <<= shift; ++ return field; ++} ++ ++static inline WORD PutField16(WORD field, int shift, int len) ++{ ++ shift = shift - (8 - len); ++ if (len <= 8) ++ field &= (((1 << len) - 1) << (8 - len)); ++ if (shift < 0) ++ field >>= -shift; ++ else ++ field <<= shift; ++ return field; ++} ++ ++/* ------------------------------------------------------------*/ ++/* COLOR FUNCTIONS */ ++DWORD _DIBDRV_ColorToPixel32_RGB(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ return ( ((color >> 16) & 0xff) | (color & 0xff00) | ((color << 16) & 0xff0000) ); ++} ++ ++DWORD _DIBDRV_ColorToPixel32_BITFIELDS(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ DWORD r,g,b; ++ ++ r = GetRValue(color); ++ g = GetGValue(color); ++ b = GetBValue(color); ++ ++ return PutField32(r, dib->redShift, dib->redLen) | ++ PutField32(g, dib->greenShift, dib->greenLen) | ++ PutField32(b, dib->blueShift, dib->blueLen); ++} ++ ++DWORD _DIBDRV_ColorToPixel24(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ return ( ((color >> 16) & 0xff) | (color & 0xff00) | ((color << 16) & 0xff0000) ); ++} ++ ++DWORD _DIBDRV_ColorToPixel16_RGB(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ return ( ((color >> 19) & 0x001f) | ((color >> 6) & 0x03e0) | ((color << 7) & 0x7c00) ); ++} ++ ++DWORD _DIBDRV_ColorToPixel16_BITFIELDS(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ DWORD r,g,b; ++ ++ r = GetRValue(color); ++ g = GetGValue(color); ++ b = GetBValue(color); ++ ++ return PutField16(r, dib->redShift, dib->redLen) | ++ PutField16(g, dib->greenShift, dib->greenLen) | ++ PutField16(b, dib->blueShift, dib->blueLen); ++} ++ ++DWORD _DIBDRV_ColorToPixelColortable(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ int i, best_index = 0; ++ DWORD r, g, b; ++ DWORD diff, best_diff = 0xffffffff; ++ ++ r = GetRValue(color); ++ g = GetGValue(color); ++ b = GetBValue(color); ++ ++ /* just in case it's being called without color table ++ properly initialized */ ++ if(!dib->colorTableGrabbed) ++ return 0; ++ ++ /* for monochrome bitmaps, color is background ++ if not matching foreground */ ++ if(dib->colorTableSize == 2) ++ { ++ RGBQUAD *fore = dib->colorTable + 1; ++ if(r == fore->rgbRed && g == fore->rgbGreen && b == fore->rgbBlue) ++ return 1; ++ return 0; ++ } ++ ++ for(i = 0; i < dib->colorTableSize; i++) ++ { ++ RGBQUAD *cur = dib->colorTable + i; ++ diff = (r - cur->rgbRed) * (r - cur->rgbRed) ++ + (g - cur->rgbGreen) * (g - cur->rgbGreen) ++ + (b - cur->rgbBlue) * (b - cur->rgbBlue); ++ ++ if(diff == 0) ++ { ++ best_index = i; ++ break; ++ } ++ ++ if(diff < best_diff) ++ { ++ best_diff = diff; ++ best_index = i; ++ } ++ } ++ return best_index; ++} +diff --git a/dlls/winedib.drv/primitives_convert.c b/dlls/winedib.drv/primitives_convert.c +new file mode 100644 +index 0000000..800e3fd +--- /dev/null ++++ b/dlls/winedib.drv/primitives_convert.c +@@ -0,0 +1,559 @@ ++/* ++ * DIB Engine conversions Primitives ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++static inline COLORREF SwapColors(DWORD c) ++{ ++ return ((c & 0x0000ff) << 16) | (c & 0x00ff00) | ((c & 0xff0000) >> 16); ++ ++} ++ ++/* ----------------------------------------------------------------*/ ++/* CONVERT PRIMITIVES */ ++/* converts (part of) line of any DIB format from/to DIB32_RGB one */ ++BOOL _DIBDRV_GetLine32_RGB(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ DWORD *src; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ dwBuf -= startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++#endif ++ ++ src = (DWORD *)((BYTE *)bmp->bits + line * bmp->stride + 4 * startx); ++ for(; width; width--) ++ *dwBuf++ = *src++; ++ return TRUE; ++} ++ ++BOOL _DIBDRV_GetLine32_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ BYTE *bBuf = (BYTE *)buf; ++ DWORD *src; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ bBuf -= 4 * startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++#endif ++ ++ src = (DWORD *)((BYTE *)bmp->bits + line * bmp->stride + 4 * startx); ++ for(; width ; width--) ++ { ++ *bBuf++ = (*src & bmp->blueMask ) >> bmp->blueShift; ++ *bBuf++ = (*src & bmp->greenMask) >> bmp->greenShift; ++ *bBuf++ = (*src & bmp->redMask ) >> bmp->redShift; ++ *bBuf++ = 0x0; ++ src++; ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_GetLine24(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ BYTE *bBuf = (BYTE *)buf; ++ BYTE *src; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ bBuf -= 4 * startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++#endif ++ ++ src = ((BYTE *)bmp->bits + line * bmp->stride + 3 * startx); ++ for(; width ; width--) ++ { ++ *bBuf++ = *src++; ++ *bBuf++ = *src++; ++ *bBuf++ = *src++; ++ *bBuf++ = 0x0; ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_GetLine16_RGB(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ WORD *src; ++ DWORD b; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ dwBuf -= startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++#endif ++ ++ src = (WORD *)((BYTE *)bmp->bits + line * bmp->stride + 2 * startx); ++ for(; width ; width--) ++ { ++ b = *src++; ++ /* 0RRR|RRGG|GGGB|BBBB */ ++ *dwBuf++ = ((b & 0x1f) << 3) | ((b & 0x3e0) << 6) | ((b & 0x7c00) << 9); ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_GetLine16_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ WORD *src; ++ DWORD b; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ dwBuf -= startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++#endif ++ ++ src = (WORD *)((BYTE *)bmp->bits + line * bmp->stride + 2 * startx); ++ for(; width ; width--) ++ { ++ b = *src++; ++ *dwBuf++ =((( b & bmp->blueMask) >> bmp->blueShift ) << ( 8 - bmp->blueLen )) | ++ (((b & bmp->greenMask) >> bmp->greenShift) << (16 - bmp->greenLen)) | ++ (((b & bmp->redMask ) >> bmp->redShift ) << (24 - bmp->redLen )); ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_GetLine8(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ BYTE *src; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ dwBuf -= startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++#endif ++ ++ src = ((BYTE *)bmp->bits + line * bmp->stride + startx); ++ for(; width ; width--) ++ *dwBuf++ = *((DWORD *)bmp->colorTable + *src++); ++ return TRUE; ++} ++ ++BOOL _DIBDRV_GetLine4(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ BYTE *src; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ dwBuf -= startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++ if(!bmp->colorTable) ++ { ++ ERR("Called with uninitialized color table\n"); ++ return FALSE; ++ } ++#endif ++ ++ src = ((BYTE *)bmp->bits + line * bmp->stride + (startx >> 1)); ++ /* if startx is odd, get first nibble */ ++ if(startx & 0x01) ++ { ++ *dwBuf++ = *((DWORD *)bmp->colorTable + (*src++ & 0x0f)); ++ width--; ++ } ++ ++ /* then gets all full image bytes */ ++ for( ; width > 1 ; width -= 2) ++ { ++ *dwBuf++ = *((DWORD *)bmp->colorTable + ((*src >> 4) & 0x0f)); ++ *dwBuf++ = *((DWORD *)bmp->colorTable + (*src++ & 0x0f)); ++ } ++ ++ /* last nibble, if any */ ++ if(width) ++ *dwBuf++ = *((DWORD *)bmp->colorTable + ((*src >> 4) & 0x0f)); ++ return TRUE; ++} ++ ++BOOL _DIBDRV_GetLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ BYTE *src; ++ BYTE b; ++ char i; ++ DWORD pixOn = *((DWORD *)bmp->colorTable + 1); ++ DWORD pixOff = *(DWORD *)bmp->colorTable; ++ ++#ifdef DIBDRV_CHECK_RANGES ++ /* range check */ ++ if(line < 0 || line >= bmp->height) ++ return FALSE; ++ if(startx < 0) ++ { ++ width += startx; ++ dwBuf -= startx; ++ startx = 0; ++ } ++ if(startx + width > bmp->width) ++ width = bmp->width - startx; ++ if(width <= 0) ++ return FALSE; ++#endif ++ ++ src = ((BYTE *)bmp->bits + line * bmp->stride + (startx >> 3)); ++ /* get first partial byte, if any */ ++ startx = (8 - (startx & 0x03)) & 0x03; ++ width -= startx; ++ if(startx) ++ { ++ b = *src++ << (8 - startx); ++ while(startx--) ++ { ++ if(b & 0x80) ++ *dwBuf++ = pixOn; ++ else ++ *dwBuf++ = pixOff; ++ b <<= 1; ++ } ++ } ++ ++ /* then gets full next bytes */ ++ for( ; width > 7 ; width -= 8) ++ { ++ b = *src++; ++ for(i = 0 ; i < 8 ; i++) ++ { ++ if(b & 0x80) ++ *dwBuf++ = pixOn; ++ else ++ *dwBuf++ = pixOff; ++ b <<= 1; ++ } ++ } ++ ++ /* last partial byte, if any */ ++ if(width) ++ { ++ b = *src; ++ while(width--) ++ { ++ if(b & 0x80) ++ *dwBuf++ = pixOn; ++ else ++ *dwBuf++ = pixOff; ++ b <<= 1; ++ } ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine32_RGB(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ DWORD *dst = (DWORD *)((BYTE *)bmp->bits + line * bmp->stride + 4 * startx); ++ for(; width; width--) ++ *dst++ = *dwBuf++; ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine32_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ DWORD *dst = (DWORD *)((BYTE *)bmp->bits + line * bmp->stride + 4 * startx); ++ DWORD c; ++ for(; width; width--) ++ { ++ c = *dwBuf++; ++ *dst++ = ++ ((( c & 0x000000ff) << bmp->blueShift) & bmp->blueMask) | ++ ((((c & 0x0000ff00) >> 8) << bmp->greenShift) & bmp->greenMask) | ++ ((((c & 0x00ff0000) >> 16) << bmp->redShift) & bmp->redMask); ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine24(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ BYTE *dst = ((BYTE *)bmp->bits + line * bmp->stride + 3 * startx); ++ DWORD c; ++ for(; width; width--) ++ { ++ c = *dwBuf++; ++ *dst++ = c & 0x000000ff; ++ *dst++ = (c & 0x0000ff00) >> 8; ++ *dst++ = (c & 0x00ff0000) >> 16; ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine16_RGB(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ WORD *dst = (WORD *)((BYTE *)bmp->bits + line * bmp->stride + 2 * startx); ++ DWORD c; ++ for(; width; width--) ++ { ++ c = *dwBuf++; ++ *dst++ = ++ ((c & 0x000000f8) >> 3) | ++ ((c & 0x0000f800) >> 6) | ++ ((c & 0x00f80000) >> 9); ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine16_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ WORD *dst = (WORD *)((BYTE *)bmp->bits + line * bmp->stride + 2 * startx); ++ DWORD c; ++ for(; width; width--) ++ { ++ c = *dwBuf++; ++ *dst++ = ++ ((( c & 0x000000ff) << bmp->blueShift) & bmp->blueMask) | ++ ((((c & 0x0000ff00) >> 8) << bmp->greenShift) & bmp->greenMask) | ++ ((((c & 0x00ff0000) >> 16) << bmp->redShift) & bmp->redMask); ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine8(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ BYTE *dst = ((BYTE *)bmp->bits + line * bmp->stride + startx); ++ DWORD c; ++ DWORD last_color = 0xffffffff; ++ int last_index = -1; ++ ++ for(; width; width--) ++ { ++ c = *dwBuf++; ++ ++ /* slight optimization, as images often have many ++ consecutive pixels with same color */ ++ if(last_index == -1 || c != last_color) ++ { ++ last_index = bmp->funcs->ColorToPixel(bmp, SwapColors(c)); ++ last_color = c; ++ } ++ *dst++ = last_index; ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine4(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ BYTE *dst = ((BYTE *)bmp->bits + line * bmp->stride + (startx >> 1)); ++ DWORD c; ++ DWORD last_color = 0xffffffff; ++ int last_index = -1; ++ ++ /* if startx is odd, put first nibble */ ++ if(startx & 0x01) ++ { ++ c = *dwBuf++; ++ ++ last_index = bmp->funcs->ColorToPixel(bmp, SwapColors(c)); ++ last_color = c; ++ *dst = (*dst & 0xf0) | last_index; ++ dst++; ++ width--; ++ } ++ ++ /* then gets all full image bytes */ ++ for( ; width > 1 ; width -= 2) ++ { ++ c = *dwBuf++; ++ ++ /* slight optimization, as images often have many ++ consecutive pixels with same color */ ++ if(last_index == -1 || c != last_color) ++ { ++ last_index = bmp->funcs->ColorToPixel(bmp, SwapColors(c)); ++ last_color = c; ++ } ++ *dst = last_index << 4; ++ ++ c = *dwBuf++; ++ ++ /* slight optimization, as images often have many ++ consecutive pixels with same color */ ++ if(last_index == -1 || c != last_color) ++ { ++ last_index = bmp->funcs->ColorToPixel(bmp, SwapColors(c)); ++ last_color = c; ++ } ++ *dst++ |= last_index; ++ } ++ ++ /* last nibble, if any */ ++ if(width) ++ { ++ c = *dwBuf; ++ ++ /* slight optimization, as images often have many ++ consecutive pixels with same color */ ++ if(last_index == -1 || c != last_color) ++ last_index = bmp->funcs->ColorToPixel(bmp, SwapColors(c)); ++ *dst = (*dst & 0x0f) | (last_index << 4); ++ } ++ return TRUE; ++} ++ ++BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) ++{ ++ DWORD *dwBuf = (DWORD *)buf; ++ BYTE *dst = ((BYTE *)bmp->bits + line * bmp->stride + (startx >> 3)); ++ BYTE b, mask; ++ char i; ++ DWORD c; ++ ++ /* get foreground color */ ++ DWORD fore = *((DWORD *)bmp->colorTable + 1) & 0x00ffffff; ++ ++ /* put first partial byte, if any */ ++ startx &= 0x03; ++ mask = 0x80 >> startx; ++ startx = (8 - startx) & 0x03; ++ if(startx) ++ { ++ width -= startx; ++ b = *dst; ++ while(startx--) ++ { ++ c = *dwBuf++ & 0x00ffffff; ++ if(c == 0x00ffffff || c == fore) ++ b |= mask; ++ else ++ b &= !mask; ++ mask >>= 1; ++ } ++ *dst++ = b; ++ } ++ ++ /* then puts full next bytes */ ++ for( ; width > 7 ; width -= 8) ++ { ++ b = 0; ++ mask = 0x80; ++ for(i = 0 ; i < 8 ; i++) ++ { ++ c = *dwBuf++ & 0x00ffffff; ++ if(c == 0x00ffffff || c == fore) ++ b |= mask; ++ mask >>= 1; ++ } ++ *dst++ = b; ++ } ++ ++ /* last partial byte, if any */ ++ if(width) ++ { ++ b = *dst; ++ mask = 0x80; ++ while(width--) ++ { ++ c = *dwBuf++ & 0x00ffffff; ++ if(c == 0x00ffffff || c == fore) ++ b |= mask; ++ else ++ b &= !mask; ++ mask >>= 1; ++ } ++ *dst = b; ++ } ++ return TRUE; ++} +diff --git a/dlls/winedib.drv/primitives_font.c b/dlls/winedib.drv/primitives_font.c +new file mode 100644 +index 0000000..dd1d64b +--- /dev/null ++++ b/dlls/winedib.drv/primitives_font.c +@@ -0,0 +1,310 @@ ++/* ++ * DIB Engine Font Primitives ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* ------------------------------------------------------------*/ ++/* FREETYPE FONT BITMAP BLITTING */ ++void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ DWORD *ptr; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ ptr = (DWORD *)((BYTE *)dib->bits + (dibY * dib->stride) + x * 4); ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ *ptr = c; ++ } ++ buf++; ++ ptr++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_32_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_8(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_4(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} ++ ++void _DIBDRV_freetype_blit_1(DIBDRVPHYSDEV *physDev, int x, int y, FT_Bitmap *bmp) ++{ ++ /* FIXME : MUST BE OPTIMIZED !!! */ ++ ++ DIBDRVBITMAP *dib = &physDev->physBitmap; ++ int bmpX, bmpY; ++ BYTE *buf; ++ int dibX, dibY; ++ int DIBX, DIBY; ++ DWORD c; ++ ++ /* gets DIB limits */ ++ DIBX = dib->width; ++ DIBY = dib->height; ++ ++ /* loop for every pixel in bitmap */ ++ buf = bmp->buffer; ++ for(bmpY = 0, dibY = y; bmpY < bmp->rows; bmpY++, dibY++) ++ { ++ for(bmpX = 0, dibX = x; bmpX < bmp->width; bmpX++, dibX++) ++ { ++ if(dibX < DIBX && dibY < DIBY && dibX > 0 && dibY > 0 && *buf) ++ { ++ c = physDev->textColorTable[*buf]; ++ dib->funcs->SetPixel(dib, dibX, dibY, 0, c); ++ } ++ buf++; ++ } ++ } ++} +diff --git a/dlls/winedib.drv/primitives_line.c b/dlls/winedib.drv/primitives_line.c +new file mode 100644 +index 0000000..af41e2d +--- /dev/null ++++ b/dlls/winedib.drv/primitives_line.c +@@ -0,0 +1,434 @@ ++/* ++ * DIB Engine line Primitives ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* ------------------------------------------------------------*/ ++/* HORIZONTAL LINES */ ++void _DIBDRV_SolidHLine32(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor) ++{ ++ DWORD *ptr; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ for(i = start; i < end; i++) ++ _DIBDRV_rop32(ptr++, and, xor); ++} ++ ++void _DIBDRV_SolidHLine24(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ BYTE and_bytes[3], xor_bytes[3]; ++ ++ and_bytes[0] = and & 0xff; ++ and_bytes[1] = (and >> 8) & 0xff; ++ and_bytes[2] = (and >> 16) & 0xff; ++ xor_bytes[0] = xor & 0xff; ++ xor_bytes[1] = (xor >> 8) & 0xff; ++ xor_bytes[2] = (xor >> 16) & 0xff; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop8(ptr++, and_bytes[0], xor_bytes[0]); ++ _DIBDRV_rop8(ptr++, and_bytes[1], xor_bytes[1]); ++ _DIBDRV_rop8(ptr++, and_bytes[2], xor_bytes[2]); ++ } ++} ++ ++void _DIBDRV_SolidHLine16(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor) ++{ ++ WORD *ptr; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ for(i = start; i < end; i++) ++ _DIBDRV_rop16(ptr++, and, xor); ++} ++ ++void _DIBDRV_SolidHLine8(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ for(i = start; i < end; i++) ++ _DIBDRV_rop8(ptr++, and, xor); ++} ++ ++void _DIBDRV_SolidHLine4(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ BYTE byte_and, byte_xor; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ byte_and = (and & 0xf) | ((and << 4) & 0xf0); ++ byte_xor = (xor & 0xf) | ((xor << 4) & 0xf0); ++ ++ if(start & 1) /* upper nibble untouched */ ++ _DIBDRV_rop8(ptr++, byte_and | 0xf0, byte_xor & 0x0f); ++ ++ for(i = (start + 1) / 2; i < end / 2; i++) ++ _DIBDRV_rop8(ptr++, byte_and, byte_xor); ++ ++ if(end & 1) /* lower nibble untouched */ ++ _DIBDRV_rop8(ptr, byte_and | 0x0f, byte_xor & 0xf0); ++} ++ ++void _DIBDRV_SolidHLine1(DIBDRVBITMAP *dib, int start, int end, int row, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ BYTE byte_and = 0, byte_xor = 0, mask; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ if(and & 1) byte_and = 0xff; ++ if(xor & 1) byte_xor = 0xff; ++ ++ if((start & ~7) == (end & ~7)) /* special case run inside one byte */ ++ { ++ mask = ((1L << ((end & 7) - (start & 7))) - 1) << (8 - (end & 7)); ++ _DIBDRV_rop8(ptr, byte_and | ~mask, byte_xor & mask); ++ return; ++ } ++ ++ if(start & 7) ++ { ++ mask = (1 << (8 - (start & 7))) - 1; ++ _DIBDRV_rop8(ptr++, byte_and | ~mask, byte_xor & mask); ++ } ++ ++ for(i = (start + 7) / 8; i < end / 8; i++) ++ _DIBDRV_rop8(ptr++, byte_and, byte_xor); ++ ++ if(end & 7) ++ { ++ mask = ~((1 << (8 - (end & 7))) - 1); ++ _DIBDRV_rop8(ptr++, byte_and | ~mask, byte_xor & mask); ++ } ++} ++ ++void _DIBDRV_PatternHLine32(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset) ++{ ++ DWORD *ptr; ++ const DWORD *and_ptr = and, *xor_ptr = xor; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ and_ptr += offset; ++ xor_ptr += offset; ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop32(ptr++, *and_ptr++, *xor_ptr++); ++ if(++offset == count) ++ { ++ offset = 0; ++ and_ptr = and; ++ xor_ptr = xor; ++ } ++ } ++} ++ ++void _DIBDRV_PatternHLine24(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset) ++{ ++ BYTE *ptr; ++ const BYTE *and_ptr = and, *xor_ptr = xor; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ and_ptr += offset * 3; ++ xor_ptr += offset * 3; ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop8(ptr++, *and_ptr++, *xor_ptr++); ++ _DIBDRV_rop8(ptr++, *and_ptr++, *xor_ptr++); ++ _DIBDRV_rop8(ptr++, *and_ptr++, *xor_ptr++); ++ if(++offset == count) ++ { ++ offset = 0; ++ and_ptr = and; ++ xor_ptr = xor; ++ } ++ } ++} ++ ++void _DIBDRV_PatternHLine16(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset) ++{ ++ WORD *ptr; ++ const WORD *and_ptr = and, *xor_ptr = xor; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ and_ptr += offset; ++ xor_ptr += offset; ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop16(ptr++, *and_ptr++, *xor_ptr++); ++ if(++offset == count) ++ { ++ offset = 0; ++ and_ptr = and; ++ xor_ptr = xor; ++ } ++ } ++} ++ ++void _DIBDRV_PatternHLine8(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset) ++{ ++ BYTE *ptr; ++ const BYTE *and_ptr = and, *xor_ptr = xor; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ and_ptr += offset; ++ xor_ptr += offset; ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop8(ptr++, *and_ptr++, *xor_ptr++); ++ if(++offset == count) ++ { ++ offset = 0; ++ and_ptr = and; ++ xor_ptr = xor; ++ } ++ } ++} ++ ++void _DIBDRV_PatternHLine4(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset) ++{ ++ BYTE *ptr; ++ const BYTE *and_ptr = and, *xor_ptr = xor; ++ int i; ++ BYTE byte_and, byte_xor; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ and_ptr += offset / 2; ++ xor_ptr += offset / 2; ++ ++ for(i = start; i < end; i++) ++ { ++ if(offset & 1) ++ { ++ byte_and = *and_ptr++ & 0x0f; ++ byte_xor = *xor_ptr++ & 0x0f; ++ } ++ else ++ { ++ byte_and = (*and_ptr & 0xf0) >> 4; ++ byte_xor = (*xor_ptr & 0xf0) >> 4; ++ } ++ ++ if(i & 1) ++ byte_and |= 0xf0; ++ else ++ { ++ byte_and = (byte_and << 4) | 0x0f; ++ byte_xor <<= 4; ++ } ++ ++ _DIBDRV_rop8(ptr, byte_and, byte_xor); ++ ++ if(i & 1) ptr++; ++ ++ if(++offset == count) ++ { ++ offset = 0; ++ and_ptr = and; ++ xor_ptr = xor; ++ } ++ } ++} ++ ++void _DIBDRV_PatternHLine1(DIBDRVBITMAP *dib, int start, int end, int row, const void *and, const void *xor, DWORD count, DWORD offset) ++{ ++ BYTE *ptr; ++ const BYTE *and_ptr = and, *xor_ptr = xor; ++ int i; ++ BYTE byte_and, byte_xor, dst_mask, brush_mask; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, start, row); ++ ++ and_ptr += offset / 8; ++ xor_ptr += offset / 8; ++ ++ for(i = start; i < end; i++) ++ { ++ dst_mask = 1 << (7 - (i & 7)); ++ brush_mask = 1 << (7 - (offset & 7)); ++ ++ byte_and = (*and_ptr & brush_mask) ? 0xff : 0; ++ byte_xor = (*xor_ptr & brush_mask) ? 0xff : 0; ++ ++ byte_and |= ~dst_mask; ++ byte_xor &= dst_mask; ++ ++ _DIBDRV_rop8(ptr, byte_and, byte_xor); ++ ++ if((i & 7) == 7) ptr++; ++ if(++offset == count) ++ { ++ offset = 0; ++ and_ptr = and; ++ xor_ptr = xor; ++ } ++ else if((offset & 7) == 7) ++ { ++ and_ptr++; ++ xor_ptr++; ++ } ++ } ++} ++ ++/* ------------------------------------------------------------*/ ++/* VERTICAL LINES */ ++void _DIBDRV_SolidVLine32(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, col, start); ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop32((DWORD*)ptr, and, xor); ++ ptr += dib->stride; ++ } ++} ++ ++void _DIBDRV_SolidVLine24(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ BYTE and_bytes[3], xor_bytes[3]; ++ ++ and_bytes[0] = and & 0xff; ++ and_bytes[1] = (and >> 8) & 0xff; ++ and_bytes[2] = (and >> 16) & 0xff; ++ xor_bytes[0] = xor & 0xff; ++ xor_bytes[1] = (xor >> 8) & 0xff; ++ xor_bytes[2] = (xor >> 16) & 0xff; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, col, start); ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop8(ptr, and_bytes[0], xor_bytes[0]); ++ _DIBDRV_rop8(ptr + 1, and_bytes[1], xor_bytes[1]); ++ _DIBDRV_rop8(ptr + 2, and_bytes[2], xor_bytes[2]); ++ ptr += dib->stride; ++ } ++} ++ ++void _DIBDRV_SolidVLine16(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, col, start); ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop16((WORD*)ptr, and, xor); ++ ptr += dib->stride; ++ } ++} ++ ++void _DIBDRV_SolidVLine8(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, col, start); ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop8(ptr, and, xor); ++ ptr += dib->stride; ++ } ++} ++ ++void _DIBDRV_SolidVLine4(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ BYTE byte_and, byte_xor; ++ ++ if(col & 1) /* upper nibble untouched */ ++ { ++ byte_and = (and & 0xf) | 0xf0; ++ byte_xor = (xor & 0xf); ++ } ++ else ++ { ++ byte_and = ((and << 4) & 0xf0) | 0x0f; ++ byte_xor = ((xor << 4) & 0xf0); ++ } ++ ++ ptr = dib->funcs->GetPixelPointer(dib, col, start); ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop8(ptr, byte_and, byte_xor); ++ ptr += dib->stride; ++ } ++} ++ ++void _DIBDRV_SolidVLine1(DIBDRVBITMAP *dib, int col, int start, int end, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ int i; ++ BYTE byte_and = 0, byte_xor = 0, mask; ++ ++ if(and & 1) byte_and = 0xff; ++ if(xor & 1) byte_xor = 0xff; ++ ++ mask = 1 << (7 - (col & 7)); ++ ++ byte_and |= ~mask; ++ byte_xor &= mask; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, col, start); ++ ++ for(i = start; i < end; i++) ++ { ++ _DIBDRV_rop8(ptr, byte_and, byte_xor); ++ ptr += dib->stride; ++ } ++} +diff --git a/dlls/winedib.drv/primitives_pixel.c b/dlls/winedib.drv/primitives_pixel.c +new file mode 100644 +index 0000000..ca68cf1 +--- /dev/null ++++ b/dlls/winedib.drv/primitives_pixel.c +@@ -0,0 +1,244 @@ ++/* ++ * DIB Engine pixel Primitives ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++ ++/* ------------------------------------------------------------*/ ++/* BITFIELD HELPERS */ ++static DWORD GetField32 (DWORD pixel, int shift, int len) ++{ ++ pixel = pixel & (((1 << (len)) - 1) << shift); ++ pixel = pixel << (32 - (shift + len)) >> 24; ++ return pixel; ++} ++ ++static WORD GetField16 (WORD pixel, int shift, int len) ++{ ++ FIXME("TODO\n"); ++ return 0; ++} ++ ++ ++ ++/* ------------------------------------------------------------*/ ++/* PIXEL POINTER READING */ ++void *_DIBDRV_GetPixelPointer32(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->bits; ++ ++ ptr += (y * dib->stride); ++ ++ ptr += x * 4; ++ return ptr; ++} ++ ++void *_DIBDRV_GetPixelPointer24(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->bits; ++ ++ ptr += (y * dib->stride); ++ ++ ptr += x * 3; ++ return ptr; ++} ++ ++void *_DIBDRV_GetPixelPointer16(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->bits; ++ ++ ptr += (y * dib->stride); ++ ++ ptr += x * 2; ++ return ptr; ++} ++ ++void *_DIBDRV_GetPixelPointer8(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->bits; ++ ++ ptr += (y * dib->stride); ++ ++ ptr += x; ++ return ptr; ++} ++ ++void *_DIBDRV_GetPixelPointer4(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->bits; ++ ++ ptr += (y * dib->stride); ++ ++ ptr += x / 2; ++ return ptr; ++} ++ ++void *_DIBDRV_GetPixelPointer1(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->bits; ++ ++ ptr += (y * dib->stride); ++ ++ ptr += x / 8; ++ return ptr; ++} ++ ++/* ------------------------------------------------------------*/ ++/* PIXEL WRITING */ ++void _DIBDRV_SetPixel32(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor) ++{ ++ DWORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ _DIBDRV_rop32(ptr, and, xor); ++} ++ ++void _DIBDRV_SetPixel24(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor) ++{ ++ BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ _DIBDRV_rop8(ptr, and & 0xff, xor & 0xff); ++ _DIBDRV_rop8(ptr + 1, (and >> 8) & 0xff, (xor >> 8) & 0xff); ++ _DIBDRV_rop8(ptr + 2, (and >> 16) & 0xff, (xor >> 16) & 0xff); ++} ++ ++void _DIBDRV_SetPixel16(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor) ++{ ++ WORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ _DIBDRV_rop16(ptr, and, xor); ++} ++ ++void _DIBDRV_SetPixel8(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor) ++{ ++ BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ _DIBDRV_rop8(ptr, and, xor); ++} ++ ++void _DIBDRV_SetPixel4(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor) ++{ ++ BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ BYTE byte_and, byte_xor; ++ ++ if(x & 1) /* upper nibble untouched */ ++ { ++ byte_and = (and & 0xf) | 0xf0; ++ byte_xor = (xor & 0xf); ++ } ++ else ++ { ++ byte_and = ((and << 4) & 0xf0) | 0x0f; ++ byte_xor = ((xor << 4) & 0xf0); ++ } ++ ++ _DIBDRV_rop8(ptr, byte_and, byte_xor); ++} ++ ++void _DIBDRV_SetPixel1(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor) ++{ ++ BYTE *ptr; ++ BYTE byte_and = 0, byte_xor = 0, mask; ++ ++ if(and & 1) byte_and = 0xff; ++ if(xor & 1) byte_xor = 0xff; ++ ++ mask = 1 << (7 - (x & 7)); ++ ++ byte_and |= ~mask; ++ byte_xor &= mask; ++ ++ ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ ++ _DIBDRV_rop8(ptr, byte_and, byte_xor); ++} ++ ++/* ------------------------------------------------------------*/ ++/* PIXEL READING */ ++DWORD _DIBDRV_GetPixel32_RGB(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ DWORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ return *ptr; ++} ++ ++DWORD _DIBDRV_GetPixel32_BITFIELDS(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ DWORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ ++ return GetField32(*ptr, dib->redShift, dib->redLen) << 16 | ++ GetField32(*ptr, dib->greenShift, dib->greenLen) << 8 | ++ GetField32(*ptr, dib->blueShift, dib->blueLen); ++} ++ ++DWORD _DIBDRV_GetPixel24(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ return (ptr[0] << 16) | (ptr[1] << 8) | ptr[2]; ++} ++ ++DWORD _DIBDRV_GetPixel16_RGB(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ WORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ return ((*ptr & 0x7c00) << 9) | ((*ptr & 0x03e0) << 6) | ((*ptr & 0x001f) << 3); ++} ++ ++DWORD _DIBDRV_GetPixel16_BITFIELDS(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ WORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ ++ return GetField16(*ptr, dib->redShift, dib->redLen) << 16 | ++ GetField16(*ptr, dib->greenShift, dib->greenLen) << 8 | ++ GetField16(*ptr, dib->blueShift, dib->blueLen); ++} ++ ++DWORD _DIBDRV_GetPixel8(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ RGBQUAD *color = dib->colorTable + *ptr; ++ return (color->rgbRed << 16) | (color->rgbGreen << 8) | color->rgbBlue; ++} ++ ++DWORD _DIBDRV_GetPixel4(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y), pix; ++ RGBQUAD *color; ++ ++ if(x & 1) ++ pix = *ptr & 0x0f; ++ else ++ pix = *ptr >> 4; ++ ++ color = dib->colorTable + pix; ++ return (color->rgbRed << 16) | (color->rgbGreen << 8) | color->rgbBlue; ++} ++ ++DWORD _DIBDRV_GetPixel1(const DIBDRVBITMAP *dib, int x, int y) ++{ ++ BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y), pix; ++ RGBQUAD *color; ++ ++ pix = *ptr; ++ ++ pix >>= (7 - (x & 7)); ++ pix &= 1; ++ ++ color = dib->colorTable + pix; ++ return (color->rgbRed << 16) | (color->rgbGreen << 8) | color->rgbBlue; ++} +diff --git a/dlls/winedib.drv/primitives_rop2.c b/dlls/winedib.drv/primitives_rop2.c +new file mode 100644 +index 0000000..b23e919 +--- /dev/null ++++ b/dlls/winedib.drv/primitives_rop2.c +@@ -0,0 +1,112 @@ ++/* ++ * DIB Engine ROP2 Primitives ++ * ++ * Copyright 2008 Huw Davies ++ * Copyright 2008 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* ------------------------------------------------------------*/ ++/* BASIC ROP HELPER */ ++/* ++ * ++ * Decompose the 16 ROP2s into an expression of the form ++ * ++ * D = (D & A) ^ X ++ * ++ * Where A and X depend only on P (and so can be precomputed). ++ * ++ * A X ++ * ++ * R2_BLACK 0 0 0 ++ * R2_NOTMERGEPEN ~(D | P) ~P ~P ++ * R2_MASKNOTPEN ~P & D ~P 0 ++ * R2_NOTCOPYPEN ~P 0 ~P ++ * R2_MASKPENNOT P & ~D P P ++ * R2_NOT ~D 1 1 ++ * R2_XORPEN P ^ D 1 P ++ * R2_NOTMASKPEN ~(P & D) P 1 ++ * R2_MASKPEN P & D P 0 ++ * R2_NOTXORPEN ~(P ^ D) 1 ~P ++ * R2_NOP D 1 0 ++ * R2_MERGENOTPEN ~P | D P ~P ++ * R2_COPYPEN P 0 P ++ * R2_MERGEPENNOT P | ~D ~P 1 ++ * R2_MERGEPEN P | D ~P P ++ * R2_WHITE 1 0 1 ++ * ++ */ ++ ++/* A = (P & A1) | (~P & A2) */ ++#define ZERO {0, 0} ++#define ONE {0xffffffff, 0xffffffff} ++#define P {0xffffffff, 0} ++#define NOT_P {0, 0xffffffff} ++ ++static const DWORD rop2_and_array[16][2] = ++{ ++ ZERO, NOT_P, NOT_P, ZERO, ++ P, ONE, ONE, P, ++ P, ONE, ONE, P, ++ ZERO, NOT_P, NOT_P, ZERO ++}; ++ ++/* X = (P & X1) | (~P & X2) */ ++static const DWORD rop2_xor_array[16][2] = ++{ ++ ZERO, NOT_P, ZERO, NOT_P, ++ P, ONE, P, ONE, ++ ZERO, NOT_P, ZERO, NOT_P, ++ P, ONE, P, ONE ++}; ++ ++#undef NOT_P ++#undef P ++#undef ONE ++#undef ZERO ++ ++void _DIBDRV_CalcAndXorMasks(INT rop, DWORD color, DWORD *and, DWORD *xor) ++{ ++ /* NB The ROP2 codes start at one and the arrays are zero-based */ ++ rop = (rop - 1) & 0x0f; ++ *and = (color & rop2_and_array[rop][0]) | ((~color) & rop2_and_array[rop][1]); ++ *xor = (color & rop2_xor_array[rop][0]) | ((~color) & rop2_xor_array[rop][1]); ++} ++ ++/* ------------------------------------------------------------*/ ++/* ROP PIXEL FUNCTIONS */ ++ ++inline void _DIBDRV_rop32(DWORD *ptr, DWORD and, DWORD xor) ++{ ++ *ptr = (*ptr & and) ^ xor; ++} ++ ++inline void _DIBDRV_rop16(WORD *ptr, WORD and, WORD xor) ++{ ++ *ptr = (*ptr & and) ^ xor; ++} ++ ++inline void _DIBDRV_rop8(BYTE *ptr, BYTE and, BYTE xor) ++{ ++ *ptr = (*ptr & and) ^ xor; ++} +diff --git a/dlls/winedib.drv/primitives_rop3.c b/dlls/winedib.drv/primitives_rop3.c +new file mode 100644 +index 0000000..398258b +--- /dev/null ++++ b/dlls/winedib.drv/primitives_rop3.c +@@ -0,0 +1,786 @@ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/* the ROP3 operations ++ this is a BIG case block; beware that some ++ commons ROP3 operations will be optimized ++ from inside blt routines */ ++DWORD _DIBDRV_ROP3(DWORD p, DWORD s, DWORD d, BYTE rop) ++{ ++ switch(rop) ++ { ++ case 0x00: /* 0 BLACKNESS */ ++ return 0; ++ ++ case 0x01: /* DPSoon */ ++ return (~(p | s | d)) & 0x00ffffff; ++ ++ case 0x02: /* DPSona */ ++ return (d & ~(p | s)) & 0x00ffffff; ++ ++ case 0x03: /* PSon */ ++ return (~(p | s)) & 0x00ffffff; ++ ++ case 0x04: /* SDPona */ ++ return (s & ~(d | p)) & 0x00ffffff; ++ ++ case 0x05: /* DPon */ ++ return (~(d | p)) & 0x00ffffff; ++ ++ case 0x06: /* PDSxnon */ ++ return (~(p | ~(d ^ s))) & 0x00ffffff; ++ ++ case 0x07: /* PDSaon */ ++ return (~((d & s) | p) ) & 0x00ffffff; ++ ++ case 0x08: /* SDPnaa */ ++ return (d & ~p & s) & 0x00ffffff; ++ ++ case 0x09: /* PDSxon */ ++ return (~((d ^ s) | p)) & 0x00ffffff; ++ ++ case 0x0A: /* DPna */ ++ return (~p & d) & 0x00ffffff; ++ ++ case 0x0B: /* PSDnaon */ ++ return (~((~d & s) | p)) & 0x00ffffff; ++ ++ case 0x0C: /* SPna */ ++ return (~p & s) & 0x00ffffff; ++ ++ case 0x0D: /* PDSnaon */ ++ return (~((~s & d) | p)) & 0x00ffffff; ++ ++ case 0x0E: /* PDSonon */ ++ return (~(~(d | s) | p)) & 0x00ffffff; ++ ++ case 0x0F: /* Pn */ ++ return (~p) & 0x00ffffff; ++ ++ case 0x10: /* PDSona */ ++ return (~(d | s) & p) & 0x00ffffff; ++ ++ case 0x11: /* DSon NOTSRCERASE */ ++ return (~(d | s)) & 0x00ffffff; ++ ++ case 0x12: /* SDPxnon */ ++ return (~(~(d ^ p) | s)) & 0x00ffffff; ++ ++ case 0x13: /* SDPaon */ ++ return (~((d & p) | s)) & 0x00ffffff; ++ ++ case 0x14: /* DPSxnon */ ++ return (~(~(p ^ s) | d)) & 0x00ffffff; ++ ++ case 0x15: /* DPSaon */ ++ return (~((p & s) | d)) & 0x00ffffff; ++ ++ case 0x16: /* PSDPSanaxx */ ++ return (((~(p & s) & d) ^ s) ^ p) & 0x00ffffff; ++ ++ case 0x17: /* SSPxDSxaxn */ ++ return (~(((d ^ s) & (s ^ p)) ^ s)) & 0x00ffffff; ++ ++ case 0x18: /* SPxPDxa */ ++ return ((s ^ p) & (p ^ d)) & 0x00ffffff; ++ ++ case 0x19: /* SDPSanaxn */ ++ return (~((~(p & s) & d) ^ s)) & 0x00ffffff; ++ ++ case 0x1A: /* PDSPaox */ ++ return (((s & p) | d) ^ p) & 0x00ffffff; ++ ++ case 0x1B: /* SDPSxaxn */ ++ return (~(((p ^ s) & d) ^ s)) & 0x00ffffff; ++ ++ case 0x1C: /* PSDPaox */ ++ return (((d & p) | s) ^ p) & 0x00ffffff; ++ ++ case 0x1D: /* DSPDxaxn */ ++ return (~(((p ^ d) & s) ^ d)) & 0x00ffffff; ++ ++ case 0x1E: /* PDSox */ ++ return ((d | s) ^ p) & 0x00ffffff; ++ ++ case 0x1F: /* PDSoan */ ++ return (~((d | s) & p)) & 0x00ffffff; ++ ++ case 0x20: /* DPSnaa */ ++ return (p & ~s & d) & 0x00ffffff; ++ ++ case 0x21: /* SDPxon */ ++ return (~((d ^ p) | s)) & 0x00ffffff; ++ ++ case 0x22: /* DSna */ ++ return (d & ~s) & 0x00ffffff; ++ ++ case 0x23: /* SPDnaon */ ++ return (~((p & ~d) | s)) & 0x00ffffff; ++ ++ case 0x24: /* SPxDSxa */ ++ return ((s ^ p) & (d ^ s)) & 0x00ffffff; ++ ++ case 0x25: /* PDSPanaxn */ ++ return (~((~(s & p) & d) ^ p)) & 0x00ffffff; ++ ++ case 0x26: /* SDPSaox */ ++ return (((p & s) | d) ^ s) & 0x00ffffff; ++ ++ case 0x27: /* SDPSxnox */ ++ return ((~(p ^ s) | d) ^ s) & 0x00ffffff; ++ ++ case 0x28: /* DPSxa */ ++ return ((p ^ s) & d) & 0x00ffffff; ++ ++ case 0x29: /* PSDPSaoxxn */ ++ return (~((((p & s) | d) ^ s) ^ p)) & 0x00ffffff; ++ ++ case 0x2A: /* DPSana */ ++ return (~(p & s) & d) & 0x00ffffff; ++ ++ case 0x2B: /* SSPxPDxaxn */ ++ return (~(((s ^ p) & (p ^ d)) ^ s)) & 0x00ffffff; ++ ++ case 0x2C: /* SPDSoax */ ++ return (((d | s) & p) ^ s) & 0x00ffffff; ++ ++ case 0x2D: /* PSDnox */ ++ return ((s | ~d) ^ p) & 0x00ffffff; ++ ++ case 0x2E: /* PSDPxox */ ++ return (((d ^ p) | s) ^ p) & 0x00ffffff; ++ ++ case 0x2F: /* PSDnoan */ ++ return (~((s | ~d) & p)) & 0x00ffffff; ++ ++ case 0x30: /* PSna */ ++ return (p & ~s) & 0x00ffffff; ++ ++ case 0x31: /* SDPnaon */ ++ return (~((d & ~p) | s)) & 0x00ffffff; ++ ++ case 0x32: /* SDPSoox */ ++ return ((p | s | d) ^ s) & 0x00ffffff; ++ ++ case 0x33: /* Sn NOTSRCCOPY */ ++ return (~s) & 0x00ffffff; ++ ++ case 0x34: /* SPDSaox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x35: /* SPDSxnox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x36: /* SDPox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x37: /* SDPoan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x38: /* PSDPoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x39: /* SPDnox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x3A: /* SPDSxox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x3B: /* SPDnoan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x3C: /* PSx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x3D: /* SPDSonox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x3E: /* SPDSnaox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x3F: /* PSan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x40: /* PSDnaa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x41: /* DPSxon */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x42: /* SDxPDxa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x43: /* SPDSanaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x44: /* SDna SRCERASE */ ++ return (s & ~d) & 0x00ffffff; ++ ++ case 0x45: /* DPSnaon */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x46: /* DSPDaox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x47: /* PSDPxaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x48: /* SDPxa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x49: /* PDSPDaoxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x4A: /* DPSDoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x4B: /* PDSnox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x4C: /* SDPana */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x4D: /* SSPxDSxoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x4E: /* PDSPxox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x4F: /* PDSnoan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x50: /* PDna */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x51: /* DSPnaon */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x52: /* DPSDaox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x53: /* SPDSxaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x54: /* DPSonon */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x55: /* Dn DSTINVERT */ ++ return (~d) & 0x00ffffff; ++ ++ case 0x56: /* DPSox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x57: /* DPSoan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x58: /* PDSPoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x59: /* DPSnox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x5A: /* DPx PATINVERT */ ++ return (d ^ p) & 0x00ffffff; ++ ++ case 0x5B: /* DPSDonox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x5C: /* DPSDxox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x5D: /* DPSnoan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x5E: /* DPSDnaox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x5F: /* DPan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x60: /* PDSxa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x61: /* DSPDSaoxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x62: /* DSPDoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x63: /* SDPnox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x64: /* SDPSoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x65: /* DSPnox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x66: /* DSx SRCINVERT */ ++ return (d ^ s) & 0x00ffffff; ++ ++ case 0x67: /* SDPSonox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x68: /* DSPDSonoxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x69: /* PDSxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x6A: /* DPSax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x6B: /* PSDPSoaxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x6C: /* SDPax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x6D: /* PDSPDoaxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x6E: /* SDPSnoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x6F: /* PDSxnan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x70: /* PDSana */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x71: /* SSDxPDxaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x72: /* SDPSxox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x73: /* SDPnoan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x74: /* DSPDxox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x75: /* DSPnoan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x76: /* SDPSnaox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x77: /* DSan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x78: /* PDSax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x79: /* DSPDSoaxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x7A: /* DPSDnoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x7B: /* SDPxnan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x7C: /* SPDSnoax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x7D: /* DPSxnan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x7E: /* SPxDSxo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x7F: /* DPSaan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x80: /* DPSaa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x81: /* SPxDSxon */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x82: /* DPSxna */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x83: /* SPDSnoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x84: /* SDPxna */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x85: /* PDSPnoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x86: /* DSPDSoaxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x87: /* PDSaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x88: /* DSa SRCAND */ ++ return (d & s) & 0x00ffffff; ++ ++ case 0x89: /* SDPSnaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x8A: /* DSPnoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x8B: /* DSPDxoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x8C: /* SDPnoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x8D: /* SDPSxoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x8E: /* SSDxPDxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x8F: /* PDSanan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x90: /* PDSxna */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x91: /* SDPSnoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x92: /* DPSDPoaxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x93: /* SPDaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x94: /* PSDPSoaxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x95: /* DPSaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x96: /* DPSxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x97: /* PSDPSonoxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x98: /* SDPSonoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x99: /* DSxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x9A: /* DPSnax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x9B: /* SDPSoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x9C: /* SPDnax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x9D: /* DSPDoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x9E: /* DSPDSaoxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0x9F: /* PDSxan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA0: /* DPa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA1: /* PDSPnaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA2: /* DPSnoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA3: /* DPSDxoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA4: /* PDSPonoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA5: /* PDxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA6: /* DSPnax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA7: /* PDSPoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA8: /* DPSoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xA9: /* DPSoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xAA: /* D */ ++ return (d) & 0x00ffffff; ++ ++ case 0xAB: /* DPSono */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xAC: /* SPDSxax */ ++ return (s ^ (p & (d ^ s))) & 0x00ffffff; ++ ++ case 0xAD: /* DPSDaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xAE: /* DSPnao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xAF: /* DPno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB0: /* PDSnoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB1: /* PDSPxoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB2: /* SSPxDSxox */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB3: /* SDPanan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB4: /* PSDnax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB5: /* DPSDoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB6: /* DPSDPaoxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB7: /* SDPxan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB8: /* PSDPxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xB9: /* DSPDaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xBA: /* DPSnao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xBB: /* DSno MERGEPAINT */ ++ return (d | ~s) & 0x00ffffff; ++ ++ case 0xBC: /* SPDSanax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xBD: /* SDxPDxan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xBE: /* DPSxo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xBF: /* DPSano */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC0: /* PSa MERGECOPY */ ++ return (p & s) & 0x00ffffff; ++ ++ case 0xC1: /* SPDSnaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC2: /* SPDSonoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC3: /* PSxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC4: /* SPDnoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC5: /* SPDSxoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC6: /* SDPnax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC7: /* PSDPoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC8: /* SDPoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xC9: /* SPDoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xCA: /* DPSDxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xCB: /* SPDSaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ default: ++ case 0xCC: /* S SRCCOPY */ ++ return (s) & 0x00ffffff; ++ ++ case 0xCD: /* SDPono */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xCE: /* SDPnao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xCF: /* SPno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD0: /* PSDnoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD1: /* PSDPxoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD2: /* PDSnax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD3: /* SPDSoaxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD4: /* SSPxPDxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD5: /* DPSanan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD6: /* PSDPSaoxx */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD7: /* DPSxan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD8: /* PDSPxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xD9: /* SDPSaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xDA: /* DPSDanax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xDB: /* SPxDSxan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xDC: /* SPDnao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xDD: /* SDno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xDE: /* SDPxo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xDF: /* SDPano */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE0: /* PDSoa */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE1: /* PDSoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE2: /* DSPDxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE3: /* PSDPaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE4: /* SDPSxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE5: /* PDSPaoxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE6: /* SDPSanax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE7: /* SPxPDxan */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE8: /* SSPxDSxax */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xE9: /* DSPDSanaxxn */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xEA: /* DPSao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xEB: /* DPSxno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xEC: /* SDPao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xED: /* SDPxno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xEE: /* DSo SRCPAINT */ ++ return (d | s) & 0x00ffffff; ++ ++ case 0xEF: /* SDPnoo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF0: /* P PATCOPY */ ++ return (p) & 0x00ffffff; ++ ++ case 0xF1: /* PDSono */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF2: /* PDSnao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF3: /* PSno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF4: /* PSDnao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF5: /* PDno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF6: /* PDSxo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF7: /* PDSano */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF8: /* PDSao */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xF9: /* PDSxno */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xFA: /* DPo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xFB: /* DPSnoo PATPAINT */ ++ return (p | ~s | d) & 0x00ffffff; ++ ++ case 0xFC: /* PSo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xFD: /* PSDnoo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xFE: /* DPSoo */ ++ return (0x123456) & 0x00ffffff; ++ ++ case 0xFF: /* 1 WHITENESS */ ++ return 0x00ffffff; ++ ++ } /* switch */ ++} +diff --git a/dlls/winedib.drv/text.c b/dlls/winedib.drv/text.c +index 0176011..e2cea0c 100644 +--- a/dlls/winedib.drv/text.c ++++ b/dlls/winedib.drv/text.c +@@ -25,6 +25,19 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++/* converts font sizes from Word space to Device space */ ++static void FontSizes_ws2ds(DIBDRVPHYSDEV *physDev, int *w, int *h) ++{ ++ POINT pts[2]; ++ pts[0].x = 0; ++ pts[0].y = 0; ++ pts[1].x = abs(*w); ++ pts[1].y = abs(*h); ++ LPtoDP(physDev->hdc, pts, 2); ++ *w = pts[1].x - pts[0].x; ++ *h = pts[1].y - pts[0].y; ++} ++ + /*********************************************************************** + * DIBDRV_ExtTextOut + */ +@@ -32,17 +45,163 @@ BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + const RECT *lprect, LPCWSTR wstr, UINT count, + const INT *lpDx ) + { ++ /* FIXME : TODO many, many stuffs... just trivial text support by now */ ++ + BOOL res; ++ FT_Face face; ++ FT_UInt glyph_index; ++ INT n; ++ INT error; ++ LOGFONTW lf; ++ int w, h; ++ LPCWSTR wstrPnt; ++ ++ FT_Glyph glyph; ++ FT_BitmapGlyph bitmap; ++ double cosEsc, sinEsc; ++ FT_Matrix matrix; ++ FT_Vector start; ++ int dx, dy; + +- TRACE("physDev:%p, x:%d, y:%d, flags:%x, lprect:%p, wstr:%s, count:%d, lpDx:%p\n", +- physDev, x, y, flags, lprect, debugstr_w(wstr), count, lpDx); ++ ++ MAYBE(TRACE("physDev:%p, x:%d, y:%d, flags:%x, lprect:%p, wstr:%s, count:%d, lpDx:%p\n", ++ physDev, x, y, flags, lprect, debugstr_w(wstr), count, lpDx)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pExtTextOut(physDev->X11PhysDev, x, y, flags, lprect, +- wstr, count, lpDx); ++ ++ face = physDev->face; ++ if(!face) ++ { ++ ERR("FreeType face is null\n"); ++ res = FALSE; ++ goto fin; ++ } ++ ++ /* outputs the string in case it is given by glyph indexes ++ make locating it in logs much easier */ ++ if(TRACE_ON(dibdrv) && flags & ETO_GLYPH_INDEX) ++ { ++ WCHAR a = 'A'; ++ WCHAR *str = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WCHAR)*(count+1)); ++ int delta = a - pFT_Get_Char_Index( face, a); ++ int i; ++ memcpy(str, wstr, sizeof(WCHAR)*count); ++ for(i = 0; str[i] && i < count; i++) ++ str[i] += delta; ++ TRACE("String: '%s'\n", debugstr_w(str)); ++ HeapFree(GetProcessHeap(), 0, str); ++ } ++ ++ /* gets font data, etc */ ++ GetObjectW(GetCurrentObject(physDev->hdc, OBJ_FONT), sizeof(lf), &lf); ++ ++ /* convert sizes to device space */ ++ w = lf.lfWidth; h = lf.lfHeight; ++ FontSizes_ws2ds(physDev, &w, &h); ++ ++ /* if opaque, paint the font background */ ++/* ++ if(flags | ETO_OPAQUE) ++ { ++ int iLine; ++ for(iLine = lprect->top; iLine < lprect->bottom; iLine++) ++ physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, ++ lprect->left, lprect->right-1, iLine, 0, physDev->backgroundColor); ++ } ++*/ ++ /* sets character pixel size */ ++ error = pFT_Set_Pixel_Sizes( ++ face, ++ MulDiv(w, 96, DIBDRV_GetDeviceCaps(physDev, LOGPIXELSX)), ++ MulDiv(h, 96, DIBDRV_GetDeviceCaps(physDev, LOGPIXELSY)) ++ ); ++ if(error) ++ ERR("Couldn't set char size to (%d,%d)\n", lf.lfWidth, lf.lfHeight); ++ ++ /* transformation matrix and vector */ ++ start.x = 0; ++ start.y = 0; ++ if(lf.lfEscapement != 0) ++ { ++ cosEsc = cos(lf.lfEscapement * M_PI / 1800); ++ sinEsc = sin(lf.lfEscapement * M_PI / 1800); ++ } ++ else ++ { ++ cosEsc = 1; ++ sinEsc = 0; ++ } ++ matrix.xx = (FT_Fixed)( cosEsc * 0x10000L ); ++ matrix.xy = (FT_Fixed)(-sinEsc * 0x10000L ); ++ matrix.yx = (FT_Fixed)( sinEsc * 0x10000L ); ++ matrix.yy = (FT_Fixed)( cosEsc * 0x10000L ); ++ ++ /* outputs characters one by one */ ++ wstrPnt = wstr; ++ for ( n = 0; n < count; n++ ) ++ { ++ /* retrieve glyph index from character code */ ++ if(flags & ETO_GLYPH_INDEX) ++ glyph_index = *wstrPnt++; ++ else ++ glyph_index = pFT_Get_Char_Index( face, *wstrPnt++); ++ ++ /* load glyph image into the slot (erase previous one) */ ++ error = pFT_Load_Glyph( face, glyph_index, FT_LOAD_DEFAULT ); ++ if(error) ++ { ++ ERR("Couldn't load glyph at index %d\n", glyph_index); ++ /* ignore errors */ ++ continue; ++ } ++ error = pFT_Get_Glyph(face->glyph, &glyph); ++ if ( error ) ++ { ++ FIXME("Couldn't get glyph\n"); ++ continue; ++ } ++ ++ /* apply transformation to glyph */ ++ if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) ++ pFT_Glyph_Transform(glyph, &matrix, &start ); ++ ++ /* gets advance BEFORE transforming... */ ++ dx = glyph->advance.x; ++ dy = glyph->advance.y; ++ ++ /* convert to an anti-aliased bitmap, if needed */ ++ if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) ++ { ++ error = pFT_Glyph_To_Bitmap( ++ &glyph, ++ FT_RENDER_MODE_NORMAL, ++ 0, /* no additional translation */ ++ 1 /* destroy copy in "image" */ ++ ); ++ ++ /* ignore errors */ ++ if ( error ) ++ { ++ FIXME("Couldn't render glyph\n"); ++ pFT_Done_Glyph(glyph); ++ continue; ++ } ++ } ++ ++ /* now, draw to our target surface */ ++ bitmap = (FT_BitmapGlyph)glyph; ++ physDev->physBitmap.funcs->FreetypeBlit(physDev, x+bitmap->left, y-bitmap->top, &bitmap->bitmap); ++ ++ /* increment pen position */ ++ x += dx>>16; ++ y -= dy>>16; ++ ++ pFT_Done_Glyph(glyph); ++ ++ res = TRUE; ++ } + } + else + { +@@ -50,6 +209,7 @@ BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + res = _DIBDRV_GetDisplayDriver()->pExtTextOut(physDev->X11PhysDev, x, y, flags, lprect, + wstr, count, lpDx); + } ++fin: + return res; + } + +@@ -61,15 +221,14 @@ BOOL DIBDRV_GetTextExtentExPoint( DIBDRVPHYSDEV *physDev, LPCWSTR str, INT count + { + BOOL res; + +- TRACE("physDev:%p, str:%s, count:%d, maxExt:%d, lpnFit:%p, alpDx:%p, size:%p\n", +- physDev, debugstr_w(str), count, maxExt, lpnFit, alpDx, size); ++ MAYBE(TRACE("physDev:%p, str:%s, count:%d, maxExt:%d, lpnFit:%p, alpDx:%p, size:%p\n", ++ physDev, debugstr_w(str), count, maxExt, lpnFit, alpDx, size)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pGetTextExtentExPoint(physDev->X11PhysDev, str, count, maxExt, +- lpnFit, alpDx, size); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { +diff --git a/dlls/winedib.drv/video.c b/dlls/winedib.drv/video.c +index 730e62a..9892d69 100644 +--- a/dlls/winedib.drv/video.c ++++ b/dlls/winedib.drv/video.c +@@ -32,7 +32,7 @@ BOOL DIBDRV_GetDeviceGammaRamp( DIBDRVPHYSDEV *physDev, LPVOID ramp ) + { + BOOL res; + +- TRACE("physDev:%p, ramp:%p\n", physDev, ramp); ++ MAYBE(TRACE("physDev:%p, ramp:%p\n", physDev, ramp)); + + if(physDev->hasDIB) + { +@@ -55,13 +55,13 @@ BOOL DIBDRV_SetDeviceGammaRamp( DIBDRVPHYSDEV *physDev, LPVOID ramp ) + { + BOOL res; + +- TRACE("physDev:%p, ramp:%p\n", physDev, ramp); ++ MAYBE(TRACE("physDev:%p, ramp:%p\n", physDev, ramp)); + + if(physDev->hasDIB) + { + /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); +- res = _DIBDRV_GetDisplayDriver()->pSetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++ ONCE(FIXME("STUB\n")); ++ res = TRUE; + } + else + { --- wine1.2-1.1.43.orig/debian/patches/dibeng-0006.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0006.patch @@ -0,0 +1,560 @@ +DIB Engine: Add clipping on xxxBlt and AlphaBlend + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/bitblt.c | 332 +++++++++++++++++++++++++++++++++++++------ + dlls/winedib.drv/clipping.c | 42 +++++ + dlls/winedib.drv/dc.c | 14 ++ + dlls/winedib.drv/dibdrv.h | 6 + + 4 files changed, 341 insertions(+), 53 deletions(-) + + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index c0227a0..05c9392 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -33,6 +33,26 @@ static inline void intSwap(int *a, int *b) + *b = tmp; + } + ++static inline void setRect(RECT *r, int x1, int y1, int x2, int y2) ++{ ++ r->left = x1; ++ r->top = y1; ++ r->right = x2; ++ r->bottom = y2; ++} ++ ++static inline void setPoint(POINT *p, int x, int y) ++{ ++ p->x = x; ++ p->y = y; ++} ++ ++static inline void setSize(SIZE *sz, int cx, int cy) ++{ ++ sz->cx = cx; ++ sz->cy = cy; ++} ++ + /* clips a source and destination areas to their respective clip rectangles + returning both source and dest modified; result is TRUE if clipping + leads to a non null rectangle, FALSE otherwise */ +@@ -130,13 +150,158 @@ static BOOL BitBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *sz, RECT*srcClip, RECT* + leads to a non null rectangle, FALSE otherwise */ + static BOOL StretchBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *szSrc, SIZE *szDst, RECT*srcClip, RECT*dstClip) + { +- ONCE(FIXME("TO DO\n")); ++ int xs1, ys1, xs2, ys2; ++ int xsc1, ysc1, xsc2, ysc2; ++ int xd1, yd1, xd2, yd2; ++ int xdc1, ydc1, xdc2, ydc2; ++ int ws, hs, wd, hd, dx, dy; ++ int mulh, divh, mulv, divv; ++ ++ /* extract sizes */ ++ ws = szSrc->cx; hs = szSrc->cy; ++ wd = szDst->cx; hd = szDst->cy; ++ ++ /* if sizes null or negative, just return false */ ++ /* FIXME : add support for mirror stretch */ ++ if(ws <= 0 || hs <= 0 || wd <= 0 || hd <= 0) ++ return FALSE; ++ ++ /* stores scaling factors from source rect to dest one */ ++ mulh = wd; divh = ws; ++ mulv = hd; divv = hs; ++ ++ /* extract dest area data */ ++ xd1 = pd->x; ++ yd1 = pd->y; ++ xd2 = xd1 + wd; ++ yd2 = yd1 + hd; ++ ++ /* extract source data */ ++ xs1 = ps->x; ++ ys1 = ps->y; ++ xs2 = xs1 + ws; ++ ys2 = ys1 + hs; ++ ++ /* if source clip area is not null, do first clipping on it */ ++ if(srcClip) ++ { ++ /* extract source clipping area */ ++ xsc1 = srcClip->left; ++ ysc1 = srcClip->top; ++ xsc2 = srcClip->right; ++ ysc2 = srcClip->bottom; ++ ++ /* order clip area rectangle points */ ++ if(xsc1 > xsc2) intSwap(&xsc1, &xsc2); ++ if(ysc1 > ysc2) intSwap(&ysc1, &ysc2); ++ ++ /* clip on source clipping start point */ ++ if(xs1 < xsc1) { dx = xsc1 - xs1; ws -= dx; xd1 += MulDiv(dx, mulh, divh); xs1 = xsc1; } ++ if(ys1 < ysc1) { dy = ysc1 - ys1; hs -= dy; yd1 += MulDiv(dy, mulv, divv); ys1 = ysc1; } ++ ++ /* clip on source clipping end point */ ++ if(xs2 > xsc2) { dx = xs2 - xsc2; ws -= dx; xd2 -= MulDiv(dx, mulh, divh); xs2 = xsc2; } ++ if(ys2 > ysc2) { dy = ys2 - ysc2; hs -= dy; yd2 -= MulDiv(dy, mulv, divv); ys2 = ysc2; } ++ ++ /* if already zero area, return false */ ++ if(ws <= 0 || hs <= 0) ++ return FALSE; ++ wd = xd2 - xd1; ++ hd = yd2 - yd1; ++ } ++ /* now do clipping on destination area */ + ++ if(dstClip) ++ { ++ /* extract destination clipping area */ ++ xdc1 = dstClip->left; ++ ydc1 = dstClip->top; ++ xdc2 = dstClip->right; ++ ydc2 = dstClip->bottom; ++ ++ /* order clip area rectangle points */ ++ if(xdc1 > xdc2) intSwap(&xdc1, &xdc2); ++ if(ydc1 > ydc2) intSwap(&ydc1, &ydc2); ++ ++ /* clip on dest clipping start point */ ++ if(xd1 < xdc1) { dx = xdc1 - xd1; wd -= dx; xs1 += MulDiv(dx, divh, mulh); xd1 = xdc1; } ++ if(yd1 < ydc1) { dy = ydc1 - yd1; hd -= dy; ys1 += MulDiv(dy, divv, mulv); yd1 = ydc1; } ++ ++ /* clip on dest clipping end point */ ++ if(xd2 > xdc2) { dx = xd2 - xdc2; wd -= dx; xs2 -= MulDiv(dx, divh, mulh); xd2 = xdc2; } ++ if(yd2 > ydc2) { dy = yd2 - ydc2; hd -= dy; ys2 -= MulDiv(dy, divv, mulv); yd2 = ydc2; } ++ ++ /* if already zero area, return false */ ++ if(wd <= 0 || hd <= 0) ++ return FALSE; ++ ++ ws = xs2 - xs1; ++ hs = ys2 - ys1; ++ } ++ ++ /* sets clipped/translated points and sizes and returns TRUE */ ++ ps->x = xs1; ps->y = ys1; ++ pd->x = xd1; pd->y = yd1; ++ szSrc->cx = ws; szSrc->cy = hs; ++ szDst->cx = wd; szDst->cy = hd; ++ + return TRUE; + + } + + /*********************************************************************** ++ * _DIBDRV_InternalAlphaBlend ++ */ ++BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst, ++ DIBDRVPHYSDEV *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, ++ BLENDFUNCTION blendfn) ++{ ++ BOOL res; ++ POINT pd, ps; ++ SIZE szSrc, szDst; ++ int iRec; ++ RECT dstClip, srcClip; ++ ++ /* first clip on physical DC sizes */ ++ setPoint(&pd, xDst, yDst); ++ setPoint(&ps, xSrc, ySrc); ++ setSize(&szDst, widthDst, heightDst); ++ setSize(&szSrc, widthSrc, heightSrc); ++ setRect(&dstClip, 0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height); ++ if(physDevSrc) ++ { ++ setRect(&srcClip, 0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height); ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); ++ } ++ else ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); ++ if(!res) ++ return FALSE; ++ xDst = pd.x; yDst = pd.y; ++ xSrc = ps.x; ySrc = ps.y; ++ widthDst = szDst.cx; heightDst = szDst.cy; ++ widthSrc = szSrc.cx; heightSrc = szSrc.cy; ++ ++ /* then, do blitting for each dest clip area (no clipping on source) */ ++ res = FALSE; ++ for(iRec = 0; iRec < physDevDst->regionRectCount; iRec++) ++ { ++ RECT *r = physDevDst->regionRects + iRec; ++ setRect(&dstClip, r->left, r->top, r->right, r->bottom); ++ setPoint(&pd, xDst, yDst); ++ setPoint(&ps, xSrc, ySrc); ++ setSize(&szDst, widthDst, heightDst); ++ setSize(&szSrc, widthSrc, heightSrc); ++ if(!StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip)) ++ continue; ++ if(physDevDst->physBitmap.funcs->AlphaBlend(physDevDst, pd.x, pd.y, szDst.cx, szDst.cy, ++ physDevSrc, ps.x, ps.y, szSrc.cx, szSrc.cy, blendfn)) ++ res = TRUE; ++ } ++ return res; ++} ++ ++/*********************************************************************** + * DIBDRV_AlphaBlend + */ + BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst, +@@ -145,6 +310,11 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + { + BOOL res; + ++ POINT pd = {xDst, yDst}; ++ POINT ps = {xSrc, ySrc}; ++ SIZE szDst = {widthDst, heightDst}; ++ SIZE szSrc = {widthSrc, heightSrc}; ++ + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", + physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", + xDst, yDst, widthDst, heightDst, +@@ -177,16 +347,24 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + { + /* DIB section selected in dest DC, use DIB Engine */ + MAYBE(TRACE("Blending DIB->DIB\n")); +- res = physDevDst->physBitmap.funcs->AlphaBlend(physDevDst, xDst, yDst, widthDst, heightDst, +- physDevSrc, xSrc, ySrc, widthSrc, heightSrc, blendfn); ++ res = _DIBDRV_InternalAlphaBlend(physDevDst, xDst, yDst, widthDst, heightDst, ++ physDevSrc, xSrc, ySrc, widthSrc, heightSrc, blendfn); + } + else + { + /* DDB selected on dest DC -- must double-convert */ + HBITMAP tmpDIB, stock; + HDC tmpDC; ++ RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; + MAYBE(TRACE("Blending DIB->DDB\n")); + ++ /* clip blit area */ ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, 0); ++ if(!res) ++ goto fin; ++ xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; ++ xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; ++ + /* converts dest DDB onto a temporary DIB -- just the needed part */ + tmpDIB = _DIBDRV_ConvertDevDDBtoDIB(physDevDst->hdc, physDevSrc->hdc, xDst, yDst, widthDst, heightDst); + if(!tmpDIB) +@@ -232,8 +410,55 @@ fin: + } + + /*********************************************************************** +- * DIBDRV_BitBlt ++ * _DIBDRV_InternalBitBlt + */ ++BOOL _DIBDRV_InternalBitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop ) ++{ ++ BOOL res; ++ POINT pd, ps; ++ SIZE sz; ++ int iRec; ++ RECT dstClip, srcClip; ++ ++ /* first clip on physical DC sizes */ ++ setPoint(&pd, xDst, yDst); ++ setPoint(&ps, xSrc, ySrc); ++ setSize(&sz, width, height); ++ setRect(&dstClip, 0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height); ++ if(physDevSrc) ++ { ++ setRect(&srcClip, 0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height); ++ res = BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, &dstClip); ++ } ++ else ++ res = BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); ++ if(!res) ++ return FALSE; ++ xDst = pd.x; yDst = pd.y; ++ xSrc = ps.x; ySrc = ps.y; ++ width = sz.cx; height = sz.cy; ++ ++ /* then, do blitting for each dest clip area (no clipping on source) */ ++ res = FALSE; ++ for(iRec = 0; iRec < physDevDst->regionRectCount; iRec++) ++ { ++ RECT *r = physDevDst->regionRects + iRec; ++ setRect(&dstClip, r->left, r->top, r->right, r->bottom); ++ setPoint(&pd, xDst, yDst); ++ setPoint(&ps, xSrc, ySrc); ++ setSize(&sz, width, height); ++ if(!BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip)) ++ continue; ++ if(physDevDst->physBitmap.funcs->BitBlt(physDevDst, pd.x, pd.y, sz.cx, sz.cy, physDevSrc, ps.x, ps.y, rop)) ++ res = TRUE; ++ } ++ return res; ++} ++ ++/*********************************************************************** ++ * DIBDRV_BitBlt */ + BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + INT width, INT height, DIBDRVPHYSDEV *physDevSrc, + INT xSrc, INT ySrc, DWORD rop ) +@@ -254,26 +479,13 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + if(physDevDst->hasDIB) + { + /* DIB section selected in dest DC, use DIB Engine */ +- + /* clip blit area */ + RECT dstClip = {0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height}; + + if(!physDevSrc || physDevSrc->hasDIB) + { +- /* clip blit area */ +- if(physDevSrc) +- { +- RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; +- res = BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, &dstClip); +- } +- else +- res = BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); +- if(!res) +- goto noBlt2; +- xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; +- + /* source is null or has a DIB, no need to convert anyting */ +- res = physDevDst->physBitmap.funcs->BitBlt(physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, ySrc, rop); ++ res = _DIBDRV_InternalBitBlt(physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, ySrc, rop); + } + else + { +@@ -309,8 +521,7 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + goto noBlt1; + } + SelectObject(physDevSrc->hdc, dib); +- res = physDevDst->physBitmap.funcs->BitBlt(physDevDst, xDst, yDst, width, height, +- physDevSrc, xSrc, 0, rop); ++ res = _DIBDRV_InternalBitBlt(physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, 0, rop); + SelectObject(physDevSrc->hdc, ddb); + DeleteObject(dib); + noBlt1: +@@ -410,6 +621,58 @@ noBlt3: + } + + /*********************************************************************** ++ * _DIBDRV_InternalStretchBlt ++ */ ++BOOL _DIBDRV_InternalStretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT widthDst, INT heightDst, DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, int widthSrc, int heightSrc, DWORD rop ) ++{ ++ BOOL res; ++ POINT pd, ps; ++ SIZE szSrc, szDst; ++ int iRec; ++ RECT dstClip, srcClip; ++ ++ /* first clip on physical DC sizes */ ++ setPoint(&pd, xDst, yDst); ++ setPoint(&ps, xSrc, ySrc); ++ setSize(&szDst, widthDst, heightDst); ++ setSize(&szSrc, widthSrc, heightSrc); ++ setRect(&dstClip, 0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height); ++ if(physDevSrc) ++ { ++ setRect(&srcClip, 0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height); ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); ++ } ++ else ++ res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); ++ if(!res) ++ return FALSE; ++ xDst = pd.x; yDst = pd.y; ++ xSrc = ps.x; ySrc = ps.y; ++ widthDst = szDst.cx; heightDst = szDst.cy; ++ widthSrc = szSrc.cx; heightSrc = szSrc.cy; ++ ++ /* then, do blitting for each dest clip area (no clipping on source) */ ++ res = FALSE; ++ for(iRec = 0; iRec < physDevDst->regionRectCount; iRec++) ++ { ++ RECT *r = physDevDst->regionRects + iRec; ++ setRect(&dstClip, r->left, r->top, r->right, r->bottom); ++ setPoint(&pd, xDst, yDst); ++ setPoint(&ps, xSrc, ySrc); ++ setSize(&szDst, widthDst, heightDst); ++ setSize(&szSrc, widthSrc, heightSrc); ++ if(!StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip)) ++ continue; ++ if(physDevDst->physBitmap.funcs->StretchBlt(physDevDst, pd.x, pd.y, szDst.cx, szDst.cy, ++ physDevSrc, ps.x, ps.y, szSrc.cx, szSrc.cy, rop)) ++ res = TRUE; ++ } ++ return res; ++} ++ ++/*********************************************************************** + * DIBDRV_StretchBlt + */ + BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, +@@ -439,38 +702,15 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + { + /* DIB section selected in dest DC, use DIB Engine */ + +- /* clip blit area */ +- RECT dstClip = {0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height}; +- + if(!physDevSrc || physDevSrc->hasDIB) + { +- /* clip blit area */ +- if(physDevSrc) +- { +- RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; +- res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, &dstClip); +- } +- else +- res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); +- if(!res) +- goto noBlt2; +- xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; +- xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; +- + /* source is null or has a DIB, no need to convert anyting */ +- res = physDevDst->physBitmap.funcs->StretchBlt(physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc, rop); ++ res = _DIBDRV_InternalStretchBlt(physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc, rop); + } + else + { + /* source is a DDB, must convert it to DIB */ + +- /* don't clip on source */ +- res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); +- if(!res) +- goto noBlt2; +- xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; +- xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; +- + /* we must differentiate from 2 cases : + 1) source DC is a memory DC + 2) source DC is a device DC */ +@@ -495,8 +735,8 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + goto noBlt1; + } + SelectObject(physDevSrc->hdc, dib); +- res = physDevDst->physBitmap.funcs->StretchBlt(physDevDst, xDst, yDst, widthDst, heightDst, +- physDevSrc, xSrc, 0, widthSrc, heightSrc, rop); ++ res = _DIBDRV_InternalStretchBlt(physDevDst, xDst, yDst, widthDst, heightDst, ++ physDevSrc, xSrc, 0, widthSrc, heightSrc, rop); + SelectObject(physDevSrc->hdc, ddb); + DeleteObject(dib); + noBlt1: +diff --git a/dlls/winedib.drv/clipping.c b/dlls/winedib.drv/clipping.c +index 81dec25..ed10b92 100644 +--- a/dlls/winedib.drv/clipping.c ++++ b/dlls/winedib.drv/clipping.c +@@ -25,22 +25,50 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + +- + /*********************************************************************** + * DIBDRV_SetDeviceClipping + */ + void DIBDRV_SetDeviceClipping( DIBDRVPHYSDEV *physDev, HRGN vis_rgn, HRGN clip_rgn ) + { ++ RGNDATA *data; ++ DWORD size; ++ int iRect; ++ + MAYBE(TRACE("physDev:%p, vis_rgn:%p, clip_rgn:%p\n", physDev, vis_rgn, clip_rgn)); + +- if(physDev->hasDIB) ++ /* sets the region for X11 driver anyways... we may change bitmap later on */ ++ _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++ ++ /* then we set the region for DIB engine, same reason */ ++ ++ CombineRgn( physDev->region, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); ++ ++ /* get region rectangles */ ++ if(!(size = GetRegionData(physDev->region, 0, NULL))) ++ return; ++ data = HeapAlloc(GetProcessHeap(), 0, size); ++ if (!GetRegionData(physDev->region, size, data)) + { +- /* DIB section selected in, use DIB Engine */ +- ONCE(FIXME("STUB\n")); ++ HeapFree( GetProcessHeap(), 0, data ); ++ return; + } +- else ++ ++ /* frees any previous regions rectangles in DC */ ++ if(physDev->regionData) ++ HeapFree(GetProcessHeap(), 0, physDev->regionData); ++ ++ /* sets the rectangles on physDev */ ++ physDev->regionData = data; ++ physDev->regionRects = (RECT *)data->Buffer; ++ physDev->regionRectCount = data->rdh.nCount; ++ ++ if(TRACE_ON(dibdrv)) + { +- /* DDB selected in, use X11 driver */ +- _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++ TRACE("Region dump : %d rectangles\n", physDev->regionRectCount); ++ for(iRect = 0; iRect < physDev->regionRectCount; iRect++) ++ { ++ RECT *r = physDev->regionRects + iRect; ++ TRACE("Rect #%03d, x1:%4d, y1:%4d, x2:%4d, y2:%4d\n", iRect, r->left, r->top, r->right, r->bottom); ++ } + } + } +diff --git a/dlls/winedib.drv/dc.c b/dlls/winedib.drv/dc.c +index 6184677..8212d42 100644 +--- a/dlls/winedib.drv/dc.c ++++ b/dlls/winedib.drv/dc.c +@@ -165,6 +165,12 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + + /* clears pen and brush */ + physDev->rop2 = R2_COPYPEN; ++ ++ /* clipping region */ ++ physDev->region = CreateRectRgn( 0, 0, 0, 0 ); ++ physDev->regionData = NULL; ++ physDev->regionRects = NULL; ++ physDev->regionRectCount = 0; + + physDev->backgroundColor = 0; + _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->backgroundAnd, &physDev->backgroundXor); +@@ -228,6 +234,14 @@ BOOL DIBDRV_DeleteDC( DIBDRVPHYSDEV *physDev ) + physDev->brushAnds = NULL; + physDev->brushXors = NULL; + ++ /* frees clipping region */ ++ DeleteObject(physDev->region); ++ if(physDev->regionData) ++ HeapFree(GetProcessHeap(), 0, physDev->regionData); ++ physDev->regionData = NULL; ++ physDev->regionRects = NULL; ++ physDev->regionRectCount = 0; ++ + /* frees DIB Engine device */ + HeapFree(GetProcessHeap(), 0, physDev); + +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index c801d96..b0f128e 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -204,6 +204,12 @@ typedef struct _DIBDRVPHYSDEV + + /* active ROP2 */ + INT rop2; ++ ++ /* clipping region and its rectangles */ ++ HRGN region; ++ RGNDATA *regionData; ++ RECT *regionRects; ++ int regionRectCount; + + /* background color and active ROP2 precalculated + AND and XOR values for it */ --- wine1.2-1.1.43.orig/debian/patches/dibeng-0002.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0002.patch @@ -0,0 +1,1601 @@ +DIB Engine: initial pass-through implementation + +From: Massimo Del Fedele + + +--- + + configure.ac | 1 + dlls/winedib.drv/Makefile.in | 28 +++++ + dlls/winedib.drv/bitblt.c | 80 +++++++++++++ + dlls/winedib.drv/bitmap.c | 77 ++++++++++++ + dlls/winedib.drv/clipping.c | 36 ++++++ + dlls/winedib.drv/dc.c | 104 +++++++++++++++++ + dlls/winedib.drv/dib.c | 92 +++++++++++++++ + dlls/winedib.drv/dibdrv.h | 84 ++++++++++++++ + dlls/winedib.drv/dibdrv_main.c | 50 ++++++++ + dlls/winedib.drv/font.c | 83 +++++++++++++ + dlls/winedib.drv/graphics.c | 230 +++++++++++++++++++++++++++++++++++++ + dlls/winedib.drv/opengl.c | 221 ++++++++++++++++++++++++++++++++++++ + dlls/winedib.drv/palette.c | 90 ++++++++++++++ + dlls/winedib.drv/pen_brush.c | 98 ++++++++++++++++ + dlls/winedib.drv/text.c | 55 +++++++++ + dlls/winedib.drv/video.c | 48 ++++++++ + dlls/winedib.drv/winedib.drv.spec | 74 ++++++++++++ + 17 files changed, 1451 insertions(+), 0 deletions(-) + create mode 100644 dlls/winedib.drv/Makefile.in + create mode 100644 dlls/winedib.drv/bitblt.c + create mode 100644 dlls/winedib.drv/bitmap.c + create mode 100644 dlls/winedib.drv/clipping.c + create mode 100644 dlls/winedib.drv/dc.c + create mode 100644 dlls/winedib.drv/dib.c + create mode 100644 dlls/winedib.drv/dibdrv.h + create mode 100644 dlls/winedib.drv/dibdrv_main.c + create mode 100644 dlls/winedib.drv/font.c + create mode 100644 dlls/winedib.drv/graphics.c + create mode 100644 dlls/winedib.drv/opengl.c + create mode 100644 dlls/winedib.drv/palette.c + create mode 100644 dlls/winedib.drv/pen_brush.c + create mode 100644 dlls/winedib.drv/text.c + create mode 100644 dlls/winedib.drv/video.c + create mode 100644 dlls/winedib.drv/winedib.drv.spec + + +diff --git a/configure.ac b/configure.ac +index 31c7170..659e64a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2608,6 +2608,7 @@ WINE_CONFIG_DLL(wineaudioio.drv) + WINE_CONFIG_DLL(winecoreaudio.drv) + WINE_CONFIG_LIB(winecrt0) + WINE_CONFIG_DLL(wined3d,,[wined3d]) ++WINE_CONFIG_DLL(winedib.drv) + WINE_CONFIG_DLL(wineesd.drv) + WINE_CONFIG_DLL(winejack.drv) + WINE_CONFIG_DLL(winejoystick.drv) +diff --git a/dlls/winedib.drv/Makefile.in b/dlls/winedib.drv/Makefile.in +new file mode 100644 +index 0000000..66ad14f +--- /dev/null ++++ b/dlls/winedib.drv/Makefile.in +@@ -0,0 +1,28 @@ ++TOPSRCDIR = @top_srcdir@ ++TOPOBJDIR = ../.. ++SRCDIR = @srcdir@ ++VPATH = @srcdir@ ++MODULE = winedib.drv ++IMPORTS = user32 gdi32 advapi32 kernel32 ntdll ++EXTRAINCL = @FREETYPEINCL@ @FONTCONFIGINCL@ ++EXTRALIBS = @XLIB@ ++ ++C_SRCS = \ ++ bitblt.c \ ++ bitmap.c \ ++ clipping.c \ ++ dc.c \ ++ dib.c \ ++ dibdrv_main.c \ ++ driver.c \ ++ font.c \ ++ graphics.c \ ++ opengl.c \ ++ palette.c \ ++ pen_brush.c \ ++ text.c \ ++ video.c ++ ++@MAKE_DLL_RULES@ ++ ++@DEPENDENCIES@ # everything below this line is overwritten by make depend +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +new file mode 100644 +index 0000000..fa9e2ec +--- /dev/null ++++ b/dlls/winedib.drv/bitblt.c +@@ -0,0 +1,80 @@ ++/* ++ * DIBDRV bit-blit operations ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV_AlphaBlend ++ */ ++BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst, ++ DIBDRVPHYSDEV *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, ++ BLENDFUNCTION blendfn) ++{ ++ TRACE("physDevDst:%p, xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", ++ physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, ++ blendfn); ++} ++ ++/*********************************************************************** ++ * DIBDRV_BitBlt ++ */ ++BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT width, INT height, DIBDRVPHYSDEV *physDevSrc, ++ INT xSrc, INT ySrc, DWORD rop ) ++{ ++ TRACE("physDevDst:%p, xDst:%d, yDst:%d, width:%d, height:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, rop:%08x\n", ++ physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, ySrc, rop); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc->X11PhysDev, xSrc, ySrc, rop); ++} ++ ++/*********************************************************************** ++ * DIBDRV_StretchBlt ++ */ ++BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, ++ INT widthDst, INT heightDst, ++ DIBDRVPHYSDEV *physDevSrc, INT xSrc, INT ySrc, ++ INT widthSrc, INT heightSrc, DWORD rop ) ++{ ++ TRACE("physDevDst:%p, xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d, rop:%8x\n", ++ physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc, rop); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); ++} ++ ++/*********************************************************************** ++ * DIBDRV_PatBlt ++ */ ++BOOL DIBDRV_PatBlt( DIBDRVPHYSDEV *physDev, INT left, INT top, INT width, INT height, DWORD rop ) ++{ ++ TRACE("physDev:%p, left:%d, top:%d, width:%d, height:%d, rop:%06x\n", physDev, left, top, width, height, rop); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pPatBlt(physDev->X11PhysDev, left, top, width, height, rop); ++} +diff --git a/dlls/winedib.drv/bitmap.c b/dlls/winedib.drv/bitmap.c +new file mode 100644 +index 0000000..09cca69 +--- /dev/null ++++ b/dlls/winedib.drv/bitmap.c +@@ -0,0 +1,77 @@ ++/* ++ * DIB driver bitmap objects ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++ ++/**************************************************************************** ++ * SelectBitmap (WINEDIB.DRV.@) ++ */ ++HBITMAP DIBDRV_SelectBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap ) ++{ ++ TRACE("physDev:%p, hbitmap:%p\n", physDev, hbitmap); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSelectBitmap(physDev->X11PhysDev, hbitmap); ++} ++ ++/**************************************************************************** ++ * DIBDRV_CreateBitmap ++ */ ++BOOL DIBDRV_CreateBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, LPVOID bmBits ) ++{ ++ TRACE("physDev:%p, hbitmap:%p, bmBits:%p\n", physDev, hbitmap, bmBits); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pCreateBitmap(physDev->X11PhysDev, hbitmap, bmBits); ++} ++ ++/*********************************************************************** ++ * DIBDRV_DeleteBitmap ++ */ ++BOOL DIBDRV_DeleteBitmap( HBITMAP hbitmap ) ++{ ++ TRACE("hbitmap:%p\n", hbitmap); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pDeleteBitmap(hbitmap); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetBitmapBits ++ */ ++LONG DIBDRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count ) ++{ ++ TRACE("hbitmap:%p, buffer:%p, count:%d\n", hbitmap, buffer, count); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetBitmapBits(hbitmap, buffer, count); ++} ++ ++/****************************************************************************** ++ * DIBDRV_SetBitmapBits ++ */ ++LONG DIBDRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) ++{ ++ TRACE("hbitmap:%p, bits:%p, count:%d\n", hbitmap, bits, count); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetBitmapBits(hbitmap, bits, count); ++} +diff --git a/dlls/winedib.drv/clipping.c b/dlls/winedib.drv/clipping.c +new file mode 100644 +index 0000000..b3c18ef +--- /dev/null ++++ b/dlls/winedib.drv/clipping.c +@@ -0,0 +1,36 @@ ++/* ++ * DIBDRV clipping functions ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV_SetDeviceClipping ++ */ ++void DIBDRV_SetDeviceClipping( DIBDRVPHYSDEV *physDev, HRGN vis_rgn, HRGN clip_rgn ) ++{ ++ TRACE("physDev:%p, vis_rgn:%p, clip_rgn:%p\n", physDev, vis_rgn, clip_rgn); ++ ONCE(FIXME("stub\n")); ++ _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++} +diff --git a/dlls/winedib.drv/dc.c b/dlls/winedib.drv/dc.c +new file mode 100644 +index 0000000..e0ffb4d +--- /dev/null ++++ b/dlls/winedib.drv/dc.c +@@ -0,0 +1,104 @@ ++/* ++ * DIB driver initialization functions ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/********************************************************************** ++ * DIBDRV_CreateDC ++ */ ++BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR device, ++ LPCWSTR output, const DEVMODEW* initData ) ++{ ++ DIBDRVPHYSDEV *physDev; ++ PHYSDEV X11PhysDev; ++ ++ TRACE("hdc:%p, pdev:%p, driver:%s, device:%s, output:%s, initData:%p\n", ++ hdc, pdev, debugstr_w(driver), debugstr_w(device), debugstr_w(output), initData); ++ ++ /* allocates physical device */ ++ physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DIBDRVPHYSDEV) ); ++ if (!physDev) ++ return FALSE; ++ ++ /* creates X11 physical device */ ++ if(!_DIBDRV_GetDisplayDriver()->pCreateDC(hdc, &X11PhysDev, driver, device, output, initData)) ++ { ++ HeapFree(GetProcessHeap(), 0, physDev); ++ return FALSE; ++ } ++ ++ /* sets X11 Device pointer in DIB Engine device */ ++ physDev->X11PhysDev = X11PhysDev; ++ ++ /* sets the result value and returns */ ++ *pdev = physDev; ++ ++ ONCE(FIXME("stub\n")); ++ return TRUE; ++} ++ ++/********************************************************************** ++ * DIBDRV_DeleteDC ++ */ ++BOOL DIBDRV_DeleteDC( DIBDRVPHYSDEV *physDev ) ++{ ++ BOOL res; ++ ++ TRACE("physDev:%p\n", physDev); ++ ++ /* frees X11 device */ ++ res = _DIBDRV_GetDisplayDriver()->pDeleteDC(physDev->X11PhysDev); ++ physDev->X11PhysDev = NULL; ++ ++ /* frees DIB Engine device */ ++ HeapFree(GetProcessHeap(), 0, physDev); ++ ++ ONCE(FIXME("stub\n")); ++ return res; ++} ++ ++/********************************************************************** ++ * DIBDRV_ExtEscape ++ */ ++INT DIBDRV_ExtEscape( DIBDRVPHYSDEV *physDev, INT escape, INT in_count, LPCVOID in_data, ++ INT out_count, LPVOID out_data ) ++{ ++ TRACE("physDev:%p, escape:%d, in_count:%d, in_data:%p, out_count:%d, out_data:%p\n", ++ physDev, escape, in_count, in_data, out_count, out_data); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pExtEscape(physDev->X11PhysDev, escape, in_count, in_data, out_count, out_data); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetDeviceCaps ++ */ ++INT DIBDRV_GetDeviceCaps( DIBDRVPHYSDEV *physDev, INT cap ) ++{ ++ TRACE("physDev:%p, cap:%d\n", physDev, cap); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetDeviceCaps(physDev->X11PhysDev, cap); ++} +diff --git a/dlls/winedib.drv/dib.c b/dlls/winedib.drv/dib.c +new file mode 100644 +index 0000000..47dce0e +--- /dev/null ++++ b/dlls/winedib.drv/dib.c +@@ -0,0 +1,92 @@ ++/* ++ * DIBDRV device-independent bitmaps ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV_CreateDIBSection ++ */ ++HBITMAP DIBDRV_CreateDIBSection( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, ++ const BITMAPINFO *bmi, UINT usage ) ++{ ++ TRACE("physDev:%p, hbitmap:%p, bmi:%p, usage:%d\n", physDev, hbitmap, bmi, usage); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pCreateDIBSection(physDev->X11PhysDev, hbitmap, bmi, usage); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetDIBits ++*/ ++INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, ++ UINT lines, LPCVOID bits, const BITMAPINFO *bmi, UINT coloruse ) ++{ ++ TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", ++ physDev, hbitmap, startscan, lines, bits, bmi, coloruse); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, bmi, coloruse); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SetDIBColorTable ++ */ ++UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, ++ const RGBQUAD *colors ) ++{ ++ TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetDIBColorTable(physDev->X11PhysDev, start, count, colors); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SetDIBits ++ */ ++INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, ++ UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) ++{ ++ TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", ++ physDev, hbitmap, startscan, lines, bits, info, coloruse); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse); ++} ++ ++/************************************************************************* ++ * DIBDRV_SetDIBitsToDevice ++ */ ++INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDest, INT yDest, DWORD cx, ++ DWORD cy, INT xSrc, INT ySrc, ++ UINT startscan, UINT lines, LPCVOID bits, ++ const BITMAPINFO *info, UINT coloruse ) ++{ ++ TRACE("physDev:%p, xDest:%d, yDest:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", ++ physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc, ++ startscan, lines, bits, info, coloruse); ++} +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +new file mode 100644 +index 0000000..6dfba06 +--- /dev/null ++++ b/dlls/winedib.drv/dibdrv.h +@@ -0,0 +1,84 @@ ++/* ++ * DIB driver private definitions ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#ifndef __WINE_DIBDRV_H ++#define __WINE_DIBDRV_H ++ ++#include ++#include ++#include ++ ++#include "windef.h" ++#include "winbase.h" ++#include "winerror.h" ++#include "wingdi.h" ++#include "wine/list.h" ++#include "wine/library.h" ++#include "wine/debug.h" ++#include "wingdi.h" ++#include "winreg.h" ++#include "wine/winbase16.h" /* GlobalLock16 */ ++ ++/* data structures needed to access opaque pointers ++ * defined in gdi32.h */ ++#include "dibdrv_gdi32.h" ++ ++/* provide a way to make debugging output appear ++ only once. Usage example: ++ ONCE(FIXME("Some message\n")); */ ++#define ONCE(x) \ ++{ \ ++ static BOOL done = FALSE; \ ++ if(!done) \ ++ { \ ++ done = TRUE; \ ++ x; \ ++ } \ ++} ++ ++ ++/* DIB driver physical device */ ++typedef struct _DIBDRVPHYSDEV ++{ ++ /* X11 driver physical device */ ++ PHYSDEV X11PhysDev; ++ ++ /* active ROP2 */ ++ INT rop2; ++ ++} DIBDRVPHYSDEV; ++ ++ ++/* ********************************************************************* ++ * DISPLAY DRIVER ACCESS FUNCTIONS ++ * ********************************************************************/ ++ ++/* LoadDisplayDriver ++ * Loads display driver - partially grabbed from gdi32 */ ++DC_FUNCTIONS *_DIBDRV_LoadDisplayDriver(void); ++ ++/* FreeDisplayDriver ++ Frees resources allocated by Display driver */ ++void _DIBDRV_FreeDisplayDriver(void); ++ ++/* GetDisplayDriver ++ Gets a pointer to display drives'function table */ ++inline DC_FUNCTIONS *_DIBDRV_GetDisplayDriver(void); ++ ++#endif /* __WINE_DIBDRV_H */ +diff --git a/dlls/winedib.drv/dibdrv_main.c b/dlls/winedib.drv/dibdrv_main.c +new file mode 100644 +index 0000000..28429d2 +--- /dev/null ++++ b/dlls/winedib.drv/dibdrv_main.c +@@ -0,0 +1,50 @@ ++/* ++ * DIBDRV initialization code ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV initialization routine ++ */ ++BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) ++{ ++ BOOL ret = TRUE; ++ ++ switch(reason) ++ { ++ case DLL_PROCESS_ATTACH: ++ /* Loads display driver */ ++ _DIBDRV_LoadDisplayDriver(); ++ break; ++ case DLL_THREAD_DETACH: ++ /* do thread detach */ ++ break; ++ case DLL_PROCESS_DETACH: ++ /* unloads display driver */ ++ _DIBDRV_FreeDisplayDriver(); ++ break; ++ } ++ return ret; ++} +diff --git a/dlls/winedib.drv/font.c b/dlls/winedib.drv/font.c +new file mode 100644 +index 0000000..85f9198 +--- /dev/null ++++ b/dlls/winedib.drv/font.c +@@ -0,0 +1,83 @@ ++/* ++ * DIBDRV font objects ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ * ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/********************************************************************** ++ * DIBDRV_SetTextColor ++ */ ++COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) ++{ ++ TRACE("physDev:%p, color:%08x\n", physDev, color); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetTextColor(physDev->X11PhysDev, color); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SelectFont ++ */ ++HFONT DIBDRV_SelectFont( DIBDRVPHYSDEV *physDev, HFONT hfont, HANDLE gdiFont ) ++{ ++ TRACE("physDev:%p, hfont:%p, gdiFont:%p\n", physDev, hfont, gdiFont); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSelectFont(physDev->X11PhysDev, hfont, gdiFont); ++} ++ ++/*********************************************************************** ++ * DIBDRV_EnumDeviceFonts ++ */ ++BOOL DIBDRV_EnumDeviceFonts( DIBDRVPHYSDEV *physDev, LPLOGFONTW plf, ++ FONTENUMPROCW proc, LPARAM lp ) ++{ ++ TRACE("physDev:%p, plf:%p, proc:%p, lp:%lx\n", physDev, plf, proc, lp); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pEnumDeviceFonts(physDev->X11PhysDev, plf, proc, lp); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetTextMetrics ++ */ ++BOOL DIBDRV_GetTextMetrics( DIBDRVPHYSDEV *physDev, TEXTMETRICW *metrics ) ++{ ++ TRACE("physDev:%p, metrics:%p\n", physDev, metrics); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetTextMetrics(physDev->X11PhysDev, metrics); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetCharWidth ++ */ ++BOOL DIBDRV_GetCharWidth( DIBDRVPHYSDEV *physDev, UINT firstChar, UINT lastChar, ++ LPINT buffer ) ++{ ++ TRACE("physDev:%p, firstChar:%d, lastChar:%d, buffer:%pn", physDev, firstChar, lastChar, buffer); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetCharWidth(physDev->X11PhysDev, firstChar, lastChar, buffer); ++} +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +new file mode 100644 +index 0000000..b746af2 +--- /dev/null ++++ b/dlls/winedib.drv/graphics.c +@@ -0,0 +1,230 @@ ++/* ++ * DIBDRV implementation of GDI driver graphics functions ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV_Arc ++ */ ++BOOL DIBDRV_Arc( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, ++ INT xstart, INT ystart, INT xend, INT yend ) ++{ ++ TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", ++ physDev, left, top, right, bottom, xstart, ystart, xend, yend); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pArc(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++} ++ ++/*********************************************************************** ++ * DIBDRV_Chord ++ */ ++BOOL DIBDRV_Chord( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, ++ INT xstart, INT ystart, INT xend, INT yend ) ++{ ++ TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", ++ physDev, left, top, right, bottom, xstart, ystart, xend, yend); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pChord(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++} ++ ++/*********************************************************************** ++ * DIBDRV_Ellipse ++ */ ++BOOL DIBDRV_Ellipse( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom ) ++{ ++ TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", ++ physDev, left, top, right, bottom); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pEllipse(physDev->X11PhysDev, left, top, right, bottom); ++} ++ ++/********************************************************************** ++ * DIBDRV_ExtFloodFill ++ */ ++BOOL DIBDRV_ExtFloodFill( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color, ++ UINT fillType ) ++{ ++ TRACE("physDev:%p, x:%d, y:%d, color:%x, fillType:%d\n", ++ physDev, x, y, color, fillType); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pExtFloodFill(physDev->X11PhysDev, x, y, color, fillType); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetDCOrgEx ++ */ ++BOOL DIBDRV_GetDCOrgEx( DIBDRVPHYSDEV *physDev, LPPOINT lpp ) ++{ ++ TRACE("physDev:%p, lpp:%p\n", physDev, lpp); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetDCOrgEx(physDev->X11PhysDev, lpp); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetPixel ++ */ ++COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y ) ++{ ++ TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetPixel(physDev->X11PhysDev, x, y); ++} ++ ++/*********************************************************************** ++ * DIBDRV_LineTo ++ */ ++BOOL DIBDRV_LineTo( DIBDRVPHYSDEV *physDev, INT x, INT y ) ++{ ++ TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pLineTo(physDev->X11PhysDev, x, y); ++} ++ ++/*********************************************************************** ++ * DIBDRV_PaintRgn ++ */ ++BOOL DIBDRV_PaintRgn( DIBDRVPHYSDEV *physDev, HRGN hrgn ) ++{ ++ TRACE("physDev:%p, hrgn:%p\n", physDev, hrgn); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pPaintRgn(physDev->X11PhysDev, hrgn); ++} ++ ++/*********************************************************************** ++ * DIBDRV_Pie ++ */ ++BOOL DIBDRV_Pie( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, ++ INT xstart, INT ystart, INT xend, INT yend ) ++{ ++ TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", ++ physDev, left, top, right, bottom, xstart, ystart, xend, yend); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pPie(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++} ++ ++/********************************************************************** ++ * DIBDRV_Polygon ++ */ ++BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) ++{ ++ TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pPolygon(physDev->X11PhysDev, pt, count); ++} ++ ++/********************************************************************** ++ * DIBDRV_Polyline ++ */ ++BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) ++{ ++ TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pPolyline(physDev->X11PhysDev, pt, count); ++} ++ ++/********************************************************************** ++ * DIBDRV_PolyPolygon ++ */ ++BOOL DIBDRV_PolyPolygon( DIBDRVPHYSDEV *physDev, const POINT* pt, const INT* counts, UINT polygons) ++{ ++ TRACE("physDev:%p, pt:%p, counts:%p, polygons:%d\n", physDev, pt, counts, polygons); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pPolyPolygon(physDev->X11PhysDev, pt, counts, polygons); ++} ++ ++/********************************************************************** ++ * DIBDRV_PolyPolyline ++ */ ++BOOL DIBDRV_PolyPolyline( DIBDRVPHYSDEV *physDev, const POINT* pt, const DWORD* counts, ++ DWORD polylines ) ++{ ++ TRACE("physDev:%p, pt:%p, counts:%p, polylines:%d\n", physDev, pt, counts, polylines); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pPolyPolyline(physDev->X11PhysDev, pt, counts, polylines); ++} ++ ++/*********************************************************************** ++ * DIBDRV_Rectangle ++ */ ++BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom) ++{ ++ TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", ++ physDev, left, top, right, bottom); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pRectangle(physDev->X11PhysDev, left, top, right, bottom); ++} ++ ++/*********************************************************************** ++ * DIBDRV_RoundRect ++ */ ++BOOL DIBDRV_RoundRect( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, ++ INT bottom, INT ell_width, INT ell_height ) ++{ ++ TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, ell_width:%d, ell_height:%d\n", ++ physDev, left, top, right, bottom, ell_width, ell_height); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pRoundRect(physDev->X11PhysDev, left, top, right, bottom, ++ ell_width, ell_height); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SetPixel ++ */ ++COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color ) ++{ ++ TRACE("physDev:%p, x:%d, y:%d, color:%x\n", physDev, x, y, color); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetPixel(physDev->X11PhysDev, x, y, color); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SetDCOrg ++ */ ++DWORD DIBDRV_SetDCOrg( DIBDRVPHYSDEV *physDev, INT x, INT y ) ++{ ++ TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetDCOrg(physDev->X11PhysDev, x, y); ++} +diff --git a/dlls/winedib.drv/opengl.c b/dlls/winedib.drv/opengl.c +new file mode 100644 +index 0000000..27e4229 +--- /dev/null ++++ b/dlls/winedib.drv/opengl.c +@@ -0,0 +1,221 @@ ++/* ++ * DIBDRV OpenGL functions ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++#define HPBUFFERARB void * ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++int DIBDRV_ChoosePixelFormat( DIBDRVPHYSDEV *physDev, ++ const PIXELFORMATDESCRIPTOR *ppfd ) ++{ ++ TRACE("physDev:%p, ppfd:%p\n", physDev, ppfd); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pChoosePixelFormat(physDev->X11PhysDev, ppfd); ++} ++ ++int DIBDRV_DescribePixelFormat( DIBDRVPHYSDEV *physDev, ++ int iPixelFormat, ++ UINT nBytes, ++ PIXELFORMATDESCRIPTOR *ppfd ) ++{ ++ TRACE("physDev:%p, iPixelFormat:%d, nBytes:%d, ppfd:%p\n", physDev, iPixelFormat, nBytes, ppfd); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pDescribePixelFormat(physDev->X11PhysDev, iPixelFormat, nBytes, ppfd); ++} ++ ++int DIBDRV_GetPixelFormat( DIBDRVPHYSDEV *physDev) ++{ ++ TRACE("physDev:%p\n", physDev); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetPixelFormat(physDev->X11PhysDev); ++} ++ ++BOOL DIBDRV_SetPixelFormat( DIBDRVPHYSDEV *physDev, ++ int iPixelFormat, ++ const PIXELFORMATDESCRIPTOR *ppfd ) ++{ ++ TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetPixelFormat(physDev->X11PhysDev, iPixelFormat, ppfd); ++} ++ ++BOOL DIBDRV_SwapBuffers( DIBDRVPHYSDEV *physDev ) ++{ ++ TRACE("physDev:%p\n", physDev); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSwapBuffers(physDev->X11PhysDev); ++} ++ ++/** ++ * DIBDRV_wglCopyContext ++ * ++ * For OpenGL32 wglCopyContext. ++ */ ++BOOL CDECL DIBDRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) ++{ ++ TRACE("hglrcSrc:%p, hglrcDst:%p, mask:%x\n", hglrcSrc, hglrcDst, mask); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglCopyContext(hglrcSrc, hglrcDst, mask); ++} ++ ++/** ++ * DIBDRV_wglCreateContext ++ * ++ * For OpenGL32 wglCreateContext. ++ */ ++HGLRC CDECL DIBDRV_wglCreateContext(DIBDRVPHYSDEV *physDev) ++{ ++ TRACE("physDev:%p\n", physDev); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglCreateContext(physDev->X11PhysDev); ++} ++ ++/** ++ * DIBDRV_wglDeleteContext ++ * ++ * For OpenGL32 wglDeleteContext. ++ */ ++BOOL CDECL DIBDRV_wglDeleteContext(HGLRC hglrc) ++{ ++ TRACE("hglrc:%p\n", hglrc); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglDeleteContext(hglrc); ++} ++ ++/** ++ * DIBDRV_wglGetProcAddress ++ * ++ * For OpenGL32 wglGetProcAddress. ++ */ ++PROC CDECL DIBDRV_wglGetProcAddress(LPCSTR lpszProc) ++{ ++ TRACE("lpszProc:%p\n", lpszProc); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglGetProcAddress(lpszProc); ++} ++ ++/** ++ * DIBDRV_wglGetPbufferDCARB ++ * ++ * WGL_ARB_pbuffer: wglGetPbufferDCARB ++ * The function wglGetPbufferDCARB returns a device context for a pbuffer. ++ * Gdi32 implements the part of this function which creates a device context. ++ * This part associates the physDev with the X drawable of the pbuffer. ++ */ ++HDC CDECL DIBDRV_wglGetPbufferDCARB(DIBDRVPHYSDEV *physDev, HPBUFFERARB hPbuffer) ++{ ++ TRACE("physDev:%p, hPbuffer:%p\n", physDev, hPbuffer); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglGetPbufferDCARB(physDev->X11PhysDev, hPbuffer); ++} ++ ++/** ++ * DIBDRV_wglMakeContextCurrentARB ++ * ++ * For OpenGL32 wglMakeContextCurrentARB ++ */ ++BOOL CDECL DIBDRV_wglMakeContextCurrentARB(DIBDRVPHYSDEV* pDrawDev, DIBDRVPHYSDEV* pReadDev, HGLRC hglrc) ++{ ++ TRACE("pDrawDev:%p, pReadDev:%p, hglrc:%p\n", pDrawDev, pReadDev, hglrc); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev->X11PhysDev, pReadDev->X11PhysDev, hglrc); ++} ++ ++/** ++ * DIBDRV_wglMakeCurrent ++ * ++ * For OpenGL32 wglMakeCurrent. ++ */ ++BOOL CDECL DIBDRV_wglMakeCurrent(DIBDRVPHYSDEV *physDev, HGLRC hglrc) ++{ ++ TRACE("physDev:%p, hglrc:%p\n", physDev, hglrc); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglMakeCurrent(physDev->X11PhysDev, hglrc); ++} ++ ++/** ++ * DIBDRV_wglSetPixelFormatWINE ++ * ++ * WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE ++ * This is a WINE-specific wglSetPixelFormat which can set the pixel format multiple times. ++ */ ++BOOL CDECL DIBDRV_wglSetPixelFormatWINE(DIBDRVPHYSDEV *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) ++{ ++ TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglSetPixelFormatWINE(physDev->X11PhysDev, iPixelFormat, ppfd); ++} ++ ++/** ++ * DIBDRV_wglShareLists ++ * ++ * For OpenGL32 wglShareLists. ++ */ ++BOOL CDECL DIBDRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) ++{ ++ TRACE("hglrc1:%p, hglrc2:%p\n", hglrc1, hglrc2); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglShareLists(hglrc1, hglrc2); ++} ++ ++/** ++ * DIBDRV_wglUseFontBitmapsA ++ * ++ * For OpenGL32 wglUseFontBitmapsA. ++ */ ++BOOL CDECL DIBDRV_wglUseFontBitmapsA(DIBDRVPHYSDEV *physDev, DWORD first, DWORD count, DWORD listBase) ++{ ++ TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsA(physDev->X11PhysDev, first, count, listBase); ++} ++ ++/** ++ * DIBDRV_wglUseFontBitmapsW ++ * ++ * For OpenGL32 wglUseFontBitmapsW. ++ */ ++BOOL CDECL DIBDRV_wglUseFontBitmapsW(DIBDRVPHYSDEV *physDev, DWORD first, DWORD count, DWORD listBase) ++{ ++ TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsW(physDev->X11PhysDev, first, count, listBase); ++} +diff --git a/dlls/winedib.drv/palette.c b/dlls/winedib.drv/palette.c +new file mode 100644 +index 0000000..28fae09 +--- /dev/null ++++ b/dlls/winedib.drv/palette.c +@@ -0,0 +1,90 @@ ++/* ++ * DIBDRV palette objects ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV_RealizePalette ++ */ ++UINT DIBDRV_RealizePalette( DIBDRVPHYSDEV *physDev, HPALETTE hpal, BOOL primary ) ++{ ++ TRACE("physDev:%p, hpal:%p, primary:%s\n", physDev, hpal, (primary ? "TRUE" : "FALSE")); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pRealizePalette(physDev->X11PhysDev, hpal, primary); ++} ++ ++/*********************************************************************** ++ * DIBDRV_UnrealizePalette ++ */ ++BOOL DIBDRV_UnrealizePalette( HPALETTE hpal ) ++{ ++ TRACE("hpal:%p\n", hpal); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pUnrealizePalette(hpal); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetSystemPaletteEntries ++ */ ++UINT DIBDRV_GetSystemPaletteEntries( DIBDRVPHYSDEV *physDev, UINT start, UINT count, ++ LPPALETTEENTRY entries ) ++{ ++ TRACE("physDev:%p, start:%d, count:%d, entries:%p\n", physDev, start, count, entries); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetSystemPaletteEntries(physDev->X11PhysDev, start, count, entries); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetNearestColor ++ */ ++COLORREF DIBDRV_GetNearestColor( DIBDRVPHYSDEV *physDev, COLORREF color ) ++{ ++ TRACE("physDev:%p, color:%x\n", physDev, color); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetNearestColor(physDev->X11PhysDev, color); ++} ++ ++/*********************************************************************** ++ * DIBDRV_RealizeDefaultPalette ++ */ ++UINT DIBDRV_RealizeDefaultPalette( DIBDRVPHYSDEV *physDev ) ++{ ++ TRACE("physDev:%p\n", physDev); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pRealizeDefaultPalette(physDev->X11PhysDev); ++} ++ ++BOOL DIBDRV_GetICMProfile(DIBDRVPHYSDEV *physDev, LPDWORD lpcbName, LPWSTR lpszFilename) ++{ ++ TRACE("physDev:%p, lpcpName:%p, lpszFilename:%p\n", physDev, lpcbName, lpszFilename); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetICMProfile(physDev->X11PhysDev, lpcbName, lpszFilename); ++} +diff --git a/dlls/winedib.drv/pen_brush.c b/dlls/winedib.drv/pen_brush.c +new file mode 100644 +index 0000000..1e992e0 +--- /dev/null ++++ b/dlls/winedib.drv/pen_brush.c +@@ -0,0 +1,98 @@ ++/* ++ * DIBDRV pen objects ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++ ++/*********************************************************************** ++ * DIBDRV_SelectPen ++ */ ++HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen ) ++{ ++ TRACE("physDev:%p, hpen:%p\n", physDev, hpen); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSelectPen(physDev->X11PhysDev, hpen); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SetDCPenColor ++ */ ++COLORREF DIBDRV_SetDCPenColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) ++{ ++ TRACE("physDev:%p, crColor:%x\n", physDev, crColor); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetDCPenColor(physDev->X11PhysDev, crColor); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SelectBrush ++ */ ++HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) ++{ ++ TRACE("physDev:%p, hbrush:%p\n", physDev, hbrush); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SetDCBrushColor ++ */ ++COLORREF DIBDRV_SetDCBrushColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) ++{ ++ TRACE("physDev:%p, crColor:%x\n", physDev, crColor); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetDCBrushColor(physDev->X11PhysDev, crColor); ++} ++ ++/*********************************************************************** ++ * SetROP2 ++ */ ++INT DIBDRV_SetROP2( DIBDRVPHYSDEV *physDev, INT rop ) ++{ ++ INT prevRop; ++ ++ TRACE("physDev:%p, rop:%x\n", physDev, rop); ++ ++ ONCE(FIXME("stub\n")); ++ prevRop = physDev->rop2; ++ physDev->rop2 = rop; ++ return prevRop; ++ /* note : X11 Driver don't have SetROP2() function exported */ ++} ++ ++/*********************************************************************** ++ * SetBkColor ++ */ ++COLORREF DIBDRV_SetBkColor( DIBDRVPHYSDEV *physDev, COLORREF color ) ++{ ++ TRACE("physDev:%p, color:%x\n", physDev, color); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetBkColor(physDev->X11PhysDev, color); ++} +diff --git a/dlls/winedib.drv/text.c b/dlls/winedib.drv/text.c +new file mode 100644 +index 0000000..fdb075f +--- /dev/null ++++ b/dlls/winedib.drv/text.c +@@ -0,0 +1,55 @@ ++/* ++ * DIBDRV text functions ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV_ExtTextOut ++ */ ++BOOL ++DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, ++ const RECT *lprect, LPCWSTR wstr, UINT count, ++ const INT *lpDx ) ++{ ++ TRACE("physDev:%p, x:%d, y:%d, flags:%x, lprect:%p, wstr:%s, count:%d, lpDx:%p\n", ++ physDev, x, y, flags, lprect, debugstr_w(wstr), count, lpDx); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pExtTextOut(physDev->X11PhysDev, x, y, flags, lprect, ++ wstr, count, lpDx); ++} ++ ++/*********************************************************************** ++ * DIBDRV_GetTextExtentExPoint ++ */ ++BOOL DIBDRV_GetTextExtentExPoint( DIBDRVPHYSDEV *physDev, LPCWSTR str, INT count, ++ INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size ) ++{ ++ TRACE("physDev:%p, str:%s, count:%d, maxExt:%d, lpnFit:%p, alpDx:%p, size:%p\n", ++ physDev, debugstr_w(str), count, maxExt, lpnFit, alpDx, size); ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetTextExtentExPoint(physDev->X11PhysDev, str, count, maxExt, ++ lpnFit, alpDx, size); ++} +diff --git a/dlls/winedib.drv/video.c b/dlls/winedib.drv/video.c +new file mode 100644 +index 0000000..6490ac6 +--- /dev/null ++++ b/dlls/winedib.drv/video.c +@@ -0,0 +1,48 @@ ++/* ++ * DIBDRV video functions ++ * ++ * Copyright 2009 Massimo Del Fedele ++ * ++ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++ ++#include "dibdrv.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); ++ ++/*********************************************************************** ++ * DIBDRV_GetDeviceGammaRamp ++ */ ++BOOL DIBDRV_GetDeviceGammaRamp( DIBDRVPHYSDEV *physDev, LPVOID ramp ) ++{ ++ TRACE("physDev:%p, ramp:%p\n", physDev, ramp); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pGetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++} ++ ++/*********************************************************************** ++ * DIBDRV_SetDeviceGammaRamp ++ */ ++BOOL DIBDRV_SetDeviceGammaRamp( DIBDRVPHYSDEV *physDev, LPVOID ramp ) ++{ ++ TRACE("physDev:%p, ramp:%p\n", physDev, ramp); ++ ++ ONCE(FIXME("stub\n")); ++ return _DIBDRV_GetDisplayDriver()->pSetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++} +diff --git a/dlls/winedib.drv/winedib.drv.spec b/dlls/winedib.drv/winedib.drv.spec +new file mode 100644 +index 0000000..3743b2b +--- /dev/null ++++ b/dlls/winedib.drv/winedib.drv.spec +@@ -0,0 +1,74 @@ ++@ cdecl AlphaBlend(ptr long long long long ptr long long long long long) DIBDRV_AlphaBlend ++@ cdecl Arc(ptr long long long long long long long long) DIBDRV_Arc ++@ cdecl BitBlt(ptr long long long long ptr long long long) DIBDRV_BitBlt ++@ cdecl ChoosePixelFormat(ptr ptr) DIBDRV_ChoosePixelFormat ++@ cdecl Chord(ptr long long long long long long long long) DIBDRV_Chord ++@ cdecl CreateBitmap(ptr long ptr) DIBDRV_CreateBitmap ++@ cdecl CreateDC(long ptr wstr wstr wstr ptr) DIBDRV_CreateDC ++@ cdecl CreateDIBSection(ptr long ptr long) DIBDRV_CreateDIBSection ++@ cdecl DeleteBitmap(long) DIBDRV_DeleteBitmap ++@ cdecl DeleteDC(ptr) DIBDRV_DeleteDC ++@ cdecl DescribePixelFormat(ptr long long ptr) DIBDRV_DescribePixelFormat ++@ cdecl Ellipse(ptr long long long long) DIBDRV_Ellipse ++@ cdecl EnumDeviceFonts(ptr ptr ptr long) DIBDRV_EnumDeviceFonts ++@ cdecl ExtEscape(ptr long long ptr long ptr) DIBDRV_ExtEscape ++@ cdecl ExtFloodFill(ptr long long long long) DIBDRV_ExtFloodFill ++@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr) DIBDRV_ExtTextOut ++@ cdecl GetBitmapBits(long ptr long) DIBDRV_GetBitmapBits ++@ cdecl GetCharWidth(ptr long long ptr) DIBDRV_GetCharWidth ++@ cdecl GetDCOrgEx(ptr ptr) DIBDRV_GetDCOrgEx ++@ cdecl GetDIBits(ptr long long long ptr ptr long) DIBDRV_GetDIBits ++@ cdecl GetDeviceCaps(ptr long) DIBDRV_GetDeviceCaps ++@ cdecl GetDeviceGammaRamp(ptr ptr) DIBDRV_GetDeviceGammaRamp ++@ cdecl GetICMProfile(ptr ptr ptr) DIBDRV_GetICMProfile ++@ cdecl GetNearestColor(ptr long) DIBDRV_GetNearestColor ++@ cdecl GetPixel(ptr long long) DIBDRV_GetPixel ++@ cdecl GetPixelFormat(ptr) DIBDRV_GetPixelFormat ++@ cdecl GetSystemPaletteEntries(ptr long long ptr) DIBDRV_GetSystemPaletteEntries ++@ cdecl GetTextExtentExPoint(ptr ptr long long ptr ptr ptr) DIBDRV_GetTextExtentExPoint ++@ cdecl GetTextMetrics(ptr ptr) DIBDRV_GetTextMetrics ++@ cdecl LineTo(ptr long long) DIBDRV_LineTo ++@ cdecl PaintRgn(ptr long) DIBDRV_PaintRgn ++@ cdecl PatBlt(ptr long long long long long) DIBDRV_PatBlt ++@ cdecl Pie(ptr long long long long long long long long) DIBDRV_Pie ++@ cdecl PolyPolygon(ptr ptr ptr long) DIBDRV_PolyPolygon ++@ cdecl PolyPolyline(ptr ptr ptr long) DIBDRV_PolyPolyline ++@ cdecl Polygon(ptr ptr long) DIBDRV_Polygon ++@ cdecl Polyline(ptr ptr long) DIBDRV_Polyline ++@ cdecl RealizeDefaultPalette(ptr) DIBDRV_RealizeDefaultPalette ++@ cdecl RealizePalette(ptr long long) DIBDRV_RealizePalette ++@ cdecl Rectangle(ptr long long long long) DIBDRV_Rectangle ++@ cdecl RoundRect(ptr long long long long long long) DIBDRV_RoundRect ++@ cdecl SelectBitmap(ptr long) DIBDRV_SelectBitmap ++@ cdecl SelectBrush(ptr long) DIBDRV_SelectBrush ++@ cdecl SelectFont(ptr long long) DIBDRV_SelectFont ++@ cdecl SelectPen(ptr long) DIBDRV_SelectPen ++@ cdecl SetBitmapBits(long ptr long) DIBDRV_SetBitmapBits ++@ cdecl SetBkColor(ptr long) DIBDRV_SetBkColor ++@ cdecl SetDCBrushColor(ptr long) DIBDRV_SetDCBrushColor ++@ cdecl SetDCOrg(ptr long long) DIBDRV_SetDCOrg ++@ cdecl SetDCPenColor(ptr long) DIBDRV_SetDCPenColor ++@ cdecl SetDIBColorTable(ptr long long ptr) DIBDRV_SetDIBColorTable ++@ cdecl SetDIBits(ptr long long long ptr ptr long) DIBDRV_SetDIBits ++@ cdecl SetDIBitsToDevice(ptr long long long long long long long long ptr ptr long) DIBDRV_SetDIBitsToDevice ++@ cdecl SetDeviceClipping(ptr long long) DIBDRV_SetDeviceClipping ++@ cdecl SetDeviceGammaRamp(ptr ptr) DIBDRV_SetDeviceGammaRamp ++@ cdecl SetPixel(ptr long long long) DIBDRV_SetPixel ++@ cdecl SetPixelFormat(ptr long ptr) DIBDRV_SetPixelFormat ++@ cdecl SetTextColor(ptr long) DIBDRV_SetTextColor ++@ cdecl StretchBlt(ptr long long long long ptr long long long long long) DIBDRV_StretchBlt ++@ cdecl SwapBuffers(ptr) DIBDRV_SwapBuffers ++@ cdecl UnrealizePalette(long) DIBDRV_UnrealizePalette ++@ cdecl SetROP2(ptr long) DIBDRV_SetROP2 ++# OpenGL ++@ cdecl wglCopyContext(long long long) DIBDRV_wglCopyContext ++@ cdecl wglCreateContext(ptr) DIBDRV_wglCreateContext ++@ cdecl wglDeleteContext(long) DIBDRV_wglDeleteContext ++@ cdecl wglGetProcAddress(str) DIBDRV_wglGetProcAddress ++@ cdecl wglGetPbufferDCARB(ptr ptr) DIBDRV_wglGetPbufferDCARB ++@ cdecl wglMakeContextCurrentARB(ptr ptr long) DIBDRV_wglMakeContextCurrentARB ++@ cdecl wglMakeCurrent(ptr long) DIBDRV_wglMakeCurrent ++@ cdecl wglSetPixelFormatWINE(ptr long ptr) DIBDRV_wglSetPixelFormatWINE ++@ cdecl wglShareLists(long long) DIBDRV_wglShareLists ++@ cdecl wglUseFontBitmapsA(ptr long long long) DIBDRV_wglUseFontBitmapsA ++@ cdecl wglUseFontBitmapsW(ptr long long long) DIBDRV_wglUseFontBitmapsW --- wine1.2-1.1.43.orig/debian/patches/dibeng-0003.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0003.patch @@ -0,0 +1,1858 @@ +DIB Engine: Fork DDB-DIB behaviour + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/bitblt.c | 116 ++++++++++++++++- + dlls/winedib.drv/bitmap.c | 82 +++++++++++- + dlls/winedib.drv/clipping.c | 14 ++ + dlls/winedib.drv/dc.c | 39 +++++- + dlls/winedib.drv/dib.c | 42 +++++- + dlls/winedib.drv/dibdrv.h | 9 + + dlls/winedib.drv/font.c | 81 +++++++++++- + dlls/winedib.drv/graphics.c | 284 ++++++++++++++++++++++++++++++++++++------ + dlls/winedib.drv/opengl.c | 227 +++++++++++++++++++++++++++++----- + dlls/winedib.drv/palette.c | 91 ++++++++++++- + dlls/winedib.drv/pen_brush.c | 81 ++++++++++-- + dlls/winedib.drv/text.c | 44 +++++-- + dlls/winedib.drv/video.c | 32 ++++- + 13 files changed, 995 insertions(+), 147 deletions(-) + + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index fa9e2ec..022f223 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -32,12 +32,43 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + DIBDRVPHYSDEV *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, + BLENDFUNCTION blendfn) + { ++ BOOL res; ++ + TRACE("physDevDst:%p, xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", + physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, ++ ++ if(physDevDst->hasDIB && physDevSrc->hasDIB) ++ { ++ /* DIB section selected in both source and dest DC, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, ++ blendfn); ++ } ++ else if(!physDevDst->hasDIB && !physDevSrc->hasDIB) ++ { ++ /* DDB selected in noth source and dest DC, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, ++ blendfn); ++ } ++ else if(physDevSrc->hasDIB) ++ { ++ /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, ++ blendfn); ++ } ++ else /* if(physDevDst->hasDIB) */ ++ { ++ /* DDB on source, DIB on dest -- must convert source DDB to DIB and use the engine for blit */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pAlphaBlend(physDevDst->X11PhysDev, xDst, yDst, widthDst, heightDst, + physDevSrc->X11PhysDev, xSrc, ySrc, widthSrc, heightSrc, + blendfn); ++ } ++ return res; + } + + /*********************************************************************** +@@ -47,11 +78,39 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + INT width, INT height, DIBDRVPHYSDEV *physDevSrc, + INT xSrc, INT ySrc, DWORD rop ) + { ++ BOOL res; ++ + TRACE("physDevDst:%p, xDst:%d, yDst:%d, width:%d, height:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, rop:%08x\n", + physDevDst, xDst, yDst, width, height, physDevSrc, xSrc, ySrc, rop); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ ++ if(physDevDst->hasDIB && physDevSrc->hasDIB) ++ { ++ /* DIB section selected in both source and dest DC, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, + physDevSrc->X11PhysDev, xSrc, ySrc, rop); ++ } ++ else if(!physDevDst->hasDIB && !physDevSrc->hasDIB) ++ { ++ /* DDB selected in noth source and dest DC, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc->X11PhysDev, xSrc, ySrc, rop); ++ } ++ else if(physDevSrc->hasDIB) ++ { ++ /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc->X11PhysDev, xSrc, ySrc, rop); ++ } ++ else /* if(physDevDst->hasDIB) */ ++ { ++ /* DDB on source, DIB on dest -- must convert source DDB to DIB and use the engine for blit */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pBitBlt(physDevDst->X11PhysDev, xDst, yDst, width, height, ++ physDevSrc->X11PhysDev, xSrc, ySrc, rop); ++ } ++ return res; + } + + /*********************************************************************** +@@ -62,11 +121,39 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + DIBDRVPHYSDEV *physDevSrc, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, DWORD rop ) + { ++ BOOL res; ++ + TRACE("physDevDst:%p, xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p, xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d, rop:%8x\n", + physDevDst, xDst, yDst, widthDst, heightDst, physDevSrc, xSrc, ySrc, widthSrc, heightSrc, rop); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, ++ ++ if(physDevDst->hasDIB && physDevSrc->hasDIB) ++ { ++ /* DIB section selected in both source and dest DC, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); ++ } ++ else if(!physDevDst->hasDIB && !physDevSrc->hasDIB) ++ { ++ /* DDB selected in noth source and dest DC, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); ++ } ++ else if(physDevSrc->hasDIB) ++ { ++ /* DIB on source, DDB on dest -- must convert source DIB to DDB and use X11 driver for blit */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, + physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); ++ } ++ else /* if(physDevDst->hasDIB) */ ++ { ++ /* DDB on source, DIB on dest -- must convert source DDB to DIB and use the engine for blit */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pStretchBlt(physDevDst->X11PhysDev, xDst, yDst, widthSrc, heightSrc, ++ physDevSrc->X11PhysDev, xSrc, ySrc, widthDst, heightDst, rop); ++ } ++ return res; + } + + /*********************************************************************** +@@ -74,7 +161,20 @@ BOOL DIBDRV_StretchBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + */ + BOOL DIBDRV_PatBlt( DIBDRVPHYSDEV *physDev, INT left, INT top, INT width, INT height, DWORD rop ) + { ++ BOOL res; ++ + TRACE("physDev:%p, left:%d, top:%d, width:%d, height:%d, rop:%06x\n", physDev, left, top, width, height, rop); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pPatBlt(physDev->X11PhysDev, left, top, width, height, rop); ++ ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pPatBlt(physDev->X11PhysDev, left, top, width, height, rop); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pPatBlt(physDev->X11PhysDev, left, top, width, height, rop); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/bitmap.c b/dlls/winedib.drv/bitmap.c +index 09cca69..df7c03a 100644 +--- a/dlls/winedib.drv/bitmap.c ++++ b/dlls/winedib.drv/bitmap.c +@@ -31,9 +31,31 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + */ + HBITMAP DIBDRV_SelectBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap ) + { ++ DIBSECTION dibSection; ++ HBITMAP res; ++ + TRACE("physDev:%p, hbitmap:%p\n", physDev, hbitmap); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSelectBitmap(physDev->X11PhysDev, hbitmap); ++ ++ /* try to get the DIBSECTION data from the bitmap */ ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) ++ { ++ /* not a DIB section, sets it on physDev and use X11 behaviour */ ++ physDev->hasDIB = FALSE; ++ res = _DIBDRV_GetDisplayDriver()->pSelectBitmap(physDev->X11PhysDev, hbitmap); ++ if(res) ++ physDev->hbitmap = hbitmap; ++ } ++ else ++ { ++ /* it's a DIB section, sets it on physDev and use DIB Engine behaviour */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ physDev->hasDIB = TRUE; ++ res = _DIBDRV_GetDisplayDriver()->pSelectBitmap(physDev->X11PhysDev, hbitmap); ++ if(res) ++ physDev->hbitmap = hbitmap; ++ } ++ return res; ++ + } + + /**************************************************************************** +@@ -41,9 +63,24 @@ HBITMAP DIBDRV_SelectBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap ) + */ + BOOL DIBDRV_CreateBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, LPVOID bmBits ) + { ++ DIBSECTION dibSection; ++ BOOL res; ++ + TRACE("physDev:%p, hbitmap:%p, bmBits:%p\n", physDev, hbitmap, bmBits); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pCreateBitmap(physDev->X11PhysDev, hbitmap, bmBits); ++ ++ /* try to get the DIBSECTION data from the bitmap */ ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) ++ { ++ /* not a DIB section, use X11 behaviour */ ++ res = _DIBDRV_GetDisplayDriver()->pCreateBitmap(physDev->X11PhysDev, hbitmap, bmBits); ++ } ++ else ++ { ++ /* it's a DIB section, use DIB Engine behaviour */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pCreateBitmap(physDev->X11PhysDev, hbitmap, bmBits); ++ } ++ return res; + } + + /*********************************************************************** +@@ -51,9 +88,24 @@ BOOL DIBDRV_CreateBitmap( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, LPVOID bmBits + */ + BOOL DIBDRV_DeleteBitmap( HBITMAP hbitmap ) + { ++ DIBSECTION dibSection; ++ BOOL res; ++ + TRACE("hbitmap:%p\n", hbitmap); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pDeleteBitmap(hbitmap); ++ ++ /* try to get the DIBSECTION data from the bitmap */ ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &dibSection) == sizeof(BITMAP)) ++ { ++ /* not a DIB section, use X11 behaviour */ ++ res = _DIBDRV_GetDisplayDriver()->pDeleteBitmap(hbitmap); ++ } ++ else ++ { ++ /* it's a DIB section, use DIB Engine behaviour */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pDeleteBitmap(hbitmap); ++ } ++ return res; + } + + /*********************************************************************** +@@ -61,9 +113,14 @@ BOOL DIBDRV_DeleteBitmap( HBITMAP hbitmap ) + */ + LONG DIBDRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count ) + { ++ LONG res; ++ + TRACE("hbitmap:%p, buffer:%p, count:%d\n", hbitmap, buffer, count); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetBitmapBits(hbitmap, buffer, count); ++ ++ /* GetBitmapBits is only valid for DDBs, so use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetBitmapBits(hbitmap, buffer, count); ++ ++ return res; + } + + /****************************************************************************** +@@ -71,7 +128,12 @@ LONG DIBDRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count ) + */ + LONG DIBDRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) + { ++ LONG res; ++ + TRACE("hbitmap:%p, bits:%p, count:%d\n", hbitmap, bits, count); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetBitmapBits(hbitmap, bits, count); ++ ++ /* SetBitmapBits is only valid for DDBs, so use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetBitmapBits(hbitmap, bits, count); ++ ++ return res; + } +diff --git a/dlls/winedib.drv/clipping.c b/dlls/winedib.drv/clipping.c +index b3c18ef..1ddbb1b 100644 +--- a/dlls/winedib.drv/clipping.c ++++ b/dlls/winedib.drv/clipping.c +@@ -31,6 +31,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + void DIBDRV_SetDeviceClipping( DIBDRVPHYSDEV *physDev, HRGN vis_rgn, HRGN clip_rgn ) + { + TRACE("physDev:%p, vis_rgn:%p, clip_rgn:%p\n", physDev, vis_rgn, clip_rgn); +- ONCE(FIXME("stub\n")); +- _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++ ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ _DIBDRV_GetDisplayDriver()->pSetDeviceClipping(physDev->X11PhysDev, vis_rgn, clip_rgn); ++ } + } +diff --git a/dlls/winedib.drv/dc.c b/dlls/winedib.drv/dc.c +index e0ffb4d..c8e3b91 100644 +--- a/dlls/winedib.drv/dc.c ++++ b/dlls/winedib.drv/dc.c +@@ -52,10 +52,15 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + /* sets X11 Device pointer in DIB Engine device */ + physDev->X11PhysDev = X11PhysDev; + ++ /* stock bitmap selected on DC creation */ ++ physDev->hbitmap = GetStockObject(DEFAULT_BITMAP); ++ ++ /* no DIB selected into DC on creation */ ++ physDev->hasDIB = FALSE; ++ + /* sets the result value and returns */ + *pdev = physDev; + +- ONCE(FIXME("stub\n")); + return TRUE; + } + +@@ -85,11 +90,23 @@ BOOL DIBDRV_DeleteDC( DIBDRVPHYSDEV *physDev ) + INT DIBDRV_ExtEscape( DIBDRVPHYSDEV *physDev, INT escape, INT in_count, LPCVOID in_data, + INT out_count, LPVOID out_data ) + { ++ INT res; ++ + TRACE("physDev:%p, escape:%d, in_count:%d, in_data:%p, out_count:%d, out_data:%p\n", + physDev, escape, in_count, in_data, out_count, out_data); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pExtEscape(physDev->X11PhysDev, escape, in_count, in_data, out_count, out_data); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pExtEscape(physDev->X11PhysDev, escape, in_count, in_data, out_count, out_data); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pExtEscape(physDev->X11PhysDev, escape, in_count, in_data, out_count, out_data); ++ } ++ return res; + } + + /*********************************************************************** +@@ -97,8 +114,20 @@ INT DIBDRV_ExtEscape( DIBDRVPHYSDEV *physDev, INT escape, INT in_count, LPCVOID + */ + INT DIBDRV_GetDeviceCaps( DIBDRVPHYSDEV *physDev, INT cap ) + { ++ INT res; ++ + TRACE("physDev:%p, cap:%d\n", physDev, cap); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetDeviceCaps(physDev->X11PhysDev, cap); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetDeviceCaps(physDev->X11PhysDev, cap); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetDeviceCaps(physDev->X11PhysDev, cap); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/dib.c b/dlls/winedib.drv/dib.c +index 47dce0e..28330fa 100644 +--- a/dlls/winedib.drv/dib.c ++++ b/dlls/winedib.drv/dib.c +@@ -31,10 +31,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + HBITMAP DIBDRV_CreateDIBSection( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, + const BITMAPINFO *bmi, UINT usage ) + { ++ HBITMAP res; ++ + TRACE("physDev:%p, hbitmap:%p, bmi:%p, usage:%d\n", physDev, hbitmap, bmi, usage); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pCreateDIBSection(physDev->X11PhysDev, hbitmap, bmi, usage); ++ /* createDIBSection is only DIB-related, so we just use the engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pCreateDIBSection(physDev->X11PhysDev, hbitmap, bmi, usage); ++ ++ return res; + } + + /*********************************************************************** +@@ -43,11 +48,15 @@ HBITMAP DIBDRV_CreateDIBSection( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, + INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + UINT lines, LPCVOID bits, const BITMAPINFO *bmi, UINT coloruse ) + { ++ INT res; ++ + TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", + physDev, hbitmap, startscan, lines, bits, bmi, coloruse); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, bmi, coloruse); ++ /* GetDIBits reads bits from a DDB, so we should use the X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, bmi, coloruse); ++ ++ return res; + } + + /*********************************************************************** +@@ -56,10 +65,15 @@ INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + const RGBQUAD *colors ) + { ++ UINT res; ++ + TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetDIBColorTable(physDev->X11PhysDev, start, count, colors); ++ /* SetDIBColorTable operates on a DIB, so we use the engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetDIBColorTable(physDev->X11PhysDev, start, count, colors); ++ ++ return res; + } + + /*********************************************************************** +@@ -68,11 +82,15 @@ UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) + { ++ INT res; ++ + TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", + physDev, hbitmap, startscan, lines, bits, info, coloruse); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse); ++ /* SetDIBits writes bits to a DDB, so we should use the X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse); ++ ++ return res; + } + + /************************************************************************* +@@ -83,10 +101,14 @@ INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDest, INT yDest, DWOR + UINT startscan, UINT lines, LPCVOID bits, + const BITMAPINFO *info, UINT coloruse ) + { ++ INT res; ++ + TRACE("physDev:%p, xDest:%d, yDest:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", + physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc, ++ /* SetDIBitsToDevice operates on a physical device, so we should use the X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc, + startscan, lines, bits, info, coloruse); ++ ++ return res; + } +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 6dfba06..8a2e139 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -52,6 +52,9 @@ + } \ + } + ++/* extra stock object: default 1x1 bitmap for memory DCs ++ grabbed from gdi_private.h */ ++#define DEFAULT_BITMAP (STOCK_LAST+1) + + /* DIB driver physical device */ + typedef struct _DIBDRVPHYSDEV +@@ -59,6 +62,12 @@ typedef struct _DIBDRVPHYSDEV + /* X11 driver physical device */ + PHYSDEV X11PhysDev; + ++ /* is a DIB selected into DC ? */ ++ BOOL hasDIB; ++ ++ /* currently selected HBITMAP */ ++ HBITMAP hbitmap; ++ + /* active ROP2 */ + INT rop2; + +diff --git a/dlls/winedib.drv/font.c b/dlls/winedib.drv/font.c +index 85f9198..675145f 100644 +--- a/dlls/winedib.drv/font.c ++++ b/dlls/winedib.drv/font.c +@@ -31,10 +31,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + */ + COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + { ++ COLORREF res; ++ + TRACE("physDev:%p, color:%08x\n", physDev, color); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetTextColor(physDev->X11PhysDev, color); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetTextColor(physDev->X11PhysDev, color); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetTextColor(physDev->X11PhysDev, color); ++ } ++ return res; + } + + /*********************************************************************** +@@ -42,10 +54,22 @@ COLORREF DIBDRV_SetTextColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + */ + HFONT DIBDRV_SelectFont( DIBDRVPHYSDEV *physDev, HFONT hfont, HANDLE gdiFont ) + { ++ HFONT res; ++ + TRACE("physDev:%p, hfont:%p, gdiFont:%p\n", physDev, hfont, gdiFont); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSelectFont(physDev->X11PhysDev, hfont, gdiFont); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSelectFont(physDev->X11PhysDev, hfont, gdiFont); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSelectFont(physDev->X11PhysDev, hfont, gdiFont); ++ } ++ return res; + } + + /*********************************************************************** +@@ -54,10 +78,22 @@ HFONT DIBDRV_SelectFont( DIBDRVPHYSDEV *physDev, HFONT hfont, HANDLE gdiFont ) + BOOL DIBDRV_EnumDeviceFonts( DIBDRVPHYSDEV *physDev, LPLOGFONTW plf, + FONTENUMPROCW proc, LPARAM lp ) + { ++ BOOL res; ++ + TRACE("physDev:%p, plf:%p, proc:%p, lp:%lx\n", physDev, plf, proc, lp); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pEnumDeviceFonts(physDev->X11PhysDev, plf, proc, lp); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pEnumDeviceFonts(physDev->X11PhysDev, plf, proc, lp); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pEnumDeviceFonts(physDev->X11PhysDev, plf, proc, lp); ++ } ++ return res; + } + + /*********************************************************************** +@@ -65,9 +101,22 @@ BOOL DIBDRV_EnumDeviceFonts( DIBDRVPHYSDEV *physDev, LPLOGFONTW plf, + */ + BOOL DIBDRV_GetTextMetrics( DIBDRVPHYSDEV *physDev, TEXTMETRICW *metrics ) + { ++ BOOL res; ++ + TRACE("physDev:%p, metrics:%p\n", physDev, metrics); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetTextMetrics(physDev->X11PhysDev, metrics); ++ ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetTextMetrics(physDev->X11PhysDev, metrics); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetTextMetrics(physDev->X11PhysDev, metrics); ++ } ++ return res; + } + + /*********************************************************************** +@@ -76,8 +125,20 @@ BOOL DIBDRV_GetTextMetrics( DIBDRVPHYSDEV *physDev, TEXTMETRICW *metrics ) + BOOL DIBDRV_GetCharWidth( DIBDRVPHYSDEV *physDev, UINT firstChar, UINT lastChar, + LPINT buffer ) + { ++ BOOL res; ++ + TRACE("physDev:%p, firstChar:%d, lastChar:%d, buffer:%pn", physDev, firstChar, lastChar, buffer); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetCharWidth(physDev->X11PhysDev, firstChar, lastChar, buffer); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetCharWidth(physDev->X11PhysDev, firstChar, lastChar, buffer); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetCharWidth(physDev->X11PhysDev, firstChar, lastChar, buffer); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +index b746af2..b74c08e 100644 +--- a/dlls/winedib.drv/graphics.c ++++ b/dlls/winedib.drv/graphics.c +@@ -31,12 +31,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + BOOL DIBDRV_Arc( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, + INT xstart, INT ystart, INT xend, INT yend ) + { ++ BOOL res; ++ + TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", + physDev, left, top, right, bottom, xstart, ystart, xend, yend); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pArc(physDev->X11PhysDev, left, top, right, bottom, +- xstart, ystart, xend, yend); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pArc(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pArc(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++ } ++ return res; + } + + /*********************************************************************** +@@ -45,12 +58,25 @@ BOOL DIBDRV_Arc( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT botto + BOOL DIBDRV_Chord( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, + INT xstart, INT ystart, INT xend, INT yend ) + { ++ BOOL res; ++ + TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", + physDev, left, top, right, bottom, xstart, ystart, xend, yend); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pChord(physDev->X11PhysDev, left, top, right, bottom, +- xstart, ystart, xend, yend); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pChord(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pChord(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++ } ++ return res; + } + + /*********************************************************************** +@@ -58,11 +84,23 @@ BOOL DIBDRV_Chord( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bot + */ + BOOL DIBDRV_Ellipse( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom ) + { ++ BOOL res; ++ + TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", + physDev, left, top, right, bottom); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pEllipse(physDev->X11PhysDev, left, top, right, bottom); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pEllipse(physDev->X11PhysDev, left, top, right, bottom); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pEllipse(physDev->X11PhysDev, left, top, right, bottom); ++ } ++ return res; + } + + /********************************************************************** +@@ -71,11 +109,23 @@ BOOL DIBDRV_Ellipse( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT b + BOOL DIBDRV_ExtFloodFill( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color, + UINT fillType ) + { ++ BOOL res; ++ + TRACE("physDev:%p, x:%d, y:%d, color:%x, fillType:%d\n", + physDev, x, y, color, fillType); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pExtFloodFill(physDev->X11PhysDev, x, y, color, fillType); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pExtFloodFill(physDev->X11PhysDev, x, y, color, fillType); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pExtFloodFill(physDev->X11PhysDev, x, y, color, fillType); ++ } ++ return res; + } + + /*********************************************************************** +@@ -83,10 +133,22 @@ BOOL DIBDRV_ExtFloodFill( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color, + */ + BOOL DIBDRV_GetDCOrgEx( DIBDRVPHYSDEV *physDev, LPPOINT lpp ) + { ++ BOOL res; ++ + TRACE("physDev:%p, lpp:%p\n", physDev, lpp); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetDCOrgEx(physDev->X11PhysDev, lpp); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetDCOrgEx(physDev->X11PhysDev, lpp); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetDCOrgEx(physDev->X11PhysDev, lpp); ++ } ++ return res; + } + + /*********************************************************************** +@@ -94,10 +156,22 @@ BOOL DIBDRV_GetDCOrgEx( DIBDRVPHYSDEV *physDev, LPPOINT lpp ) + */ + COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y ) + { ++ COLORREF res; ++ + TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetPixel(physDev->X11PhysDev, x, y); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetPixel(physDev->X11PhysDev, x, y); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetPixel(physDev->X11PhysDev, x, y); ++ } ++ return res; + } + + /*********************************************************************** +@@ -105,10 +179,22 @@ COLORREF DIBDRV_GetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y ) + */ + BOOL DIBDRV_LineTo( DIBDRVPHYSDEV *physDev, INT x, INT y ) + { ++ BOOL res; ++ + TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pLineTo(physDev->X11PhysDev, x, y); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pLineTo(physDev->X11PhysDev, x, y); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pLineTo(physDev->X11PhysDev, x, y); ++ } ++ return res; + } + + /*********************************************************************** +@@ -116,10 +202,22 @@ BOOL DIBDRV_LineTo( DIBDRVPHYSDEV *physDev, INT x, INT y ) + */ + BOOL DIBDRV_PaintRgn( DIBDRVPHYSDEV *physDev, HRGN hrgn ) + { ++ BOOL res; ++ + TRACE("physDev:%p, hrgn:%p\n", physDev, hrgn); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pPaintRgn(physDev->X11PhysDev, hrgn); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pPaintRgn(physDev->X11PhysDev, hrgn); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pPaintRgn(physDev->X11PhysDev, hrgn); ++ } ++ return res; + } + + /*********************************************************************** +@@ -128,12 +226,25 @@ BOOL DIBDRV_PaintRgn( DIBDRVPHYSDEV *physDev, HRGN hrgn ) + BOOL DIBDRV_Pie( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom, + INT xstart, INT ystart, INT xend, INT yend ) + { ++ BOOL res; ++ + TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, xstart:%d, ystart:%d, xend:%d, yend:%d\n", + physDev, left, top, right, bottom, xstart, ystart, xend, yend); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pPie(physDev->X11PhysDev, left, top, right, bottom, +- xstart, ystart, xend, yend); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pPie(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pPie(physDev->X11PhysDev, left, top, right, bottom, ++ xstart, ystart, xend, yend); ++ } ++ return res; + } + + /********************************************************************** +@@ -141,10 +252,22 @@ BOOL DIBDRV_Pie( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT botto + */ + BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) + { ++ BOOL res; ++ + TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pPolygon(physDev->X11PhysDev, pt, count); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pPolygon(physDev->X11PhysDev, pt, count); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pPolygon(physDev->X11PhysDev, pt, count); ++ } ++ return res; + } + + /********************************************************************** +@@ -152,10 +275,22 @@ BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) + */ + BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) + { ++ BOOL res; ++ + TRACE("physDev:%p, pt:%p, count:%d\n", physDev, pt, count); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pPolyline(physDev->X11PhysDev, pt, count); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pPolyline(physDev->X11PhysDev, pt, count); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pPolyline(physDev->X11PhysDev, pt, count); ++ } ++ return res; + } + + /********************************************************************** +@@ -163,10 +298,22 @@ BOOL DIBDRV_Polyline( DIBDRVPHYSDEV *physDev, const POINT* pt, INT count ) + */ + BOOL DIBDRV_PolyPolygon( DIBDRVPHYSDEV *physDev, const POINT* pt, const INT* counts, UINT polygons) + { ++ BOOL res; ++ + TRACE("physDev:%p, pt:%p, counts:%p, polygons:%d\n", physDev, pt, counts, polygons); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pPolyPolygon(physDev->X11PhysDev, pt, counts, polygons); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pPolyPolygon(physDev->X11PhysDev, pt, counts, polygons); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pPolyPolygon(physDev->X11PhysDev, pt, counts, polygons); ++ } ++ return res; + } + + /********************************************************************** +@@ -175,10 +322,22 @@ BOOL DIBDRV_PolyPolygon( DIBDRVPHYSDEV *physDev, const POINT* pt, const INT* cou + BOOL DIBDRV_PolyPolyline( DIBDRVPHYSDEV *physDev, const POINT* pt, const DWORD* counts, + DWORD polylines ) + { ++ BOOL res; ++ + TRACE("physDev:%p, pt:%p, counts:%p, polylines:%d\n", physDev, pt, counts, polylines); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pPolyPolyline(physDev->X11PhysDev, pt, counts, polylines); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pPolyPolyline(physDev->X11PhysDev, pt, counts, polylines); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pPolyPolyline(physDev->X11PhysDev, pt, counts, polylines); ++ } ++ return res; + } + + /*********************************************************************** +@@ -186,11 +345,23 @@ BOOL DIBDRV_PolyPolyline( DIBDRVPHYSDEV *physDev, const POINT* pt, const DWORD* + */ + BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT bottom) + { ++ BOOL res; ++ + TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d\n", + physDev, left, top, right, bottom); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pRectangle(physDev->X11PhysDev, left, top, right, bottom); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pRectangle(physDev->X11PhysDev, left, top, right, bottom); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pRectangle(physDev->X11PhysDev, left, top, right, bottom); ++ } ++ return res; + } + + /*********************************************************************** +@@ -199,12 +370,25 @@ BOOL DIBDRV_Rectangle( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, INT + BOOL DIBDRV_RoundRect( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, + INT bottom, INT ell_width, INT ell_height ) + { ++ BOOL res; ++ + TRACE("physDev:%p, left:%d, top:%d, right:%d, bottom:%d, ell_width:%d, ell_height:%d\n", + physDev, left, top, right, bottom, ell_width, ell_height); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pRoundRect(physDev->X11PhysDev, left, top, right, bottom, +- ell_width, ell_height); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pRoundRect(physDev->X11PhysDev, left, top, right, bottom, ++ ell_width, ell_height); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pRoundRect(physDev->X11PhysDev, left, top, right, bottom, ++ ell_width, ell_height); ++ } ++ return res; + } + + /*********************************************************************** +@@ -212,10 +396,22 @@ BOOL DIBDRV_RoundRect( DIBDRVPHYSDEV *physDev, INT left, INT top, INT right, + */ + COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color ) + { ++ COLORREF res; ++ + TRACE("physDev:%p, x:%d, y:%d, color:%x\n", physDev, x, y, color); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetPixel(physDev->X11PhysDev, x, y, color); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetPixel(physDev->X11PhysDev, x, y, color); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetPixel(physDev->X11PhysDev, x, y, color); ++ } ++ return res; + } + + /*********************************************************************** +@@ -223,8 +419,20 @@ COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, INT x, INT y, COLORREF color ) + */ + DWORD DIBDRV_SetDCOrg( DIBDRVPHYSDEV *physDev, INT x, INT y ) + { ++ DWORD res; ++ + TRACE("physDev:%p, x:%d, y:%d\n", physDev, x, y); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetDCOrg(physDev->X11PhysDev, x, y); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetDCOrg(physDev->X11PhysDev, x, y); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetDCOrg(physDev->X11PhysDev, x, y); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/opengl.c b/dlls/winedib.drv/opengl.c +index 27e4229..e8ec96c 100644 +--- a/dlls/winedib.drv/opengl.c ++++ b/dlls/winedib.drv/opengl.c +@@ -30,10 +30,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + int DIBDRV_ChoosePixelFormat( DIBDRVPHYSDEV *physDev, + const PIXELFORMATDESCRIPTOR *ppfd ) + { ++ int res; ++ + TRACE("physDev:%p, ppfd:%p\n", physDev, ppfd); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pChoosePixelFormat(physDev->X11PhysDev, ppfd); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pChoosePixelFormat(physDev->X11PhysDev, ppfd); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pChoosePixelFormat(physDev->X11PhysDev, ppfd); ++ } ++ return res; + } + + int DIBDRV_DescribePixelFormat( DIBDRVPHYSDEV *physDev, +@@ -41,36 +53,84 @@ int DIBDRV_DescribePixelFormat( DIBDRVPHYSDEV *physDev, + UINT nBytes, + PIXELFORMATDESCRIPTOR *ppfd ) + { ++ int res; ++ + TRACE("physDev:%p, iPixelFormat:%d, nBytes:%d, ppfd:%p\n", physDev, iPixelFormat, nBytes, ppfd); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pDescribePixelFormat(physDev->X11PhysDev, iPixelFormat, nBytes, ppfd); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pDescribePixelFormat(physDev->X11PhysDev, iPixelFormat, nBytes, ppfd); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pDescribePixelFormat(physDev->X11PhysDev, iPixelFormat, nBytes, ppfd); ++ } ++ return res; + } + + int DIBDRV_GetPixelFormat( DIBDRVPHYSDEV *physDev) + { ++ int res; ++ + TRACE("physDev:%p\n", physDev); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetPixelFormat(physDev->X11PhysDev); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetPixelFormat(physDev->X11PhysDev); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetPixelFormat(physDev->X11PhysDev); ++ } ++ return res; + } + + BOOL DIBDRV_SetPixelFormat( DIBDRVPHYSDEV *physDev, + int iPixelFormat, + const PIXELFORMATDESCRIPTOR *ppfd ) + { ++ BOOL res; ++ + TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetPixelFormat(physDev->X11PhysDev, iPixelFormat, ppfd); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetPixelFormat(physDev->X11PhysDev, iPixelFormat, ppfd); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetPixelFormat(physDev->X11PhysDev, iPixelFormat, ppfd); ++ } ++ return res; + } + + BOOL DIBDRV_SwapBuffers( DIBDRVPHYSDEV *physDev ) + { ++ BOOL res; ++ + TRACE("physDev:%p\n", physDev); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSwapBuffers(physDev->X11PhysDev); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSwapBuffers(physDev->X11PhysDev); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSwapBuffers(physDev->X11PhysDev); ++ } ++ return res; + } + + /** +@@ -80,10 +140,14 @@ BOOL DIBDRV_SwapBuffers( DIBDRVPHYSDEV *physDev ) + */ + BOOL CDECL DIBDRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) + { ++ BOOL res; ++ + TRACE("hglrcSrc:%p, hglrcDst:%p, mask:%x\n", hglrcSrc, hglrcDst, mask); + + ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglCopyContext(hglrcSrc, hglrcDst, mask); ++ res = _DIBDRV_GetDisplayDriver()->pwglCopyContext(hglrcSrc, hglrcDst, mask); ++ ++ return res; + } + + /** +@@ -93,10 +157,22 @@ BOOL CDECL DIBDRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) + */ + HGLRC CDECL DIBDRV_wglCreateContext(DIBDRVPHYSDEV *physDev) + { ++ HGLRC res; ++ + TRACE("physDev:%p\n", physDev); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglCreateContext(physDev->X11PhysDev); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglCreateContext(physDev->X11PhysDev); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pwglCreateContext(physDev->X11PhysDev); ++ } ++ return res; + } + + /** +@@ -106,10 +182,13 @@ HGLRC CDECL DIBDRV_wglCreateContext(DIBDRVPHYSDEV *physDev) + */ + BOOL CDECL DIBDRV_wglDeleteContext(HGLRC hglrc) + { ++ BOOL res; ++ + TRACE("hglrc:%p\n", hglrc); + + ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglDeleteContext(hglrc); ++ res = _DIBDRV_GetDisplayDriver()->pwglDeleteContext(hglrc); ++ return res; + } + + /** +@@ -119,10 +198,14 @@ BOOL CDECL DIBDRV_wglDeleteContext(HGLRC hglrc) + */ + PROC CDECL DIBDRV_wglGetProcAddress(LPCSTR lpszProc) + { ++ PROC res; ++ + TRACE("lpszProc:%p\n", lpszProc); + + ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglGetProcAddress(lpszProc); ++ res = _DIBDRV_GetDisplayDriver()->pwglGetProcAddress(lpszProc); ++ ++ return res; + } + + /** +@@ -135,10 +218,22 @@ PROC CDECL DIBDRV_wglGetProcAddress(LPCSTR lpszProc) + */ + HDC CDECL DIBDRV_wglGetPbufferDCARB(DIBDRVPHYSDEV *physDev, HPBUFFERARB hPbuffer) + { ++ HDC res; ++ + TRACE("physDev:%p, hPbuffer:%p\n", physDev, hPbuffer); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglGetPbufferDCARB(physDev->X11PhysDev, hPbuffer); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglGetPbufferDCARB(physDev->X11PhysDev, hPbuffer); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pwglGetPbufferDCARB(physDev->X11PhysDev, hPbuffer); ++ } ++ return res; + } + + /** +@@ -148,10 +243,34 @@ HDC CDECL DIBDRV_wglGetPbufferDCARB(DIBDRVPHYSDEV *physDev, HPBUFFERARB hPbuffer + */ + BOOL CDECL DIBDRV_wglMakeContextCurrentARB(DIBDRVPHYSDEV* pDrawDev, DIBDRVPHYSDEV* pReadDev, HGLRC hglrc) + { ++ BOOL res; ++ + TRACE("pDrawDev:%p, pReadDev:%p, hglrc:%p\n", pDrawDev, pReadDev, hglrc); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev->X11PhysDev, pReadDev->X11PhysDev, hglrc); ++ if(pDrawDev->hasDIB && pReadDev->hasDIB) ++ { ++ /* DIB section selected both in source and dest DCs, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev->X11PhysDev, pReadDev->X11PhysDev, hglrc); ++ } ++ if(!pDrawDev->hasDIB && !pReadDev->hasDIB) ++ { ++ /* DDB selected both in source and dest DCs, use X11 Driver */ ++ res = _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev->X11PhysDev, pReadDev->X11PhysDev, hglrc); ++ } ++ else if(pDrawDev->hasDIB) ++ { ++ /* DIB selected in pDrawDev, must convert pReadDev to DIB and use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev->X11PhysDev, pReadDev->X11PhysDev, hglrc); ++ } ++ else /* if(pReadDev->hasDIB) */ ++ { ++ /* DIB selected in pReadDev, must convert pReadDev to DDB and use X11 Driver */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev->X11PhysDev, pReadDev->X11PhysDev, hglrc); ++ } ++ return res; + } + + /** +@@ -161,10 +280,22 @@ BOOL CDECL DIBDRV_wglMakeContextCurrentARB(DIBDRVPHYSDEV* pDrawDev, DIBDRVPHYSDE + */ + BOOL CDECL DIBDRV_wglMakeCurrent(DIBDRVPHYSDEV *physDev, HGLRC hglrc) + { ++ BOOL res; ++ + TRACE("physDev:%p, hglrc:%p\n", physDev, hglrc); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglMakeCurrent(physDev->X11PhysDev, hglrc); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglMakeCurrent(physDev->X11PhysDev, hglrc); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pwglMakeCurrent(physDev->X11PhysDev, hglrc); ++ } ++ return res; + } + + /** +@@ -175,10 +306,22 @@ BOOL CDECL DIBDRV_wglMakeCurrent(DIBDRVPHYSDEV *physDev, HGLRC hglrc) + */ + BOOL CDECL DIBDRV_wglSetPixelFormatWINE(DIBDRVPHYSDEV *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) + { ++ BOOL res; ++ + TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev, iPixelFormat, ppfd); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglSetPixelFormatWINE(physDev->X11PhysDev, iPixelFormat, ppfd); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglSetPixelFormatWINE(physDev->X11PhysDev, iPixelFormat, ppfd); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pwglSetPixelFormatWINE(physDev->X11PhysDev, iPixelFormat, ppfd); ++ } ++ return res; + } + + /** +@@ -188,10 +331,14 @@ BOOL CDECL DIBDRV_wglSetPixelFormatWINE(DIBDRVPHYSDEV *physDev, int iPixelFormat + */ + BOOL CDECL DIBDRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) + { ++ BOOL res; ++ + TRACE("hglrc1:%p, hglrc2:%p\n", hglrc1, hglrc2); + + ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglShareLists(hglrc1, hglrc2); ++ res = _DIBDRV_GetDisplayDriver()->pwglShareLists(hglrc1, hglrc2); ++ ++ return res; + } + + /** +@@ -201,10 +348,22 @@ BOOL CDECL DIBDRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) + */ + BOOL CDECL DIBDRV_wglUseFontBitmapsA(DIBDRVPHYSDEV *physDev, DWORD first, DWORD count, DWORD listBase) + { ++ BOOL res; ++ + TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsA(physDev->X11PhysDev, first, count, listBase); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsA(physDev->X11PhysDev, first, count, listBase); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsA(physDev->X11PhysDev, first, count, listBase); ++ } ++ return res; + } + + /** +@@ -214,8 +373,20 @@ BOOL CDECL DIBDRV_wglUseFontBitmapsA(DIBDRVPHYSDEV *physDev, DWORD first, DWORD + */ + BOOL CDECL DIBDRV_wglUseFontBitmapsW(DIBDRVPHYSDEV *physDev, DWORD first, DWORD count, DWORD listBase) + { ++ BOOL res; ++ + TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev, first, count, listBase); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsW(physDev->X11PhysDev, first, count, listBase); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsW(physDev->X11PhysDev, first, count, listBase); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsW(physDev->X11PhysDev, first, count, listBase); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/palette.c b/dlls/winedib.drv/palette.c +index 28fae09..9daf47d 100644 +--- a/dlls/winedib.drv/palette.c ++++ b/dlls/winedib.drv/palette.c +@@ -30,10 +30,21 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + */ + UINT DIBDRV_RealizePalette( DIBDRVPHYSDEV *physDev, HPALETTE hpal, BOOL primary ) + { ++ UINT res; ++ + TRACE("physDev:%p, hpal:%p, primary:%s\n", physDev, hpal, (primary ? "TRUE" : "FALSE")); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pRealizePalette(physDev->X11PhysDev, hpal, primary); ++ /* we should in any case call X11 function, as UnrealizePalette() doesn't ++ * take a physDev parameter */ ++ res = _DIBDRV_GetDisplayDriver()->pRealizePalette(physDev->X11PhysDev, hpal, primary); ++ ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, additional (if needed) engine code */ ++ ONCE(FIXME("STUB\n")); ++ } ++ ++ return res; + } + + /*********************************************************************** +@@ -41,10 +52,18 @@ UINT DIBDRV_RealizePalette( DIBDRVPHYSDEV *physDev, HPALETTE hpal, BOOL primary + */ + BOOL DIBDRV_UnrealizePalette( HPALETTE hpal ) + { ++ BOOL res; ++ + TRACE("hpal:%p\n", hpal); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pUnrealizePalette(hpal); ++ /* we should in any case call X11 function, as UnrealizePalette() doesn't ++ * take a physDev parameter */ ++ res = _DIBDRV_GetDisplayDriver()->pUnrealizePalette(hpal); ++ ++ /* additional Engine code here, if needed */ ++ ONCE(FIXME("STUB\n")); ++ ++ return res; + } + + /*********************************************************************** +@@ -53,10 +72,22 @@ BOOL DIBDRV_UnrealizePalette( HPALETTE hpal ) + UINT DIBDRV_GetSystemPaletteEntries( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + LPPALETTEENTRY entries ) + { ++ UINT res; ++ + TRACE("physDev:%p, start:%d, count:%d, entries:%p\n", physDev, start, count, entries); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetSystemPaletteEntries(physDev->X11PhysDev, start, count, entries); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetSystemPaletteEntries(physDev->X11PhysDev, start, count, entries); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetSystemPaletteEntries(physDev->X11PhysDev, start, count, entries); ++ } ++ return res; + } + + /*********************************************************************** +@@ -64,10 +95,22 @@ UINT DIBDRV_GetSystemPaletteEntries( DIBDRVPHYSDEV *physDev, UINT start, UINT co + */ + COLORREF DIBDRV_GetNearestColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + { ++ COLORREF res; ++ + TRACE("physDev:%p, color:%x\n", physDev, color); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetNearestColor(physDev->X11PhysDev, color); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetNearestColor(physDev->X11PhysDev, color); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetNearestColor(physDev->X11PhysDev, color); ++ } ++ return res; + } + + /*********************************************************************** +@@ -75,16 +118,40 @@ COLORREF DIBDRV_GetNearestColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + */ + UINT DIBDRV_RealizeDefaultPalette( DIBDRVPHYSDEV *physDev ) + { ++ UINT res; ++ + TRACE("physDev:%p\n", physDev); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pRealizeDefaultPalette(physDev->X11PhysDev); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pRealizeDefaultPalette(physDev->X11PhysDev); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pRealizeDefaultPalette(physDev->X11PhysDev); ++ } ++ return res; + } + + BOOL DIBDRV_GetICMProfile(DIBDRVPHYSDEV *physDev, LPDWORD lpcbName, LPWSTR lpszFilename) + { ++ BOOL res; ++ + TRACE("physDev:%p, lpcpName:%p, lpszFilename:%p\n", physDev, lpcbName, lpszFilename); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetICMProfile(physDev->X11PhysDev, lpcbName, lpszFilename); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetICMProfile(physDev->X11PhysDev, lpcbName, lpszFilename); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetICMProfile(physDev->X11PhysDev, lpcbName, lpszFilename); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/pen_brush.c b/dlls/winedib.drv/pen_brush.c +index 1e992e0..bde2f23 100644 +--- a/dlls/winedib.drv/pen_brush.c ++++ b/dlls/winedib.drv/pen_brush.c +@@ -31,10 +31,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + */ + HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen ) + { ++ HPEN res; ++ + TRACE("physDev:%p, hpen:%p\n", physDev, hpen); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSelectPen(physDev->X11PhysDev, hpen); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSelectPen(physDev->X11PhysDev, hpen); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSelectPen(physDev->X11PhysDev, hpen); ++ } ++ return res; + } + + /*********************************************************************** +@@ -42,10 +54,22 @@ HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen ) + */ + COLORREF DIBDRV_SetDCPenColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) + { ++ COLORREF res; ++ + TRACE("physDev:%p, crColor:%x\n", physDev, crColor); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetDCPenColor(physDev->X11PhysDev, crColor); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetDCPenColor(physDev->X11PhysDev, crColor); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetDCPenColor(physDev->X11PhysDev, crColor); ++ } ++ return res; + } + + /*********************************************************************** +@@ -53,10 +77,22 @@ COLORREF DIBDRV_SetDCPenColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) + */ + HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + { ++ HBRUSH res; ++ + TRACE("physDev:%p, hbrush:%p\n", physDev, hbrush); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSelectBrush(physDev->X11PhysDev, hbrush); ++ } ++ return res; + } + + /*********************************************************************** +@@ -64,10 +100,22 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + */ + COLORREF DIBDRV_SetDCBrushColor( DIBDRVPHYSDEV *physDev, COLORREF crColor ) + { ++ COLORREF res; ++ + TRACE("physDev:%p, crColor:%x\n", physDev, crColor); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetDCBrushColor(physDev->X11PhysDev, crColor); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetDCBrushColor(physDev->X11PhysDev, crColor); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetDCBrushColor(physDev->X11PhysDev, crColor); ++ } ++ return res; + } + + /*********************************************************************** +@@ -79,7 +127,6 @@ INT DIBDRV_SetROP2( DIBDRVPHYSDEV *physDev, INT rop ) + + TRACE("physDev:%p, rop:%x\n", physDev, rop); + +- ONCE(FIXME("stub\n")); + prevRop = physDev->rop2; + physDev->rop2 = rop; + return prevRop; +@@ -91,8 +138,20 @@ INT DIBDRV_SetROP2( DIBDRVPHYSDEV *physDev, INT rop ) + */ + COLORREF DIBDRV_SetBkColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + { ++ COLORREF res; ++ + TRACE("physDev:%p, color:%x\n", physDev, color); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetBkColor(physDev->X11PhysDev, color); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetBkColor(physDev->X11PhysDev, color); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetBkColor(physDev->X11PhysDev, color); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/text.c b/dlls/winedib.drv/text.c +index fdb075f..0176011 100644 +--- a/dlls/winedib.drv/text.c ++++ b/dlls/winedib.drv/text.c +@@ -28,17 +28,29 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + /*********************************************************************** + * DIBDRV_ExtTextOut + */ +-BOOL +-DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, +- const RECT *lprect, LPCWSTR wstr, UINT count, +- const INT *lpDx ) ++BOOL DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, ++ const RECT *lprect, LPCWSTR wstr, UINT count, ++ const INT *lpDx ) + { ++ BOOL res; ++ + TRACE("physDev:%p, x:%d, y:%d, flags:%x, lprect:%p, wstr:%s, count:%d, lpDx:%p\n", + physDev, x, y, flags, lprect, debugstr_w(wstr), count, lpDx); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pExtTextOut(physDev->X11PhysDev, x, y, flags, lprect, ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pExtTextOut(physDev->X11PhysDev, x, y, flags, lprect, + wstr, count, lpDx); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pExtTextOut(physDev->X11PhysDev, x, y, flags, lprect, ++ wstr, count, lpDx); ++ } ++ return res; + } + + /*********************************************************************** +@@ -47,9 +59,23 @@ DIBDRV_ExtTextOut( DIBDRVPHYSDEV *physDev, INT x, INT y, UINT flags, + BOOL DIBDRV_GetTextExtentExPoint( DIBDRVPHYSDEV *physDev, LPCWSTR str, INT count, + INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size ) + { ++ BOOL res; ++ + TRACE("physDev:%p, str:%s, count:%d, maxExt:%d, lpnFit:%p, alpDx:%p, size:%p\n", + physDev, debugstr_w(str), count, maxExt, lpnFit, alpDx, size); +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetTextExtentExPoint(physDev->X11PhysDev, str, count, maxExt, +- lpnFit, alpDx, size); ++ ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetTextExtentExPoint(physDev->X11PhysDev, str, count, maxExt, ++ lpnFit, alpDx, size); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetTextExtentExPoint(physDev->X11PhysDev, str, count, maxExt, ++ lpnFit, alpDx, size); ++ } ++ return res; + } +diff --git a/dlls/winedib.drv/video.c b/dlls/winedib.drv/video.c +index 6490ac6..730e62a 100644 +--- a/dlls/winedib.drv/video.c ++++ b/dlls/winedib.drv/video.c +@@ -30,10 +30,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + */ + BOOL DIBDRV_GetDeviceGammaRamp( DIBDRVPHYSDEV *physDev, LPVOID ramp ) + { ++ BOOL res; ++ + TRACE("physDev:%p, ramp:%p\n", physDev, ramp); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pGetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pGetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++ } ++ return res; + } + + /*********************************************************************** +@@ -41,8 +53,20 @@ BOOL DIBDRV_GetDeviceGammaRamp( DIBDRVPHYSDEV *physDev, LPVOID ramp ) + */ + BOOL DIBDRV_SetDeviceGammaRamp( DIBDRVPHYSDEV *physDev, LPVOID ramp ) + { ++ BOOL res; ++ + TRACE("physDev:%p, ramp:%p\n", physDev, ramp); + +- ONCE(FIXME("stub\n")); +- return _DIBDRV_GetDisplayDriver()->pSetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ONCE(FIXME("TEMPORARY - fallback to X11 driver\n")); ++ res = _DIBDRV_GetDisplayDriver()->pSetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++ } ++ else ++ { ++ /* DDB selected in, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetDeviceGammaRamp(physDev->X11PhysDev, ramp); ++ } ++ return res; + } --- wine1.2-1.1.43.orig/debian/patches/dibeng-0012.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0012.patch @@ -0,0 +1,69 @@ +DIB Engine: fix color in antialiased fonts + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/primitives_font.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + + +diff --git a/dlls/winedib.drv/primitives_font.c b/dlls/winedib.drv/primitives_font.c +index a2824a5..c051668 100644 +--- a/dlls/winedib.drv/primitives_font.c ++++ b/dlls/winedib.drv/primitives_font.c +@@ -69,7 +69,7 @@ void _DIBDRV_freetype_blit_8888(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clip + b = *ptr & 0xff; + c += MulDiv(r, 255 - *buf, 255) << 16 | + MulDiv(g, 255 - *buf, 255) << 8 | +- MulDiv(r, 255 - *buf, 255); ++ MulDiv(b, 255 - *buf, 255); + } + #endif + *ptr = c; +@@ -122,7 +122,7 @@ void _DIBDRV_freetype_blit_32_RGB(DIBDRVPHYSDEV *physDev, int x, int y, RECT *cl + b = *ptr & 0xff; + c += MulDiv(r, 255 - *buf, 255) << 16 | + MulDiv(g, 255 - *buf, 255) << 8 | +- MulDiv(r, 255 - *buf, 255); ++ MulDiv(b, 255 - *buf, 255); + } + #endif + *ptr = c; +@@ -175,7 +175,7 @@ void _DIBDRV_freetype_blit_32_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, RE + b = (pix >> 16) & 0xff; + c += MulDiv(r, 255 - *buf, 255) << 16 | + MulDiv(g, 255 - *buf, 255) << 8 | +- MulDiv(r, 255 - *buf, 255); ++ MulDiv(b, 255 - *buf, 255); + } + #endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); +@@ -227,7 +227,7 @@ void _DIBDRV_freetype_blit_24(DIBDRVPHYSDEV *physDev, int x, int y, RECT *clipRe + b = (pix >> 16) & 0xff; + c += MulDiv(r, 255 - *buf, 255) << 16 | + MulDiv(g, 255 - *buf, 255) << 8 | +- MulDiv(r, 255 - *buf, 255); ++ MulDiv(b, 255 - *buf, 255); + } + #endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); +@@ -279,7 +279,7 @@ void _DIBDRV_freetype_blit_16_RGB(DIBDRVPHYSDEV *physDev, int x, int y, RECT *cl + b = (pix >> 16) & 0xff; + c += MulDiv(r, 255 - *buf, 255) << 16 | + MulDiv(g, 255 - *buf, 255) << 8 | +- MulDiv(r, 255 - *buf, 255); ++ MulDiv(b, 255 - *buf, 255); + } + #endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); +@@ -331,7 +331,7 @@ void _DIBDRV_freetype_blit_16_BITFIELDS(DIBDRVPHYSDEV *physDev, int x, int y, RE + b = (pix >> 16) & 0xff; + c += MulDiv(r, 255 - *buf, 255) << 16 | + MulDiv(g, 255 - *buf, 255) << 8 | +- MulDiv(r, 255 - *buf, 255); ++ MulDiv(b, 255 - *buf, 255); + } + #endif + dib->funcs->SetPixel(dib, dibX, dibY, 0, c); --- wine1.2-1.1.43.orig/debian/patches/series +++ wine1.2-1.1.43/debian/patches/series @@ -0,0 +1,21 @@ +desktop-launcher-noexec +ddraw.patch +dibeng-0001.patch +dibeng-0002.patch +dibeng-0003.patch +dibeng-0004.patch +dibeng-0005.patch +dibeng-0006.patch +dibeng-0007.patch +dibeng-0008.patch +dibeng-0009.patch +dibeng-0010.patch +dibeng-0011.patch +dibeng-0012.patch +dibeng-0013.patch +dibeng-0014.patch +dibeng-0015.patch +winepulse-0.36.patch +winepulse-0.34-winecfg.patch +winepulse-0.35-configure.ac.patch +wine-hacks-configure.patch --- wine1.2-1.1.43.orig/debian/patches/dibeng-0009.patch +++ wine1.2-1.1.43/debian/patches/dibeng-0009.patch @@ -0,0 +1,1695 @@ +DIB Engine: fixes against wine tests + +From: Massimo Del Fedele + + +--- + + dlls/winedib.drv/bitblt.c | 68 +++--- + dlls/winedib.drv/convert.c | 16 + + dlls/winedib.drv/dc.c | 32 +-- + dlls/winedib.drv/dib.c | 405 ++++++++++++++++++++++++++++++++- + dlls/winedib.drv/dibdrv.h | 27 ++ + dlls/winedib.drv/dibdrvbitmap.c | 124 ++++++++++ + dlls/winedib.drv/graphics.c | 10 + + dlls/winedib.drv/palette.c | 63 +++++ + dlls/winedib.drv/pen_brush.c | 95 ++++++-- + dlls/winedib.drv/primitives_bitblt.c | 18 + + dlls/winedib.drv/primitives_color.c | 71 ++++-- + dlls/winedib.drv/primitives_convert.c | 66 ++++- + dlls/winedib.drv/primitives_pixel.c | 44 ++-- + 13 files changed, 883 insertions(+), 156 deletions(-) + + +diff --git a/dlls/winedib.drv/bitblt.c b/dlls/winedib.drv/bitblt.c +index db66142..97feefd 100644 +--- a/dlls/winedib.drv/bitblt.c ++++ b/dlls/winedib.drv/bitblt.c +@@ -82,7 +82,7 @@ static BOOL BitBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *sz, RECT*srcClip, RECT* + ys1 = ps->y; + xs2 = xs1 + w; + ys2 = ys1 + h; +- ++ + /* if source clip area is not null, do first clipping on it */ + if(srcClip) + { +@@ -91,7 +91,7 @@ static BOOL BitBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *sz, RECT*srcClip, RECT* + ysc1 = srcClip->top; + xsc2 = srcClip->right; + ysc2 = srcClip->bottom; +- ++ + /* order clip area rectangle points */ + if(xsc1 > xsc2) intSwap(&xsc1, &xsc2); + if(ysc1 > ysc2) intSwap(&ysc1, &ysc2); +@@ -103,13 +103,12 @@ static BOOL BitBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *sz, RECT*srcClip, RECT* + /* clip on source clipping end point */ + if(xs2 > xsc2) { dx = xs2 - xsc2; w -= dx; xd2 -= dx; xs2 = xsc2; } + if(ys2 > ysc2) { dy = ys2 - ysc2; h -= dy; yd2 -= dy; ys2 = ysc2; } +- ++ + /* if already zero area, return false */ + if(w <= 0 || h <= 0) + return FALSE; + } + /* now do clipping on destination area */ +- + if(dstClip) + { + /* extract destination clipping area */ +@@ -117,7 +116,7 @@ static BOOL BitBlt_ClipAreas(POINT *ps, POINT *pd, SIZE *sz, RECT*srcClip, RECT* + ydc1 = dstClip->top; + xdc2 = dstClip->right; + ydc2 = dstClip->bottom; +- ++ + /* order clip area rectangle points */ + if(xdc1 > xdc2) intSwap(&xdc1, &xdc2); + if(ydc1 > ydc2) intSwap(&ydc1, &ydc2); +@@ -267,6 +266,13 @@ BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + _DIBDRV_Sizes_ws2ds(physDevDst, &widthDst, &heightDst); + _DIBDRV_Position_ws2ds(physDevSrc, &xSrc, &ySrc); + _DIBDRV_Sizes_ws2ds(physDevSrc, &widthSrc, &heightSrc); ++ ++ /* from tests, it seems that negative coords on phys space are not allowed */ ++ if(xDst < 0 || yDst < 0 || xSrc < 0 || ySrc < 0) ++ { ++ SetLastError(ERROR_INVALID_PARAMETER); ++ return FALSE; ++ } + + /* first clip on physical DC sizes */ + setPoint(&pd, xDst, yDst); +@@ -282,7 +288,7 @@ BOOL _DIBDRV_InternalAlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + else + res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, 0, &dstClip); + if(!res) +- return FALSE; ++ return TRUE; + xDst = pd.x; yDst = pd.y; + xSrc = ps.x; ySrc = ps.y; + widthDst = szDst.cx; heightDst = szDst.cy; +@@ -317,9 +323,7 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + BOOL res; + + POINT pd = {xDst, yDst}; +- POINT ps = {xSrc, ySrc}; + SIZE szDst = {widthDst, heightDst}; +- SIZE szSrc = {widthSrc, heightSrc}; + + MAYBE(TRACE("physDevDst:%p(%s%s), xDst:%d, yDst:%d, widthDst:%d, heightDst:%d, physDevSrc:%p(%s%s), xSrc:%d, ySrc:%d, widthSrc:%d, heightSrc:%d\n", + physDevDst, physDevDst->hasDIB ? "DIB-" : "DDB", physDevDst->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevDst->physBitmap) : "", +@@ -327,10 +331,12 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + physDevSrc, physDevSrc->hasDIB ? "DIB-" : "DDB", physDevSrc->hasDIB ? _DIBDRVBITMAP_GetFormatName(&physDevSrc->physBitmap) : "", + xSrc, ySrc, widthSrc, heightSrc)); + +- /* if sizes are null or negative, returns false */ +- if(widthSrc <= 0 || heightSrc <= 0 || widthDst <= 0 || heightDst <= 0) ++ /* if sizes are null or negative, or source positions are negatives, returns false */ ++ if(widthSrc <= 0 || heightSrc <= 0 || ++ widthDst <= 0 || heightDst <= 0) + { + res = FALSE; ++ SetLastError(ERROR_INVALID_PARAMETER); + goto fin; + } + +@@ -360,18 +366,25 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + /* DDB selected on dest DC -- must double-convert */ + HBITMAP tmpDIB, stock; + HDC tmpDC; +- RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; + MAYBE(TRACE("Blending DIB->DDB\n")); + +- /* clip blit area */ +- res = StretchBlt_ClipAreas(&ps, &pd, &szSrc, &szDst, &srcClip, 0); +- if(!res) ++ /* we should anyways convert dest to physical coordinates here before processing ++ in order to check its consistency -- source coords will be converted/clipped later ++ As we do a conversion to a temporary DIB for destination, we don't care about it */ ++ _DIBDRV_Position_ws2ds(physDevDst, &pd.x, &pd.y); ++ _DIBDRV_Sizes_ws2ds(physDevDst, &szDst.cx, &szDst.cy); ++ ++ /* test shows that negatives origins are not allowed */ ++ if(pd.x < 0 || pd.y < 0) ++ { ++ SetLastError(ERROR_INVALID_PARAMETER); ++ res = FALSE; + goto fin; +- xDst = pd.x; yDst = pd.y; widthDst = szDst.cx; heightDst = szDst.cy; +- xSrc = ps.x; ySrc = ps.y; widthSrc = szSrc.cx; heightSrc = szSrc.cy; ++ } + + /* converts dest DDB onto a temporary DIB -- just the needed part */ +- tmpDIB = _DIBDRV_ConvertDevDDBtoDIB(physDevDst->hdc, physDevSrc->hdc, xDst, yDst, widthDst, heightDst); ++ /* WARNING -- that one could fail if rectangle on dest id out of range */ ++ tmpDIB = _DIBDRV_ConvertDevDDBtoDIB(physDevDst->hdc, physDevSrc->hdc, pd.x, pd.y, szDst.cx, szDst.cy); + if(!tmpDIB) + { + ERR("Couldn't convert dest DDB to DIB\n"); +@@ -399,7 +412,7 @@ BOOL DIBDRV_AlphaBlend( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, INT width + } + + /* blends source DIB onto temp DIB and re-blits onto dest DC */ +- res = GdiAlphaBlend(tmpDC, 0, 0, widthDst, heightDst, physDevSrc->hdc, xSrc, ySrc, widthSrc, heightSrc, blendfn); ++ res = GdiAlphaBlend(tmpDC, 0, 0, szDst.cx, szDst.cy, physDevSrc->hdc, xSrc, ySrc, widthSrc, heightSrc, blendfn); + if(!res) + MAYBE(TRACE("AlphaBlend failed\n")); + else +@@ -438,6 +451,7 @@ BOOL _DIBDRV_InternalBitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setPoint(&ps, xSrc, ySrc); + setSize(&sz, width, height); + setRect(&dstClip, 0, 0, physDevDst->physBitmap.width, physDevDst->physBitmap.height); ++ + if(physDevSrc) + { + setRect(&srcClip, 0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height); +@@ -446,13 +460,13 @@ BOOL _DIBDRV_InternalBitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + else + res = BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); + if(!res) +- return FALSE; ++ return TRUE; + xDst = pd.x; yDst = pd.y; + xSrc = ps.x; ySrc = ps.y; + width = sz.cx; height = sz.cy; + + /* then, do blitting for each dest clip area (no clipping on source) */ +- res = FALSE; ++ res = TRUE; + for(iRec = 0; iRec < physDevDst->regionRectCount; iRec++) + { + RECT *r = physDevDst->regionRects + iRec; +@@ -462,8 +476,8 @@ BOOL _DIBDRV_InternalBitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + setSize(&sz, width, height); + if(!BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip)) + continue; +- if(physDevDst->physBitmap.funcs->BitBlt(physDevDst, pd.x, pd.y, sz.cx, sz.cy, physDevSrc, ps.x, ps.y, rop)) +- res = TRUE; ++ if(!physDevDst->physBitmap.funcs->BitBlt(physDevDst, pd.x, pd.y, sz.cx, sz.cy, physDevSrc, ps.x, ps.y, rop)) ++ res = FALSE; + } + return res; + } +@@ -503,8 +517,8 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + /* source is a DDB, must convert it to DIB */ + + /* don't clip on source */ +- res = BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); +- if(!res) ++ res = !BitBlt_ClipAreas(&ps, &pd, &sz, 0, &dstClip); ++ if(res) + goto noBlt2; + xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; + +@@ -596,11 +610,11 @@ BOOL DIBDRV_BitBlt( DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + if(physDevSrc) + { + RECT srcClip = {0, 0, physDevSrc->physBitmap.width, physDevSrc->physBitmap.height}; +- res = BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, 0); ++ res = !BitBlt_ClipAreas(&ps, &pd, &sz, &srcClip, 0); + } + else +- res = TRUE; +- if(!res) ++ res = FALSE; ++ if(res) + goto noBlt3; + xDst = pd.x; yDst = pd.y; width = sz.cx; height = sz.cy; xSrc = ps.x; ySrc = ps.y; + +diff --git a/dlls/winedib.drv/convert.c b/dlls/winedib.drv/convert.c +index dc18e14..2f20ac1 100644 +--- a/dlls/winedib.drv/convert.c ++++ b/dlls/winedib.drv/convert.c +@@ -51,7 +51,7 @@ HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int sca + HDC tmpHdc; + HBITMAP tmpBmp; + int res; +- ++ + /* gets DIBSECTION data from source DIB */ + if(GetObjectW(srcBmp, sizeof(DIBSECTION), &ds) != sizeof(DIBSECTION)) + { +@@ -87,13 +87,10 @@ HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int sca + + /* gets the size of DIB palette and bitfields, if any */ + bitFields = 0; +- if(ds.dsBmih.biBitCount > 8) +- { +- colorUsed = 0; +- if(ds.dsBmih.biCompression == BI_BITFIELDS) ++ colorUsed = 0; ++ if(ds.dsBmih.biCompression == BI_BITFIELDS) + bitFields = 3; +- } +- else ++ else if(ds.dsBmih.biBitCount <= 8) + { + colorUsed = ds.dsBmih.biClrUsed; + if(!colorUsed) +@@ -131,9 +128,11 @@ HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int sca + HeapFree(GetProcessHeap(), 0, bmi); + return 0; + } +- GetDIBColorTable(tmpHdc, 0, colorUsed, bmi->bmiColors); ++ if(!GetDIBColorTable(tmpHdc, 0, colorUsed, bmi->bmiColors)) ++ ERR("GetDIBColorTable failed\n"); + SelectObject(tmpHdc, tmpBmp); + DeleteDC(tmpHdc); ++ + } + + /* fill the bitfields part, if any */ +@@ -165,6 +164,7 @@ HBITMAP _DIBDRV_ConvertDIBtoDDB( HDC hdc, HBITMAP srcBmp, int startScan, int sca + DeleteObject( hBmp ); + return 0; + } ++ + return hBmp; + } + +diff --git a/dlls/winedib.drv/dc.c b/dlls/winedib.drv/dc.c +index 9ffceee..f5324b0 100644 +--- a/dlls/winedib.drv/dc.c ++++ b/dlls/winedib.drv/dc.c +@@ -80,6 +80,10 @@ static DWORD get_dpi( void ) + return dpi; + } + ++/* dummy function for pen/brush drawing primitives initializations */ ++static void dummy4(DIBDRVPHYSDEV *physDev, int a, int b, int c) {} ; ++static void dummy5(DIBDRVPHYSDEV *physDev, int a, int b, int c, int d) {} ; ++ + /********************************************************************** + * device_init + * +@@ -120,10 +124,6 @@ static void device_init(void) + device_init_done = TRUE; + } + +-/* dummy null function for pen and brush */ +-static void dummy3(DIBDRVPHYSDEV *p, int a, int b, int c) {} +-static void dummy4(DIBDRVPHYSDEV *p, int a, int b, int c, int d) {} +- + /********************************************************************** + * DIBDRV_CreateDC + */ +@@ -180,22 +180,24 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + physDev->backgroundColor = 0; + _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->backgroundAnd, &physDev->backgroundXor); + ++ /* stock pen */ ++ physDev->penStyle = PS_NULL; + physDev->penColor = 0; ++ physDev->penColorref = 0; + _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->penAnd, &physDev->penXor); +- +- physDev->penStyle = PS_NULL; +- physDev->penHLine = dummy3; +- physDev->penVLine = dummy3; +- physDev->penLine = dummy4; ++ physDev->penHLine = dummy4; ++ physDev->penVLine = dummy4; ++ physDev->penLine = dummy5; + physDev->penPattern = NULL; + +- physDev->brushColor = 0; +- _DIBDRV_CalcAndXorMasks(physDev->rop2, 0, &physDev->brushAnd, &physDev->brushXor); ++ /* stock brush */ ++ physDev->brushStyle = BS_NULL; ++ physDev->brushColor = 0x0; ++ physDev->brushColorref = 0x0; ++ _DIBDRV_CalcAndXorMasks(physDev->rop2, 0x0, &physDev->brushAnd, &physDev->brushXor); + physDev->brushAnds = NULL; + physDev->brushXors = NULL; +- +- physDev->brushStyle = BS_NULL; +- physDev->brushHLine = dummy3; ++ physDev->brushHLine = dummy4; + + physDev->isBrushBitmap = FALSE; + _DIBDRVBITMAP_Clear(&physDev->brushBitmap); +@@ -215,7 +217,7 @@ BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR dev + + /* sets the result value and returns */ + *pdev = physDev; +- ++ + return TRUE; + } + +diff --git a/dlls/winedib.drv/dib.c b/dlls/winedib.drv/dib.c +index 653148d..41fb158 100644 +--- a/dlls/winedib.drv/dib.c ++++ b/dlls/winedib.drv/dib.c +@@ -25,6 +25,43 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++/* Default 1 BPP palette */ ++static DWORD pal1[] = ++{ ++ 0x000000, ++ 0xffffff ++}; ++ ++/* Default 4 BPP palette */ ++static DWORD pal4[] = ++{ ++ 0x000000,0x800000,0x008000,0x808000, ++ 0x000080,0x800080,0x008080,0x808080, ++ 0xc0c0c0,0xff0000,0x00ff00,0xffff00, ++ 0x0000ff,0xff00ff,0x00ffff,0xffffff ++}; ++ ++/* Default 8 BPP palette */ ++static DWORD pal8[] = ++{ ++ 0x000000,0x800000,0x008000,0x808000,0x000080,0x800080,0x008080,0xc0c0c0,0xc0dcc0,0xa6caf0,0x000000,0x000033,0x000066,0x000099,0x0000cc,0x0000ff, ++ 0x003300,0x003333,0x003366,0x003399,0x0033cc,0x0033ff,0x006600,0x006633,0x006666,0x006699,0x0066cc,0x0066ff,0x009900,0x009933,0x009966,0x009999, ++ 0x0099cc,0x0099ff,0x00cc00,0x00cc33,0x00cc66,0x00cc99,0x00cccc,0x00ccff,0x00ff00,0x00ff33,0x00ff66,0x00ff99,0x00ffcc,0x00ffff,0x330000,0x330033, ++ 0x330066,0x330099,0x3300cc,0x3300ff,0x333300,0x333333,0x333366,0x333399,0x3333cc,0x3333ff,0x336600,0x336633,0x336666,0x336699,0x3366cc,0x3366ff, ++ 0x339900,0x339933,0x339966,0x339999,0x3399cc,0x3399ff,0x33cc00,0x33cc33,0x33cc66,0x33cc99,0x33cccc,0x33ccff,0x33ff00,0x33ff33,0x33ff66,0x33ff99, ++ 0x33ffcc,0x33ffff,0x660000,0x660033,0x660066,0x660099,0x6600cc,0x6600ff,0x663300,0x663333,0x663366,0x663399,0x6633cc,0x6633ff,0x666600,0x666633, ++ 0x666666,0x666699,0x6666cc,0x6666ff,0x669900,0x669933,0x669966,0x669999,0x6699cc,0x6699ff,0x66cc00,0x66cc33,0x66cc66,0x66cc99,0x66cccc,0x66ccff, ++ 0x66ff00,0x66ff33,0x66ff66,0x66ff99,0x66ffcc,0x66ffff,0x990000,0x990033,0x990066,0x990099,0x9900cc,0x9900ff,0x993300,0x993333,0x993366,0x993399, ++ 0x9933cc,0x9933ff,0x996600,0x996633,0x996666,0x996699,0x9966cc,0x9966ff,0x999900,0x999933,0x999966,0x999999,0x9999cc,0x9999ff,0x99cc00,0x99cc33, ++ 0x99cc66,0x99cc99,0x99cccc,0x99ccff,0x99ff00,0x99ff33,0x99ff66,0x99ff99,0x99ffcc,0x99ffff,0xcc0000,0xcc0033,0xcc0066,0xcc0099,0xcc00cc,0xcc00ff, ++ 0xcc3300,0xcc3333,0xcc3366,0xcc3399,0xcc33cc,0xcc33ff,0xcc6600,0xcc6633,0xcc6666,0xcc6699,0xcc66cc,0xcc66ff,0xcc9900,0xcc9933,0xcc9966,0xcc9999, ++ 0xcc99cc,0xcc99ff,0xcccc00,0xcccc33,0xcccc66,0xcccc99,0xcccccc,0xccccff,0xccff00,0xccff33,0xccff66,0xccff99,0xccffcc,0xccffff,0xff0000,0xff0033, ++ 0xff0066,0xff0099,0xff00cc,0xff00ff,0xff3300,0xff3333,0xff3366,0xff3399,0xff33cc,0xff33ff,0xff6600,0xff6633,0xff6666,0xff6699,0xff66cc,0xff66ff, ++ 0xff9900,0xff9933,0xff9966,0xff9999,0xff99cc,0xff99ff,0xffcc00,0xffcc33,0xffcc66,0xffcc99,0xffcccc,0xffccff,0xffff00,0xffff33,0xffff66,0xffff99, ++ 0xffffcc,0xffffff,0x050500,0x050501,0x050502,0x050503,0x050504,0x050505,0xe8e8e8,0xe9e9e9,0xeaeaea,0xebebeb,0xececec,0xededed,0xeeeeee,0xefefef, ++ 0xf0f0f0,0xf1f1f1,0xf2f2f2,0xf3f3f3,0xf4f4f4,0xf5f5f5,0xfffbf0,0xa0a0a4,0x808080,0xf00000,0x00ff00,0xffff00,0x0000ff,0xff00ff,0x00ffff,0xffffff ++}; ++ + /*********************************************************************** + * DIBDRV_CreateDIBSection + */ +@@ -46,15 +83,206 @@ HBITMAP DIBDRV_CreateDIBSection( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, + * DIBDRV_GetDIBits + */ + INT DIBDRV_GetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, +- UINT lines, LPCVOID bits, const BITMAPINFO *bmi, UINT coloruse ) ++ UINT lines, LPVOID bits, BITMAPINFO *info, UINT coloruse ) + { + INT res; +- +- MAYBE(TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", +- physDev, hbitmap, startscan, lines, bits, bmi, coloruse)); ++ DIBSECTION ds; ++ DIBDRVBITMAP sBmp, dBmp; ++ DWORD *buf; ++ int iLine; ++ int size; ++ BOOL justInfo, justInfoHeader; ++ int requestedBpp; ++ RGBQUAD *colorTable; ++ int colorTableSize; ++ BITMAPINFO *sourceInfo; + +- /* GetDIBits reads bits from a DDB, so we should use the X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pGetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, bmi, coloruse); ++ MAYBE(TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", ++ physDev, hbitmap, startscan, lines, bits, info, coloruse)); ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &ds) == sizeof(DIBSECTION)) ++ { ++ /* GetDIBits reads bits from a DIB, so we should use the engine driver */ ++ ++ /* for the moment, we don't support startscan != 0 */ ++ if(startscan != 0) ++ { ++ FIXME("startscan != 0 still not supported\n"); ++ return 0; ++ } ++ ++ /* sanity check */ ++ size = info->bmiHeader.biSize; ++ if(size != sizeof(BITMAPINFOHEADER) && size != sizeof(BITMAPCOREHEADER)) ++ { ++ ERR("Unknown header size %d\n", size); ++ return 0; ++ } ++ ++ /* get requested BPP */ ++ requestedBpp = info->bmiHeader.biBitCount; ++ ++ /* check wetrher we wants just the BITMAPINFO data */ ++ justInfo = (bits == NULL); ++ ++ /* check wether we wants just to get BITMAPINFOHEADER data */ ++ justInfoHeader = (requestedBpp == 0); ++ ++ if(!justInfo && justInfoHeader) ++ { ++ ERR("Bad requested BPP\n"); ++ return 0; ++ } ++ ++ /* copy / set missing DIB info */ ++ if(justInfo) ++ { ++ info->bmiHeader.biWidth = ds.dsBmih.biWidth; ++ info->bmiHeader.biHeight = ds.dsBmih.biHeight; ++ } ++ info->bmiHeader.biPlanes = 1; ++ if(justInfoHeader) ++ info->bmiHeader.biBitCount = ds.dsBmih.biBitCount; ++ if(size == sizeof(BITMAPINFOHEADER)) ++ { ++ if(justInfoHeader) ++ { ++ info->bmiHeader.biCompression = ds.dsBmih.biCompression; ++ info->bmiHeader.biXPelsPerMeter = ds.dsBmih.biXPelsPerMeter; ++ info->bmiHeader.biYPelsPerMeter = ds.dsBmih.biYPelsPerMeter; ++ info->bmiHeader.biClrUsed = ds.dsBmih.biClrUsed; ++ info->bmiHeader.biClrImportant = ds.dsBmih.biClrImportant; ++ } ++ info->bmiHeader.biSizeImage = ds.dsBmih.biSizeImage; ++ } ++ ++ /* width and height *must* match source's ones */ ++ if(info->bmiHeader.biWidth != ds.dsBmih.biWidth || ++ abs(info->bmiHeader.biHeight) != abs(ds.dsBmih.biHeight)) ++ { ++ ERR("Size of requested bitmap data don't match source's ones\n"); ++ return 0; ++ } ++ ++ /* if we just wants the BITMAPINFOHEADER data, we're done */ ++ if(justInfoHeader || (justInfo && ds.dsBmih.biBitCount > 8)) ++ return abs(info->bmiHeader.biHeight); ++ ++ /* we now have to get source data -- we need it for palette, for example */ ++ colorTableSize = 0; ++ if(ds.dsBmih.biBitCount <= 8) ++ colorTableSize = (1 << ds.dsBmih.biBitCount); ++ else if(ds.dsBmih.biCompression == BI_BITFIELDS) ++ colorTableSize = 3; ++ sourceInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFOHEADER) + colorTableSize * sizeof(RGBQUAD)); ++ if(!sourceInfo) ++ { ++ ERR("HeapAlloc failed\n"); ++ return 0; ++ } ++ memcpy(sourceInfo, &ds.dsBmih, sizeof(BITMAPINFOHEADER)); ++ if(ds.dsBmih.biBitCount <= 8) ++ { ++ /* grab palette - well, we should. No way to do it by now.... ++ we should add a list HBITMAP <--> DIBDRVBITMAP and fiddle to many ++ , many parts of the engine. Not worth the effort by now. ++ So, we just synthesize the table */ ++ switch(requestedBpp) ++ { ++ case 1: ++ memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), pal1, 2*sizeof(DWORD)); ++ break; ++ ++ case 4: ++ memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), pal4, 16*sizeof(DWORD)); ++ break; ++ ++ case 8: ++ memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), pal8, 256*sizeof(DWORD)); ++ break; ++ ++ default: ++ ERR("Unknown requested bith depth %d\n", requestedBpp); ++ _DIBDRVBITMAP_Free(&sBmp); ++ return 0; ++ } ++ } ++ else if(ds.dsBmih.biCompression == BI_BITFIELDS) ++ memcpy((BYTE *)sourceInfo + sizeof(BITMAPINFOHEADER), ds.dsBitfields, 3 * sizeof(RGBQUAD)); ++ _DIBDRVBITMAP_Clear(&sBmp); ++ if(!_DIBDRVBITMAP_InitFromBitmapinfo(&sBmp, sourceInfo)) ++ { ++ ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); ++ HeapFree(GetProcessHeap(), 0, sourceInfo); ++ return 0; ++ } ++ _DIBDRVBITMAP_Set_Bits(&sBmp, ds.dsBm.bmBits, FALSE); ++ HeapFree(GetProcessHeap(), 0, sourceInfo); ++ ++ /* now grab / synthesize the color table if needed */ ++ if(requestedBpp <= 8) ++ { ++ colorTable = (RGBQUAD *)((BYTE *)info + size); ++ if(requestedBpp == ds.dsBmih.biBitCount) ++ { ++ /* same source and dest format - copy color tables */ ++ memcpy(colorTable, sBmp.colorTable, colorTableSize); ++ } ++ else ++ { ++ /* different formats -- synthesize color table */ ++ switch(requestedBpp) ++ { ++ case 1: ++ memcpy(colorTable, pal1, 2*sizeof(DWORD)); ++ break; ++ ++ case 4: ++ memcpy(colorTable, pal4, 16*sizeof(DWORD)); ++ break; ++ ++ case 8: ++ memcpy(colorTable, pal8, 256*sizeof(DWORD)); ++ break; ++ ++ default: ++ ERR("Unknown requested bith depth %d\n", requestedBpp); ++ _DIBDRVBITMAP_Free(&sBmp); ++ return 0; ++ } ++ } ++ } ++ ++ /* if we just wanted DIB info, job is done */ ++ if(justInfo) ++ { ++ _DIBDRVBITMAP_Free(&sBmp); ++ return abs(info->bmiHeader.biHeight); ++ } ++ ++ /* Creates a DIBDRVBITMAP from dest dib */ ++ _DIBDRVBITMAP_Clear(&dBmp); ++ if(!_DIBDRVBITMAP_InitFromBitmapinfo(&dBmp, info)) ++ { ++ ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); ++ _DIBDRVBITMAP_Free(&sBmp); ++ return 0; ++ } ++ _DIBDRVBITMAP_Set_Bits(&dBmp, bits, FALSE); ++ ++ /* now we can do the bit conversion */ ++ buf = HeapAlloc(GetProcessHeap(), 0, ds.dsBmih.biWidth * sizeof(RGBQUAD)); ++ for(iLine = 0; iLine < lines; iLine++) ++ { ++ sBmp.funcs->GetLine(&sBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ dBmp.funcs->PutLine(&dBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ } ++ _DIBDRVBITMAP_Free(&sBmp); ++ _DIBDRVBITMAP_Free(&dBmp); ++ return lines; ++ } ++ else ++ /* GetDIBits reads bits from a DDB, use X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pGetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse); + + return res; + } +@@ -66,7 +294,10 @@ UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + const RGBQUAD *colors ) + { + DIBDRVBITMAP *dib = &physDev->physBitmap; +- ++#if 0 ++ HBITMAP thisDIB; ++#endif ++ + MAYBE(TRACE("physDev:%p, start:%d, count:%d, colors:%p\n", physDev, start, count, colors)); + + /* SetDIBColorTable operates on a DIB, so we use the engine */ +@@ -80,7 +311,7 @@ UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + + /* if dib hasn't a color table, or has a small one, we must before + create/extend it */ +- if(!(dib->colorTable)) ++ if(!dib->colorTable) + { + dib->colorTableSize = (1 << dib->bitCount); + dib->colorTable = HeapAlloc(GetProcessHeap(), 0, sizeof(RGBQUAD) * dib->colorTableSize); +@@ -104,6 +335,13 @@ UINT DIBDRV_SetDIBColorTable( DIBDRVPHYSDEV *physDev, UINT start, UINT count, + memcpy(dib->colorTable + start, colors, sizeof(RGBQUAD) * count); + dib->colorTableGrabbed = TRUE; + ++ /* hack to make GDI32 sense the DIB color table change ++ (fixes a couple of todos in bitmap test suite */ ++#if 0 ++ thisDIB = SelectObject(physDev->hdc, GetStockObject(OBJ_BITMAP)); ++ SelectObject(physDev->hdc, thisDIB); ++#endif ++ + return TRUE; + } + +@@ -114,13 +352,59 @@ INT DIBDRV_SetDIBits( DIBDRVPHYSDEV *physDev, HBITMAP hbitmap, UINT startscan, + UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) + { + INT res; ++ DIBSECTION ds; ++ DIBDRVBITMAP sBmp, dBmp; ++ DWORD *buf; ++ int iLine; + + MAYBE(TRACE("physDev:%p, hbitmap:%p, startscan:%d, lines:%d, bits:%p, bmi:%p, coloruse:%d\n", + physDev, hbitmap, startscan, lines, bits, info, coloruse)); + +- /* SetDIBits writes bits to a DDB, so we should use the X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pSetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse); + ++ if(GetObjectW(hbitmap, sizeof(DIBSECTION), &ds) == sizeof(DIBSECTION)) ++ { ++ /* SetDIBits writes bits to a DIB, so we should use the engine driver */ ++ ++ /* for the moment, we don't support startscan != 0 */ ++ if(startscan != 0) ++ { ++ FIXME("startscan != 0 still not supported\n"); ++ return 0; ++ } ++ ++ /* Creates a DIBDRVBITMAP from source dib */ ++ _DIBDRVBITMAP_Clear(&sBmp); ++ if(!_DIBDRVBITMAP_InitFromBitmapinfo(&sBmp, info)) ++ { ++ ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); ++ return 0; ++ } ++ _DIBDRVBITMAP_Set_Bits(&sBmp, (LPVOID)bits, FALSE); ++ ++ /* same for destination dib */ ++ if(!_DIBDRVBITMAP_InitFromHBITMAP(&dBmp, hbitmap, FALSE)) ++ { ++ ERR("_DIBDRVBITMAP_InitFromHBITMAP failed\n"); ++ _DIBDRVBITMAP_Free(&sBmp); ++ return 0; ++ } ++ ++ /* now we can do the bit conversion */ ++ buf = HeapAlloc(GetProcessHeap(), 0, ds.dsBmih.biWidth * sizeof(RGBQUAD)); ++ for(iLine = 0; iLine < lines; iLine++) ++ { ++ sBmp.funcs->GetLine(&sBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ dBmp.funcs->PutLine(&dBmp, iLine, 0, ds.dsBmih.biWidth, buf); ++ } ++ _DIBDRVBITMAP_Free(&sBmp); ++ _DIBDRVBITMAP_Free(&dBmp); ++ return lines; ++ } ++ else ++ { ++ /* SetDIBits writes bits to a DDB, so we should use the X11 driver */ ++ res = _DIBDRV_GetDisplayDriver()->pSetDIBits(physDev->X11PhysDev, hbitmap, startscan, lines, bits, info, coloruse); ++ } + return res; + } + +@@ -132,14 +416,105 @@ INT DIBDRV_SetDIBitsToDevice( DIBDRVPHYSDEV *physDev, INT xDest, INT yDest, DWOR + UINT startscan, UINT lines, LPCVOID bits, + const BITMAPINFO *info, UINT coloruse ) + { +- INT res; ++ BITMAPINFO *bitmapInfo; ++ int bmInfoSize; ++ int dibHeight, dibWidth; ++ DIBDRVBITMAP sBmp; ++ int sLine, dLine, iLine; ++ void *buf; + + MAYBE(TRACE("physDev:%p, xDest:%d, yDest:%d, cx:%x, cy:%x, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%p, info:%p, coloruse:%d\n", + physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse)); + +- /* SetDIBitsToDevice operates on a physical device, so we should use the X11 driver */ +- res = _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc, +- startscan, lines, bits, info, coloruse); ++ if(physDev->hasDIB) ++ { ++ /* DIB section selected in, use DIB Engine */ ++ ++ /* inverts y on source -- FIXME: check if right with some tests, it seems so */ ++ ySrc = abs(info->bmiHeader.biHeight) - ySrc - cy; ++ ++ dibHeight = info->bmiHeader.biHeight; ++ dibWidth = info->bmiHeader.biWidth; + +- return res; ++ /* sanity check and source clipping on physical sizes */ ++ if(startscan >= abs(dibHeight)) ++ return 0; ++ if(startscan + lines > abs(dibHeight)) ++ lines = abs(dibHeight) - startscan; ++ ++ /* adjust height because of startscan */ ++ dibHeight += (dibHeight > 0 ? -startscan : startscan); ++ ++ if(xSrc >= dibWidth) ++ return 0; ++ if(xSrc + cx > dibWidth) ++ cx = dibWidth - xSrc; ++ if(ySrc > abs(dibHeight)) ++ return 0; ++ if(ySrc + cy > abs(dibHeight)) ++ cy = abs(dibHeight) - ySrc; ++ ++ ySrc -= startscan; ++ cy -= startscan; ++ if(cy <= 0) ++ return 0; ++ if(ySrc < 0) ++ { ++ yDest += ySrc; ++ cy += ySrc; ++ ySrc = 0; ++ } ++ if(cy <= 0) ++ return 0; ++ ++ /* grab a copy of BITMAPINFO */ ++ bmInfoSize = sizeof(BITMAPINFOHEADER); ++ if(info->bmiHeader.biCompression == BI_BITFIELDS) ++ bmInfoSize += 3 * sizeof(RGBQUAD); ++ else if (info->bmiHeader.biBitCount <= 8) ++ { ++ if(info->bmiHeader.biClrUsed) ++ bmInfoSize += info->bmiHeader.biClrUsed * sizeof(RGBQUAD); ++ else ++ bmInfoSize += (1 << info->bmiHeader.biBitCount) * sizeof(RGBQUAD); ++ } ++ if(!(bitmapInfo = HeapAlloc(GetProcessHeap(), 0, bmInfoSize))) ++ { ++ ERR("HeapAlloc failed\n"); ++ return 0; ++ } ++ memcpy(bitmapInfo, info, bmInfoSize); ++ bitmapInfo->bmiHeader.biHeight = dibHeight; ++ ++ /* create a DIBDRVBITMAP from BITMAPINFO data */ ++ _DIBDRVBITMAP_Clear(&sBmp); ++ if(!_DIBDRVBITMAP_InitFromBitmapinfo(&sBmp, bitmapInfo)) ++ { ++ ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); ++ HeapFree(GetProcessHeap, 0, bitmapInfo); ++ return 0; ++ } ++ HeapFree(GetProcessHeap(), 0, bitmapInfo); ++ _DIBDRVBITMAP_Set_Bits(&sBmp, (LPVOID)bits, FALSE); ++ ++ /* transfer lines to dest bitmap */ ++ if(!(buf = HeapAlloc(GetProcessHeap(), 0, cx * sizeof(RGBQUAD)))) ++ { ++ ERR("HeapAlloc failed\n"); ++ return 0; ++ } ++ for(sLine = ySrc, dLine = yDest, iLine = 0; iLine < cy; sLine++, dLine++, iLine++) ++ { ++ sBmp.funcs->GetLine(&sBmp, sLine, xSrc, cx, buf); ++ physDev->physBitmap.funcs->PutLine(&physDev->physBitmap, dLine, xDest, cx, buf); ++ } ++ HeapFree(GetProcessHeap(), 0, buf); ++ ++ return cy; ++ } ++ else ++ { ++ return _DIBDRV_GetDisplayDriver()->pSetDIBitsToDevice(physDev->X11PhysDev, xDest, yDest, cx, cy, xSrc, ySrc, ++ startscan, lines, bits, info, coloruse); ++ } + } +diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h +index 66cc114..8243d4b 100644 +--- a/dlls/winedib.drv/dibdrv.h ++++ b/dlls/winedib.drv/dibdrv.h +@@ -312,6 +312,11 @@ DWORD _DIBDRV_ROP3(DWORD p, DWORD s, DWORD d, BYTE rop); + /* gets human-readable dib format name */ + const char *_DIBDRVBITMAP_GetFormatName(DIBDRVBITMAP const *bmp); + ++/* sets/gets bits of a DIBDRVBITMAP taking in account if it's a top down ++ or a bottom-up DIB */ ++void _DIBDRVBITMAP_Set_Bits(DIBDRVBITMAP *dib, void *bits, BOOL owns); ++void *_DIBDRVBITMAP_Get_Bits(DIBDRVBITMAP *dib); ++ + /* initializes dib from a bitmap : + dib dib being initialized + bi source BITMAPINFOHEADER with required DIB format info +@@ -322,7 +327,7 @@ const char *_DIBDRVBITMAP_GetFormatName(DIBDRVBITMAP const *bmp); + BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields, + const RGBQUAD *color_table, void *bits); + +-BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, BITMAPINFO *bmi); ++BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi); + + /* initializes a DIBRDVBITMAP copying it from a source one + Parameters : +@@ -331,6 +336,13 @@ BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, BITMAPINFO *bmi); + copy TRUE->copy source pixel array FALSE->link to source pixel array */ + BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *src, BOOL copy); + ++/* initializes a DIBRDVBITMAP from a DIB HBITMAP ++ Parameters : ++ bmp destination DIBDRVBITMAP ++ hbmp source HBITMAP ++ copyPixels TRUE->copy source pixel array FALSE->link to source pixel array */ ++BOOL _DIBDRVBITMAP_InitFromHBITMAP(DIBDRVBITMAP *bmp, const HBITMAP hbmp, BOOL copyPixels); ++ + /* creates a DIBRDVBITMAP copying format info from a source one + Parameters : + dib destination DIBDRVBITMAP +@@ -413,4 +425,17 @@ void _DIBDRV_Sizes_ws2ds(DIBDRVPHYSDEV *physDev, int *w, int *h); + /* converts a rectangle form Word space to Device space */ + void _DIBDRV_Rect_ws2ds(DIBDRVPHYSDEV *physDev, const RECT *src, RECT *dst); + ++/* ********************************************************************* ++ * COLOR UTILITIES ++ * ********************************************************************/ ++ ++/* maps a colorref to actual color */ ++COLORREF _DIBDRV_MapColor(DIBDRVPHYSDEV *physDev, COLORREF color); ++ ++/* gets nearest color index in DIB palette of a given colorref */ ++DWORD _DIBDRV_GetNearestColorIndex(const DIBDRVBITMAP *dib, COLORREF color); ++ ++/* gets nearest color to DIB palette color */ ++DWORD _DIBDRV_GetNearestColor(const DIBDRVBITMAP *dib, COLORREF color); ++ + #endif +diff --git a/dlls/winedib.drv/dibdrvbitmap.c b/dlls/winedib.drv/dibdrvbitmap.c +index 2c8c367..8e6b653 100644 +--- a/dlls/winedib.drv/dibdrvbitmap.c ++++ b/dlls/winedib.drv/dibdrvbitmap.c +@@ -107,6 +107,41 @@ static void InitBitFields(DIBDRVBITMAP *dib, const DWORD *bit_fields) + CalcShiftAndLen(dib->blueMask, &dib->blueShift, &dib->blueLen); + } + ++/* sets/gets bits of a DIBDRVBITMAP taking in account if it's a top down ++ or a bottom-up DIB */ ++void _DIBDRVBITMAP_Set_Bits(DIBDRVBITMAP *dib, void *bits, BOOL owns) ++{ ++ /* checks whether dib is top-down or bottom-up one */ ++ if(dib->stride > 0) ++ { ++ /* top-down dib */ ++ dib->bits = bits; ++ } ++ else ++ { ++ /* bottom-up dib */ ++ /* data->bits always points to the top-left corner and the stride is -ve */ ++ dib->bits = (BYTE*)bits - (dib->height - 1) * dib->stride; ++ } ++ dib->ownsBits = owns; ++} ++ ++void *_DIBDRVBITMAP_Get_Bits(DIBDRVBITMAP * dib) ++{ ++ /* checks whether dib is top-down or bottom-up one */ ++ if(dib->stride > 0) ++ { ++ /* top-down dib */ ++ return dib->bits; ++ } ++ else ++ { ++ /* bottom-up dib */ ++ /* data->bits always points to the top-left corner and the stride is -ve */ ++ return (BYTE*)dib->bits + (dib->height - 1) * dib->stride; ++ } ++} ++ + /* initializes dib from a bitmap : + dib dib being initialized + bi source BITMAPINFOHEADER with required DIB format info +@@ -238,7 +273,7 @@ BOOL _DIBDRVBITMAP_InitFromBMIH(DIBDRVBITMAP *dib, const BITMAPINFOHEADER *bi, c + return TRUE; + } + +-BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, BITMAPINFO *bmi) ++BOOL _DIBDRVBITMAP_InitFromBitmapinfo(DIBDRVBITMAP *dib, const BITMAPINFO *bmi) + { + static const DWORD bit_fields_DIB32_RGB[3] = {0xff0000, 0x00ff00, 0x0000ff}; + static const DWORD bit_fields_DIB16_RGB[3] = {0x7c00, 0x03e0, 0x001f}; +@@ -343,6 +378,93 @@ BOOL _DIBDRVBITMAP_InitFromDibdrvbitmap(DIBDRVBITMAP *dib, const DIBDRVBITMAP *s + return TRUE; + } + ++/* initializes a DIBRDVBITMAP from a DIB HBITMAP ++ Parameters : ++ bmp destination DIBDRVBITMAP ++ hbmp source HBITMAP ++ copyPixels TRUE->copy source pixel array FALSE->link to source pixel array */ ++BOOL _DIBDRVBITMAP_InitFromHBITMAP(DIBDRVBITMAP *bmp, const HBITMAP hbmp, BOOL copyPixels) ++{ ++ BITMAPINFO *destInfo; ++ DIBSECTION ds; ++ int size; ++ ++ MAYBE(TRACE("bmp=%p, hbmp=%p, copyPixels = %s\n", bmp, hbmp, copyPixels ? "TRUE" : "FALSE")); ++ ++ /* be sure bitmap is empty */ ++ _DIBDRVBITMAP_Clear(bmp); ++ ++ /* gets source bitmap data */ ++ if(!(size = GetObjectW(hbmp, sizeof(DIBSECTION), &ds))) ++ { ++ ERR("Failed getting bitmap object\n"); ++ return FALSE; ++ } ++ if(size != sizeof(DIBSECTION)) ++ { ++ ERR("Bitmap is not a DIB section\n"); ++ return FALSE; ++ } ++ ++ destInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); ++ if(!destInfo) ++ { ++ ERR("HeapAlloc failed\n"); ++ return FALSE; ++ } ++ ++ memcpy(destInfo, &ds.dsBmih, sizeof(BITMAPINFOHEADER)); ++ if(ds.dsBmih.biCompression == BI_BITFIELDS) ++ memcpy((BITMAPINFOHEADER *)destInfo + 1, ds.dsBitfields, 3 * sizeof(RGBQUAD)); ++ else if(ds.dsBmih.biBitCount <= 8) ++ { ++ FIXME("Can't grab color table here.... syslvel lock\n"); ++ return FALSE; ++#if 0 ++ HDC refDC = CreateCompatibleDC(0); ++ if(!refDC) ++ { ++ ERR("CreateCompatibleDC() failed\n"); ++ return FALSE; ++ } ++ if(!GetDIBits(refDC, hbmp, 0, 1, NULL, destInfo, DIB_RGB_COLORS)) ++ { ++ DeleteDC(refDC); ++ HeapFree(GetProcessHeap(), 0, destInfo); ++ ERR("GetDIBits failed\n"); ++ return FALSE; ++ } ++ DeleteDC(refDC); ++#endif ++ } ++ if(!_DIBDRVBITMAP_InitFromBitmapinfo(bmp, destInfo)) ++ { ++ HeapFree(GetProcessHeap(), 0, destInfo); ++ ERR("_DIBDRVBITMAP_InitFromBitmapinfo failed\n"); ++ return FALSE; ++ } ++ HeapFree(GetProcessHeap(), 0, destInfo); ++ if(copyPixels) ++ { ++ size = abs(bmp->stride) * bmp->height; ++ if(!(bmp->bits = HeapAlloc(GetProcessHeap(), 0, size))) ++ { ++ ERR("HeapAlloc failed\n"); ++ _DIBDRVBITMAP_Free(bmp); ++ return FALSE; ++ } ++ memcpy(bmp->bits, ds.dsBm.bmBits, size); ++ bmp->ownsBits = TRUE; ++ } ++ else ++ bmp->bits = ds.dsBm.bmBits; ++ if(bmp->stride < 0) ++ bmp->bits = (BYTE*)bmp->bits - (bmp->height - 1) * bmp->stride; ++ ++ return TRUE; ++} ++ ++ + /* creates a DIBRDVBITMAP copying format info from a source one + Parameters : + dib destination DIBDRVBITMAP +diff --git a/dlls/winedib.drv/graphics.c b/dlls/winedib.drv/graphics.c +index f62149c..8e2c12e 100644 +--- a/dlls/winedib.drv/graphics.c ++++ b/dlls/winedib.drv/graphics.c +@@ -132,7 +132,7 @@ static inline void SideIntersect(const POINT *p1, const POINT *p2, const RECT *r + break; + case TOP_SIDE: /* top */ + inters->x = MulDiv(p2->x - p1->x, r->top - p1->y, p2->y - p1->y) + p1->x; +- inters->y = r->bottom; ++ inters->y = r->top; + break; + case RIGHT_SIDE: /* right */ + inters->x = r->right - 1; +@@ -698,7 +698,7 @@ BOOL DIBDRV_Polygon( DIBDRVPHYSDEV *physDev, const POINT* ptw, int count ) + { + /* gets polygon bounding box -- for ytop and ybottom */ + PolygonBoundingBox(clipped, clippedCount, &bBox); +- ++ + /* gets all ordered intersections of polygon with + current scanline */ + for(ys = bBox.top; ys < bBox.bottom; ys++) +@@ -972,6 +972,12 @@ COLORREF DIBDRV_SetPixel( DIBDRVPHYSDEV *physDev, int x, int y, COLORREF color ) + + if(physDev->hasDIB) + { ++ /* get real colorref */ ++ color = _DIBDRV_MapColor(physDev, color); ++ ++ /* map to pixel color / palette index */ ++ color = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, color); ++ + _DIBDRV_Position_ws2ds(physDev, &x, &y); + + /* gets previous pixel */ +diff --git a/dlls/winedib.drv/palette.c b/dlls/winedib.drv/palette.c +index a1aa648..87016da 100644 +--- a/dlls/winedib.drv/palette.c ++++ b/dlls/winedib.drv/palette.c +@@ -25,6 +25,69 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++/* maps a colorref to actual color */ ++COLORREF _DIBDRV_MapColor(DIBDRVPHYSDEV *physDev, COLORREF color) ++{ ++ WORD index; ++ RGBQUAD *palColor; ++ HPALETTE hPal; ++ PALETTEENTRY paletteEntry; ++ ++ switch(color >> 24) ++ { ++ case 0x10 : /* DIBINDEX */ ++ MAYBE(TRACE("DIBINDEX Color is %08x\n", color)); ++ index = color & 0xffff; ++ if(index >= physDev->physBitmap.colorTableSize) ++ { ++ WARN("DIBINDEX color out of range\n"); ++ return 0; ++ } ++ palColor = physDev->physBitmap.colorTable + index; ++ MAYBE(TRACE("Returning color %08x\n", RGB(palColor->rgbRed, palColor->rgbGreen, palColor->rgbBlue))); ++ return RGB(palColor->rgbRed, palColor->rgbGreen, palColor->rgbBlue); ++ ++ case 0x01: /* PALETTEINDEX */ ++ MAYBE(TRACE("PALETTEINDEX Color is %08x\n", color)); ++ index = color & 0xffff; ++ if(!(hPal = GetCurrentObject(physDev->hdc, OBJ_PAL))) ++ { ++ ERR("Couldn't get palette\n"); ++ return 0; ++ } ++ if (!GetPaletteEntries(hPal, index, 1, &paletteEntry)) ++ { ++ WARN("PALETTEINDEX(%x) : index %d is out of bounds, assuming black\n", color, index); ++ return 0; ++ } ++ MAYBE(TRACE("Returning color %08x\n", RGB(paletteEntry.peRed, paletteEntry.peGreen, paletteEntry.peBlue))); ++ return RGB(paletteEntry.peRed, paletteEntry.peGreen, paletteEntry.peBlue); ++ ++ case 0x02: /* PALETTERGB */ ++ return _DIBDRV_GetNearestColor(&physDev->physBitmap, color & 0xffffff); ++ ++ default: ++ /* RGB color -- we must process special case for monochrome bitmaps */ ++ if(physDev->physBitmap.bitCount == 1) ++ { ++ RGBQUAD *back = physDev->physBitmap.colorTable; ++ RGBQUAD *fore = back+1; ++ if(fore->rgbRed * fore->rgbRed + fore->rgbGreen * fore->rgbGreen + fore->rgbBlue * fore->rgbBlue < ++ back->rgbRed * back->rgbRed + back->rgbGreen * back->rgbGreen + back->rgbBlue * back->rgbBlue) ++ { ++ fore = back; ++ back = fore + 1; ++ } ++ if ( ((color >> 16) & 0xff) + ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) ++ return RGB(fore->rgbRed, fore->rgbGreen, fore->rgbBlue); ++ else ++ return RGB(back->rgbRed, back->rgbGreen, back->rgbBlue); ++ } ++ else ++ return color; ++ } ++} ++ + /*********************************************************************** + * DIBDRV_RealizePalette + */ +diff --git a/dlls/winedib.drv/pen_brush.c b/dlls/winedib.drv/pen_brush.c +index 7b15ece..c40bfaf 100644 +--- a/dlls/winedib.drv/pen_brush.c ++++ b/dlls/winedib.drv/pen_brush.c +@@ -51,7 +51,7 @@ static void SolidPenHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + physDev->physBitmap.funcs->SolidHLine(&physDev->physBitmap, x1, x2, y, physDev->penAnd, physDev->penXor); + } + +-static void SolidPenVline(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) ++static void SolidPenVLine(DIBDRVPHYSDEV *physDev, int x, int y1, int y2) + { + OrderEndPoints(&y1, &y2); + physDev->physBitmap.funcs->SolidVLine(&physDev->physBitmap, x, y1, y2, physDev->penAnd, physDev->penXor); +@@ -65,7 +65,7 @@ static void WINAPI SolidPenLineCallback(int x, int y, LPARAM lparam) + return; + } + +-void SolidPenLine(DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2) ++static void SolidPenLine(DIBDRVPHYSDEV *physDev, int x1, int y1, int x2, int y2) + { + LineDDA(x1, y1, x2, y2, SolidPenLineCallback, (LPARAM)physDev); + } +@@ -216,22 +216,29 @@ void _DIBDRV_ResetDashOrigin(DIBDRVPHYSDEV *physDev) + physDev->markSpace = mark; + } + +- ++#if 0 + /* For 1bpp bitmaps, unless the selected foreground color exactly + matches foreground's colortable OR it's the WHITE color, + the background color is used -- tested on WinXP */ + static DWORD AdjustFgColor(DIBDRVPHYSDEV *physDev, COLORREF color) + { ++ RGBQUAD *back = physDev->physBitmap.colorTable; + RGBQUAD *fore = physDev->physBitmap.colorTable+1; + +- if((color & 0x00ffffff) == 0x00ffffff || +- ( +- fore->rgbRed == GetRValue(color) && +- fore->rgbGreen == GetGValue(color) && +- fore->rgbBlue == GetBValue(color) +- )) +- return 1; +- return 0; ++ if( ++ fore->rgbRed == GetRValue(color) && ++ fore->rgbGreen == GetGValue(color) && ++ fore->rgbBlue == GetBValue(color)) ++ return 1; ++ else if( ++ back->rgbRed == GetRValue(color) && ++ back->rgbGreen == GetGValue(color) && ++ back->rgbBlue == GetBValue(color)) ++ return 0; ++ else if((color & 0x00ffffff) == 0x00ffffff) ++ return 1; ++ else ++ return 0; + } + + static void FixupFgColors1(DIBDRVPHYSDEV *physDev) +@@ -248,6 +255,45 @@ static void FixupFgColors1(DIBDRVPHYSDEV *physDev) + physDev->brushAnds = NULL; + physDev->brushXors = NULL; + } ++#endif ++ ++#if 0 ++/* For 1bpp bitmaps, unless the selected foreground color exactly ++ matches one of the colors in the colortable, then the color that ++ isn't the bkgnd color is used. */ ++static DWORD AdjustFgColor(DIBDRVPHYSDEV *physDev, COLORREF color) ++{ ++ RGBQUAD rgb; ++ int i; ++ ++ rgb.rgbRed = GetRValue(color); ++ rgb.rgbGreen = GetGValue(color); ++ rgb.rgbBlue = GetBValue(color); ++ ++ for(i = 0; i < physDev->physBitmap.colorTableSize; i++) ++ { ++ RGBQUAD *cur = physDev->physBitmap.colorTable + i; ++ if((rgb.rgbRed == cur->rgbRed) && (rgb.rgbGreen == cur->rgbGreen) && (rgb.rgbBlue == cur->rgbBlue)) ++ return i; ++ } ++ return ~physDev->backgroundColor & 1; ++} ++ ++static void FixupFgColors1(DIBDRVPHYSDEV *physDev) ++{ ++ int rop = GetROP2(physDev->hdc); ++ ++ physDev->penColor = AdjustFgColor(physDev, physDev->penColorref); ++ physDev->brushColor = AdjustFgColor(physDev, physDev->brushColorref); ++ ++ _DIBDRV_CalcAndXorMasks(rop, physDev->penColor, &physDev->penAnd, &physDev->penXor); ++ _DIBDRV_CalcAndXorMasks(rop, physDev->brushColor, &physDev->brushAnd, &physDev->brushXor); ++ HeapFree(GetProcessHeap(), 0, physDev->brushAnds); ++ HeapFree(GetProcessHeap(), 0, physDev->brushXors); ++ physDev->brushAnds = NULL; ++ physDev->brushXors = NULL; ++} ++#endif + + static void SolidBrushHLine(DIBDRVPHYSDEV *physDev, int x1, int x2, int y) + { +@@ -310,23 +356,21 @@ HPEN DIBDRV_SelectPen( DIBDRVPHYSDEV *physDev, HPEN hpen ) + { + GetObjectW(hpen, sizeof(logpen), &logpen); + +- physDev->penColorref = logpen.lopnColor; +- +- if(physDev->physBitmap.bitCount == 1) +- FixupFgColors1(physDev); +- else +- physDev->penColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, logpen.lopnColor); ++ physDev->penColorref = _DIBDRV_MapColor(physDev, logpen.lopnColor); ++ physDev->penColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, physDev->penColorref); + + _DIBDRV_CalcAndXorMasks(GetROP2(physDev->hdc), physDev->penColor, &physDev->penAnd, &physDev->penXor); + ++ physDev->penStyle = logpen.lopnStyle; + switch(logpen.lopnStyle) + { + default: + ONCE(FIXME("Unhandled pen style %d\n", logpen.lopnStyle)); ++ physDev->penStyle = PS_SOLID; + /* fall through */ + case PS_SOLID: + physDev->penHLine = SolidPenHLine; +- physDev->penVLine = SolidPenVline; ++ physDev->penVLine = SolidPenVLine; + physDev->penLine = SolidPenLine; + physDev->penPattern = NULL; + break; +@@ -415,16 +459,13 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + goto solid; + + case BS_SOLID: +- physDev->brushColorref = logbrush.lbColor; ++ physDev->brushColorref = _DIBDRV_MapColor(physDev, logbrush.lbColor); + solid: + MAYBE(TRACE("SOLID Pattern -- color is %x\n", physDev->brushColorref)); + physDev->brushStyle = BS_SOLID; + physDev->brushHLine = SolidBrushHLine; + +- if(physDev->physBitmap.bitCount == 1) +- FixupFgColors1(physDev); +- else +- physDev->brushColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, logbrush.lbColor); ++ physDev->brushColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, physDev->brushColorref); + + _DIBDRV_CalcAndXorMasks(physDev->rop2, physDev->brushColor, + &physDev->brushAnd, &physDev->brushXor); +@@ -496,8 +537,9 @@ HBRUSH DIBDRV_SelectBrush( DIBDRVPHYSDEV *physDev, HBRUSH hbrush ) + { + MAYBE(TRACE("NULL Pattern\n")); + physDev->brushColorref = 0; ++ physDev->brushColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, 0); + physDev->brushHLine = NullBrushHLine; +- goto solid; ++ break; + } + + case BS_PATTERN: +@@ -601,10 +643,9 @@ COLORREF DIBDRV_SetBkColor( DIBDRVPHYSDEV *physDev, COLORREF color ) + + if(physDev->hasDIB) + { +- physDev->backgroundColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, color); ++ physDev->backgroundColor = _DIBDRV_MapColor(physDev, color); ++ physDev->backgroundColor = physDev->physBitmap.funcs->ColorToPixel(&physDev->physBitmap, physDev->backgroundColor); + +- if(physDev->physBitmap.bitCount == 1) +- FixupFgColors1(physDev); + _DIBDRV_CalcAndXorMasks(physDev->rop2, physDev->backgroundColor, &physDev->backgroundAnd, &physDev->backgroundXor); + + res = TRUE; +diff --git a/dlls/winedib.drv/primitives_bitblt.c b/dlls/winedib.drv/primitives_bitblt.c +index 7feeb49..27d573f 100644 +--- a/dlls/winedib.drv/primitives_bitblt.c ++++ b/dlls/winedib.drv/primitives_bitblt.c +@@ -25,6 +25,12 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + ++static inline COLORREF SwapColors(DWORD c) ++{ ++ return ((c & 0x0000ff) << 16) | (c & 0x00ff00) | ((c & 0xff0000) >> 16); ++ ++} ++ + /* shrinks a line -- srcWidth >= dstWidth */ + static void ShrinkLine(DWORD *dst, int dstWidth, DWORD *src, int srcWidth) + { +@@ -407,9 +413,11 @@ BOOL _DIBDRV_BitBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + srcBmp = NULL; + dstBmp = &physDevDst->physBitmap; + +- /* gets pattern color, in case it's needed */ ++ /* gets pattern color, in case it's needed ++ it's NOT the COLORREF value (colors are swapped ++ NOR the pixel value (it's applied to a 32 BPP BI_RGB */ + if(usePat) +- patColor = physDevDst->brushColor; ++ patColor = SwapColors(physDevDst->brushColorref); + else + patColor = 0; + +@@ -658,9 +666,11 @@ BOOL _DIBDRV_StretchBlt_generic(DIBDRVPHYSDEV *physDevDst, INT xDst, INT yDst, + srcBmp = NULL; + dstBmp = &physDevDst->physBitmap; + +- /* gets pattern color, in case it's needed */ ++ /* gets pattern color, in case it's needed ++ it's NOT the COLORREF value (colors are swapped ++ NOR the pixel value (it's applied to a 32 BPP BI_RGB */ + if(usePat) +- patColor = physDevDst->brushColor; ++ patColor = SwapColors(physDevDst->brushColorref); + else + patColor = 0; + +diff --git a/dlls/winedib.drv/primitives_color.c b/dlls/winedib.drv/primitives_color.c +index 3ccc2e0..6c42b44 100644 +--- a/dlls/winedib.drv/primitives_color.c ++++ b/dlls/winedib.drv/primitives_color.c +@@ -94,31 +94,30 @@ DWORD _DIBDRV_ColorToPixel16_BITFIELDS(const DIBDRVBITMAP *dib, COLORREF color) + PutField16(b, dib->blueShift, dib->blueLen); + } + +-DWORD _DIBDRV_ColorToPixelColortable(const DIBDRVBITMAP *dib, COLORREF color) ++/* gets nearest color to DIB palette color */ ++DWORD _DIBDRV_GetNearestColor(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ RGBQUAD *c; ++ ++ if(dib->bitCount > 8) ++ return color; ++ ++ c = dib->colorTable + _DIBDRV_GetNearestColorIndex(dib, color); ++ return RGB(c->rgbRed, c->rgbGreen, c->rgbBlue); ++ ++} ++ ++/* gets nearest color index in DIB palette of a given colorref */ ++DWORD _DIBDRV_GetNearestColorIndex(const DIBDRVBITMAP *dib, COLORREF color) + { +- int i, best_index = 0; + DWORD r, g, b; ++ int i, best_index = 0; + DWORD diff, best_diff = 0xffffffff; +- ++ + r = GetRValue(color); + g = GetGValue(color); + b = GetBValue(color); + +- /* just in case it's being called without color table +- properly initialized */ +- if(!dib->colorTableGrabbed) +- return 0; +- +- /* for monochrome bitmaps, color is background +- if not matching foreground */ +- if(dib->colorTableSize == 2) +- { +- RGBQUAD *fore = dib->colorTable + 1; +- if(r == fore->rgbRed && g == fore->rgbGreen && b == fore->rgbBlue) +- return 1; +- return 0; +- } +- + for(i = 0; i < dib->colorTableSize; i++) + { + RGBQUAD *cur = dib->colorTable + i; +@@ -140,3 +139,39 @@ DWORD _DIBDRV_ColorToPixelColortable(const DIBDRVBITMAP *dib, COLORREF color) + } + return best_index; + } ++ ++DWORD _DIBDRV_ColorToPixelColortable(const DIBDRVBITMAP *dib, COLORREF color) ++{ ++ DWORD r, g, b; ++ ++ r = GetRValue(color); ++ g = GetGValue(color); ++ b = GetBValue(color); ++ ++ /* just in case it's being called without color table ++ properly initialized */ ++ if(!dib->colorTableGrabbed) ++ return 0; ++ ++ /* for monochrome bitmaps, color is : ++ foreground if matching foreground ctable ++ else background if matching background ctable ++ else foreground ix 0xffffff ++ else background */ ++ if(dib->colorTableSize == 2) ++ { ++ RGBQUAD *back = dib->colorTable; ++ RGBQUAD *fore = dib->colorTable + 1; ++ if(r == fore->rgbRed && g == fore->rgbGreen && b == fore->rgbBlue) ++ return 1; ++ else if(r == back->rgbRed && g == back->rgbGreen && b == back->rgbBlue) ++ return 0; ++ if((color & 0xffffff) == 0xffffff) ++ return 1; ++ else ++ return 0; ++ } ++ ++ /* otherwise looks for nearest color in palette */ ++ return _DIBDRV_GetNearestColorIndex(dib, color); ++} +diff --git a/dlls/winedib.drv/primitives_convert.c b/dlls/winedib.drv/primitives_convert.c +index f8f87ce..24a5e77 100644 +--- a/dlls/winedib.drv/primitives_convert.c ++++ b/dlls/winedib.drv/primitives_convert.c +@@ -31,6 +31,33 @@ static inline COLORREF SwapColors(DWORD c) + + } + ++static inline DWORD PlaceField32(BYTE c, int shift, int len) ++{ ++ DWORD res = c; ++ if(len < 8) ++ res >>= (8 - len); ++ else ++ res <<= (len - 8); ++ return res << shift; ++} ++ ++static inline WORD PlaceField16(BYTE c, int shift, int len) ++{ ++ WORD res = c; ++ if(len < 8) ++ res >>= (8 - len); ++ else ++ res <<= (len - 8); ++ return res << shift; ++} ++ ++static inline BYTE GetField32(DWORD dwColor, int shift, int len) ++{ ++ dwColor = dwColor & (((1 << (len)) - 1) << shift); ++ dwColor = dwColor << (32 - (shift + len)) >> 24; ++ return dwColor; ++} ++ + /* ----------------------------------------------------------------*/ + /* CONVERT PRIMITIVES */ + /* converts (part of) line of any DIB format from/to DIB32_RGB one */ +@@ -63,7 +90,7 @@ BOOL _DIBDRV_GetLine32_RGB(const DIBDRVBITMAP *bmp, INT line, INT startx, int wi + + BOOL _DIBDRV_GetLine32_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, void *buf) + { +- BYTE *bBuf = (BYTE *)buf; ++ DWORD *dwBuf = (DWORD *)buf; + DWORD *src; + + #ifdef DIBDRV_CHECK_RANGES +@@ -85,10 +112,10 @@ BOOL _DIBDRV_GetLine32_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, + src = (DWORD *)((BYTE *)bmp->bits + line * bmp->stride + 4 * startx); + for(; width ; width--) + { +- *bBuf++ = (*src & bmp->blueMask ) >> bmp->blueShift; +- *bBuf++ = (*src & bmp->greenMask) >> bmp->greenShift; +- *bBuf++ = (*src & bmp->redMask ) >> bmp->redShift; +- *bBuf++ = 0x0; ++ *dwBuf++ = ++ GetField32(*src, bmp->redShift , bmp->redLen ) << 16 | ++ GetField32(*src, bmp->greenShift, bmp->greenLen) << 8 | ++ GetField32(*src, bmp->blueShift , bmp->blueLen ); + src++; + } + return TRUE; +@@ -184,6 +211,7 @@ BOOL _DIBDRV_GetLine16_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, + for(; width ; width--) + { + b = *src++; ++ + *dwBuf++ =((( b & bmp->blueMask) >> bmp->blueShift ) << ( 8 - bmp->blueLen )) | + (((b & bmp->greenMask) >> bmp->greenShift) << (16 - bmp->greenLen)) | + (((b & bmp->redMask ) >> bmp->redShift ) << (24 - bmp->redLen )); +@@ -350,14 +378,14 @@ BOOL _DIBDRV_PutLine32_BITFIELDS(const DIBDRVBITMAP *bmp, INT line, INT startx, + { + DWORD *dwBuf = (DWORD *)buf; + DWORD *dst = (DWORD *)((BYTE *)bmp->bits + line * bmp->stride + 4 * startx); +- DWORD c; ++ RGBQUAD *c; + for(; width; width--) + { +- c = *dwBuf++; ++ c = (RGBQUAD *)dwBuf++; + *dst++ = +- ((( c & 0x000000ff) << bmp->blueShift) & bmp->blueMask) | +- ((((c & 0x0000ff00) >> 8) << bmp->greenShift) & bmp->greenMask) | +- ((((c & 0x00ff0000) >> 16) << bmp->redShift) & bmp->redMask); ++ PlaceField32(c->rgbRed , bmp->redShift , bmp->redLen ) | ++ PlaceField32(c->rgbGreen, bmp->greenShift, bmp->greenLen) | ++ PlaceField32(c->rgbBlue , bmp->blueShift , bmp->blueLen ); + } + return TRUE; + } +@@ -386,6 +414,7 @@ BOOL _DIBDRV_PutLine16_RGB(const DIBDRVBITMAP *bmp, INT line, INT startx, int wi + { + c = *dwBuf++; + *dst++ = ++ /* 0RRR|RRGG|GGGB|BBBB */ + ((c & 0x000000f8) >> 3) | + ((c & 0x0000f800) >> 6) | + ((c & 0x00f80000) >> 9); +@@ -506,8 +535,9 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + DWORD c; + + /* get foreground color */ ++ DWORD back = *(DWORD *)bmp->colorTable & 0x00ffffff; + DWORD fore = *((DWORD *)bmp->colorTable + 1) & 0x00ffffff; +- ++ + /* put first partial byte, if any */ + startx &= 0x07; + mask = 0x80 >> startx; +@@ -519,7 +549,11 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + while(startx--) + { + c = *dwBuf++ & 0x00ffffff; +- if(c == 0x00ffffff || c == fore) ++ if(c == fore) ++ b |= mask; ++ else if(c == back) ++ b &= !mask; ++ else if(c == 0x00ffffff) + b |= mask; + else + b &= !mask; +@@ -536,7 +570,7 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + for(i = 0 ; i < 8 ; i++) + { + c = *dwBuf++ & 0x00ffffff; +- if(c == 0x00ffffff || c == fore) ++ if(c == fore || (c == 0x00ffffff && c != back)) + b |= mask; + mask >>= 1; + } +@@ -551,7 +585,11 @@ BOOL _DIBDRV_PutLine1(const DIBDRVBITMAP *bmp, INT line, INT startx, int width, + while(width--) + { + c = *dwBuf++ & 0x00ffffff; +- if(c == 0x00ffffff || c == fore) ++ if(c == fore) ++ b |= mask; ++ else if(c == back) ++ b &= !mask; ++ else if(c == 0x00ffffff) + b |= mask; + else + b &= !mask; +diff --git a/dlls/winedib.drv/primitives_pixel.c b/dlls/winedib.drv/primitives_pixel.c +index ca68cf1..78e68c7 100644 +--- a/dlls/winedib.drv/primitives_pixel.c ++++ b/dlls/winedib.drv/primitives_pixel.c +@@ -25,24 +25,15 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + +- + /* ------------------------------------------------------------*/ + /* BITFIELD HELPERS */ +-static DWORD GetField32 (DWORD pixel, int shift, int len) ++static inline DWORD GetField32 (DWORD pixel, int shift, int len) + { + pixel = pixel & (((1 << (len)) - 1) << shift); + pixel = pixel << (32 - (shift + len)) >> 24; + return pixel; + } + +-static WORD GetField16 (WORD pixel, int shift, int len) +-{ +- FIXME("TODO\n"); +- return 0; +-} +- +- +- + /* ------------------------------------------------------------*/ + /* PIXEL POINTER READING */ + void *_DIBDRV_GetPixelPointer32(const DIBDRVBITMAP *dib, int x, int y) +@@ -174,45 +165,50 @@ void _DIBDRV_SetPixel1(DIBDRVBITMAP *dib, int x, int y, DWORD and, DWORD xor) + /* PIXEL READING */ + DWORD _DIBDRV_GetPixel32_RGB(const DIBDRVBITMAP *dib, int x, int y) + { +- DWORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); +- return *ptr; ++ DWORD c = *(DWORD *)dib->funcs->GetPixelPointer(dib, x, y); ++ return ++ ((c & 0x000000ff) << 16) | ++ ((c & 0x0000ff00) ) | ++ ((c & 0x00ff0000) >> 16) | ++ ( c & 0xff000000 ); /* last one for alpha channel */ + } + + DWORD _DIBDRV_GetPixel32_BITFIELDS(const DIBDRVBITMAP *dib, int x, int y) + { + DWORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); + +- return GetField32(*ptr, dib->redShift, dib->redLen) << 16 | ++ return GetField32(*ptr, dib->redShift, dib->redLen) | + GetField32(*ptr, dib->greenShift, dib->greenLen) << 8 | +- GetField32(*ptr, dib->blueShift, dib->blueLen); ++ GetField32(*ptr, dib->blueShift, dib->blueLen) << 16; + } + + DWORD _DIBDRV_GetPixel24(const DIBDRVBITMAP *dib, int x, int y) + { + BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y); +- return (ptr[0] << 16) | (ptr[1] << 8) | ptr[2]; ++ return ((WORD)ptr[0] << 16) | ((WORD)ptr[1] << 8) | (WORD)ptr[2]; + } + + DWORD _DIBDRV_GetPixel16_RGB(const DIBDRVBITMAP *dib, int x, int y) + { +- WORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); +- return ((*ptr & 0x7c00) << 9) | ((*ptr & 0x03e0) << 6) | ((*ptr & 0x001f) << 3); ++ WORD c = *(WORD *)dib->funcs->GetPixelPointer(dib, x, y); ++ /* 0RRR|RRGG|GGGB|BBBB */ ++ return ((c & 0x7c00) >> 7) | ((c & 0x03e0) << 6) | ((c & 0x001f) << 19); + } + + DWORD _DIBDRV_GetPixel16_BITFIELDS(const DIBDRVBITMAP *dib, int x, int y) + { +- WORD *ptr = dib->funcs->GetPixelPointer(dib, x, y); ++ WORD c = *(WORD *)dib->funcs->GetPixelPointer(dib, x, y); + +- return GetField16(*ptr, dib->redShift, dib->redLen) << 16 | +- GetField16(*ptr, dib->greenShift, dib->greenLen) << 8 | +- GetField16(*ptr, dib->blueShift, dib->blueLen); ++ return (((c & dib->blueMask ) >> dib->blueShift ) << (24 - dib->blueLen )) | ++ (((c & dib->greenMask) >> dib->greenShift) << (16 - dib->greenLen)) | ++ (((c & dib->redMask ) >> dib->redShift ) << ( 8 - dib->redLen )); + } + + DWORD _DIBDRV_GetPixel8(const DIBDRVBITMAP *dib, int x, int y) + { + BYTE *ptr = dib->funcs->GetPixelPointer(dib, x, y); + RGBQUAD *color = dib->colorTable + *ptr; +- return (color->rgbRed << 16) | (color->rgbGreen << 8) | color->rgbBlue; ++ return (color->rgbRed) | (color->rgbGreen << 8) | (color->rgbBlue << 16); + } + + DWORD _DIBDRV_GetPixel4(const DIBDRVBITMAP *dib, int x, int y) +@@ -226,7 +222,7 @@ DWORD _DIBDRV_GetPixel4(const DIBDRVBITMAP *dib, int x, int y) + pix = *ptr >> 4; + + color = dib->colorTable + pix; +- return (color->rgbRed << 16) | (color->rgbGreen << 8) | color->rgbBlue; ++ return (color->rgbRed) | (color->rgbGreen << 8) | (color->rgbBlue << 16); + } + + DWORD _DIBDRV_GetPixel1(const DIBDRVBITMAP *dib, int x, int y) +@@ -240,5 +236,5 @@ DWORD _DIBDRV_GetPixel1(const DIBDRVBITMAP *dib, int x, int y) + pix &= 1; + + color = dib->colorTable + pix; +- return (color->rgbRed << 16) | (color->rgbGreen << 8) | color->rgbBlue; ++ return (color->rgbRed) | (color->rgbGreen << 8) | (color->rgbBlue << 16); + } --- wine1.2-1.1.43.orig/debian/source/format +++ wine1.2-1.1.43/debian/source/format @@ -0,0 +1 @@ +1.0