Commit ebfc0fee authored by Alexandre Julliard's avatar Alexandre Julliard

Release 980628

Sun Jun 28 18:37:02 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [if1632/signal.c] [miscemu/instr.c] [memory/virtual.c] Moved page-fault handling to INSTR_EmulateInstruction. * [scheduler/thread.c] Added locking and check for own thread in Suspend/ResumeThread. Sat Jun 27 21:25:21 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de> * [objects/dib.c] [objects/bitmap.c] [objects/oembitmap.c] [graphics/x11drv/bitblt.c] [include/bitmap.h] Improved DIB section handling using page fault handlers. (Note: This patch includes code contributed by Matthew J. Francis.) * [memory/virtual.c] [if1632/signal.c] [include/global.h] Page Fault handler support added. * [if1632/signal.c] [loader/signal.c] [tools/build.c] [misc/system.c] [misc/winsock_dns.c] [include/sig_context.h] [include/thread.h] 16-bit %fs handling improved: Always preserve 16-bit %fs value, always restore 32-bit %fs value for signal handlers. * [if1632/thunk.c] [loader/module.c] [misc/callback.c] [windows/user.c] [loader/ne/resource.c] [include/callback.h] [include/module.h] [if1632/kernel.spec] [if1632/wprocs.spec] Resource Handler function pointer stored as 16-bit SEGPTR. * [loader/task.c] [windows/win.c] [windows/winpos.c] [if1632/user.spec] [if1632/kernel.spec] [loader/ne/module.c] Some minor incompatibilities fixed (Win32s relies on those): GetExePtr, IsWindow16 should set ES on return; WINPOS_SendNCCalcSize should cope with having the WINDOWPOS structure trashed; the OFSTRUCT in the NE module image should be placed *last*. * [include/windows.h] Missing prototype for FlushViewOfFile. * [loader/task.c] Bugfix: Command line should *not* start with a blank. * [loader/ne/segment.c] Bugfix: Fixups to offset 0 were never applied. * [misc/lstr.c] Use debugstr_a in OutputDebugString16. * [msdos/dpmi.c] Stub for int 31 BL=2f AX=7a20 (NetWare: Get VLM Call Address) added. * [msdos/int21.c] Stub for int 21 AX=440d CL=6f (get drive map information) added. Fri Jun 26 18:08:30 1998 Rein Klazes <rklazes@casema.net> * [windows/winpos.c] Fix small buglet that mixed up maximized and minimized windows. * [include/x11drv.h] [objects/dc.c] [graphics/x11drv/pen.c] [graphics/x11drv/graphics.c] Fix some bugs with lines joining styles. Draws rectangles with thick pens now correctly. Fri Jun 26 16:22:23 1998 James Juran <jrj120@psu.edu> * [misc/shell.c] Fixed bug I introduced last release in InternalExtractIcon. * [win32/file.c] Added documentation for CreateFile32A. * [documentation/wine.man] Updated manpage. * [ChangeLog] Added my entry from last release. Fri Jun 26 13:33:30 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [graphics/psdrv/*] [if1632/wineps.spec] [include/psdrv.h] [include/print.h] [objects/gdiobj.c] First stages of an internal Postscript driver. See graphics/psdrv/README . Should print text (badly) from win3.1 notepad, write and winword6. * [documentation/printing] Some notes on printing. * [controls/edit.c] Strip off WS_BORDER in WM_NCREATE, edit draws its own rectangle. EC_USEFONTINFO seems to be used as a left/right value for EM_SETMARGINS and not as an action as the docs say. This actually makes more sense. Scroll the caret back to zero after a WM_SETTEXT. Fri Jun 26 10:56:25 1998 Marcus Meissner <marcus@jet.franken.de> * [if1632/snoop.c] Added win16 inter-dll snooping. * [win32/ordinals.c] KERNEL_485 is GetProcessDword. * [include/xmalloc.h][include/bitmap.h][misc/xmalloc.c] Added xcalloc so we 0 initialize XImages. Fixes/Hides the 'junk around MOPYFish'. * [misc/ntdll.c] Some stubs added. Thu Jun 25 15:22:43 1998 Adrian Harvey <adrian@select.com.au> * [scheduler/thread.c] Implemented SuspendThread and ResumeThread. Thu Jun 25 00:55:03 1998 Peter Hunnisett <hunnise@nortel.ca> * [include/debug.h,dplay.h,dsound.h][multimedia/dsound.c,dplay.c] [relay32/dplayx.spec,dplay.spec][multimedia/Makefile.in] [documentation/status/directplay] Added preliminary support for DirectPlay & DirectPlayLobby. Moved the preliminary stubs put in the dsound files into two new files dplay.h and dplay.c. Added new debug channel (dplay) for this. Created new document to keep track of implementation. * [include/winioctl.h][win32/device.c] Added some framework in DeviceIoControl to, in the future, support the "builtin" windows dwIoControlCodes. Added new header file winioctl.h . * [multimedia/mmsystem.c] Added slightly improved debugging information for PlaySound. Wed Jun 24 12:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de> * [files/profile.c][graphics/x11drv/xfont.c][loader/module.c] Changed lstrcmpi32A to strcasecmp, lstrncmpi32A to strncasecmp, lstrcpy32A to strcpy, lstrlen32A to strlen, lstrcmp32A to strcmp because it's not necessary to support locale on such places. It causes a huge overhead and even fails sometimes * [include/oleauto.h][include/winerror.h] Added some ole-related constants. * [misc/shell.c] SHELL32_DllGetClassObject, SHGetSpecialFolderLocation, SHGetPathFromIDList improved the stubs * [ole/folders.c] IShellFolder* functions rewrote the stubs so don't crash and give something sensible back, started implementation of. * [ole/typelib.c][relay32/oleaut32.spec] LoadTypeLib32, RegisterTypeLib stub. * [ole/ole2nls.c] Fixed a buffer overrun in CompareString32A. Test for a bad pointer in LCMapString32A (happens in winhlp32 while building a index for searching). * [relay32/oleaut32.spec] [ole/typelib.c] Added stub for LoadTypeLib (ole32) to make excel95 happy. Tue Jun 23 22:47:09 1998 Alex Priem <alexp@sci.kun.nl> * [files/profile.c] [relay32/kernel32.spec] Added WritePrivateProfileStructA, GetPrivateProfileStructA, GetPrivateProfileSectionNames16. Tue Jun 23 01:34:43 1998 Pascal Cuoq <pcuoq@ens-lyon.fr> * [ole/ole2nls.c] GetStringTypeEx32A: Implemented CT_CTYPE2 and CT_CTYPE3 cases. LCMapString32A: Map final '\0' for '\0'-terminated strings. * [misc/shellord.c] [files/profile.c] [graphics/driver.c] [loader/module.c] [msdos/int21.c] [windows/driver.c] [files/drive.c] Changed lstrcmpi32A -> strcasecmp. Should be OK in these places. Sat Jun 20 23:40:00 1998 Bertho Stultiens <bertho@akhphd.au.dk> * [tools/wrc/] Wrc version 1.0.2 (20-Jun-1998). Please revert to the file tools/wrc/CHANGES for details. Sat Jun 20 14:58:00 1998 Marcel Baur <mbaur@g26.ethz.ch> * [ole/ole2nls.c] [ole/nls/*] Added the first 57 nls files, most are not yet complete. Wed Jun 17 11:16:54 1998 David Luyer <luyer@ucs.uwa.edu.au> * [relay32/relay386.c] [if1632/relay.c] Move debug_relay_(include|exclude)_list handling into seperate function RELAY_ShowDebugmsgsRelay(). Include checking of this for 16 bit calls (originally only 32-bit calls). * [relay32/snoop.c] [misc/main.c] Add debug_snoop_(include|exclude)_list as per the relay stuff. Fix typo and add information on -debugmsg +/-relay=... in help on -debugmsg. Refer to availability of snoop too. Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [controls/header.c][include/header.h][include/commctrl.h] Added owner draw support. * [windows/nonclient.c][windows/sysmetics.c] Fixed menu bar height for Win95 look. Split NC_AdjustRect95() into NC_AdjustRectOuter95() and NC_AdjustRectInner95 to fix a menu bar bug. Improved Win95 look. * [controls/progress.c] Improved drawing code. Borders will be drawn by non-client code. * [controls/updown.c] Changed memory allocation and fixed some bugs. * [controls/toolbar.c] Fixed TB_BUTTONSTRUCTSIZE bug in MFC programs. Several improvements. * [misc/shell.c] Added stub for BrowseForFoldersA(). * [misc/shellord.c] Added stub for SHELL32_147(). * [controls/comctl32undoc.c] Minor changes. * [documentation/common_controls] New File: Documentation about development status, undocumented features and functions of the common controls.
parent f90efa9c
This is release 980614 of Wine, the MS Windows emulator. This is still a
This is release 980628 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-980614: (see ChangeLog for details)
- Many drawing fixes.
- Inter-DLL calls snooping.
WHAT'S NEW with Wine-980628: (see ChangeLog for details)
- Common controls improvements.
- Win16 DLL snooping.
- Preliminary internal Postscript driver.
- Improved DIB section handling.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -16,10 +18,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980614.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980614.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980614.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980614.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980628.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980628.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980628.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980628.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
......@@ -13,17 +13,21 @@ General:
* Incomplete thread/process scheduling support in Win32 code.
* Threading for non Linux systems completely missing. (might use
LWPs in Solaris, FreeBSD? NetBSD? SCO?)
* Very alpha printing code using win16 drivers.
We should add a WINE internal PostScript driver (all other printers
can be supported using ghostscript filters).
* Extremely alpha Win95 interface code.
* Very alpha internal Postscript driver. [h.davies1@physics.ox.ac.uk]
* Extremely alpha Win95 interface code.
* No OLE2 and OLE32 support (including OLE2 interfaces etc.).
(started work on pidl-handling, IShellFolders IEnumIdLists
and SH* functions juergen.schmied@metronet.de)
* No MS Video support. [just started, marcus@jet.franken.de]
* COMDLG32 support not complete yet [bertho@akhphd.au.dk?]
* COMDLG32 support not complete yet [bertho@akhphd.au.dk]
* COMMCTRL/COMCTL32 support in progress [ekohl@abo.rhein-zeitung.de].
......
----------------------------------------------------------------------
Sun Jun 28 18:37:02 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/signal.c] [miscemu/instr.c] [memory/virtual.c]
Moved page-fault handling to INSTR_EmulateInstruction.
* [scheduler/thread.c]
Added locking and check for own thread in Suspend/ResumeThread.
Sat Jun 27 21:25:21 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [objects/dib.c] [objects/bitmap.c] [objects/oembitmap.c]
[graphics/x11drv/bitblt.c] [include/bitmap.h]
Improved DIB section handling using page fault handlers.
(Note: This patch includes code contributed by Matthew J. Francis.)
* [memory/virtual.c] [if1632/signal.c] [include/global.h]
Page Fault handler support added.
* [if1632/signal.c] [loader/signal.c] [tools/build.c] [misc/system.c]
[misc/winsock_dns.c] [include/sig_context.h] [include/thread.h]
16-bit %fs handling improved: Always preserve 16-bit %fs value,
always restore 32-bit %fs value for signal handlers.
* [if1632/thunk.c] [loader/module.c] [misc/callback.c] [windows/user.c]
[loader/ne/resource.c] [include/callback.h] [include/module.h]
[if1632/kernel.spec] [if1632/wprocs.spec]
Resource Handler function pointer stored as 16-bit SEGPTR.
* [loader/task.c] [windows/win.c] [windows/winpos.c] [if1632/user.spec]
[if1632/kernel.spec] [loader/ne/module.c]
Some minor incompatibilities fixed (Win32s relies on those):
GetExePtr, IsWindow16 should set ES on return; WINPOS_SendNCCalcSize
should cope with having the WINDOWPOS structure trashed;
the OFSTRUCT in the NE module image should be placed *last*.
* [include/windows.h]
Missing prototype for FlushViewOfFile.
* [loader/task.c]
Bugfix: Command line should *not* start with a blank.
* [loader/ne/segment.c]
Bugfix: Fixups to offset 0 were never applied.
* [misc/lstr.c]
Use debugstr_a in OutputDebugString16.
* [msdos/dpmi.c]
Stub for int 31 BL=2f AX=7a20 (NetWare: Get VLM Call Address) added.
* [msdos/int21.c]
Stub for int 21 AX=440d CL=6f (get drive map information) added.
Fri Jun 26 18:08:30 1998 Rein Klazes <rklazes@casema.net>
* [windows/winpos.c]
Fix small buglet that mixed up maximized and minimized windows.
* [include/x11drv.h] [objects/dc.c] [graphics/x11drv/pen.c]
[graphics/x11drv/graphics.c]
Fix some bugs with lines joining styles. Draws rectangles
with thick pens now correctly.
Fri Jun 26 16:22:23 1998 James Juran <jrj120@psu.edu>
* [misc/shell.c]
Fixed bug I introduced last release in InternalExtractIcon.
* [win32/file.c]
Added documentation for CreateFile32A.
* [documentation/wine.man]
Updated manpage.
* [ChangeLog]
Added my entry from last release.
Fri Jun 26 13:33:30 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [if1632/wineps.spec] [include/psdrv.h]
[include/print.h] [objects/gdiobj.c]
First stages of an internal Postscript driver. See
graphics/psdrv/README . Should print text (badly) from win3.1 notepad,
write and winword6.
* [documentation/printing]
Some notes on printing.
* [controls/edit.c]
Strip off WS_BORDER in WM_NCREATE, edit draws its own rectangle.
EC_USEFONTINFO seems to be used as a left/right value for EM_SETMARGINS
and not as an action as the docs say. This actually makes more sense.
Scroll the caret back to zero after a WM_SETTEXT.
Fri Jun 26 10:56:25 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/snoop.c]
Added win16 inter-dll snooping.
* [win32/ordinals.c]
KERNEL_485 is GetProcessDword.
* [include/xmalloc.h][include/bitmap.h][misc/xmalloc.c]
Added xcalloc so we 0 initialize XImages.
Fixes/Hides the 'junk around MOPYFish'.
* [misc/ntdll.c]
Some stubs added.
Thu Jun 25 15:22:43 1998 Adrian Harvey <adrian@select.com.au>
* [scheduler/thread.c]
Implemented SuspendThread and ResumeThread.
Thu Jun 25 00:55:03 1998 Peter Hunnisett <hunnise@nortel.ca>
* [include/debug.h,dplay.h,dsound.h][multimedia/dsound.c,dplay.c]
[relay32/dplayx.spec,dplay.spec][multimedia/Makefile.in]
[documentation/status/directplay]
Added preliminary support for DirectPlay & DirectPlayLobby. Moved the
preliminary stubs put in the dsound files into two new files
dplay.h and dplay.c.
Added new debug channel (dplay) for this.
Created new document to keep track of implementation.
* [include/winioctl.h][win32/device.c]
Added some framework in DeviceIoControl to, in the future, support
the "builtin" windows dwIoControlCodes. Added new header file
winioctl.h .
* [multimedia/mmsystem.c]
Added slightly improved debugging information for PlaySound.
Wed Jun 24 12:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [files/profile.c][graphics/x11drv/xfont.c][loader/module.c]
Changed lstrcmpi32A to strcasecmp, lstrncmpi32A to strncasecmp,
lstrcpy32A to strcpy, lstrlen32A to strlen, lstrcmp32A to strcmp
because it's not necessary to support locale on such places.
It causes a huge overhead and even fails sometimes
* [include/oleauto.h][include/winerror.h]
Added some ole-related constants.
* [misc/shell.c]
SHELL32_DllGetClassObject, SHGetSpecialFolderLocation,
SHGetPathFromIDList improved the stubs
* [ole/folders.c]
IShellFolder* functions rewrote the stubs so don't crash and give
something sensible back, started implementation of.
* [ole/typelib.c][relay32/oleaut32.spec]
LoadTypeLib32, RegisterTypeLib stub.
* [ole/ole2nls.c]
Fixed a buffer overrun in CompareString32A.
Test for a bad pointer in LCMapString32A (happens
in winhlp32 while building a index for searching).
* [relay32/oleaut32.spec] [ole/typelib.c]
Added stub for LoadTypeLib (ole32) to make excel95 happy.
Tue Jun 23 22:47:09 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [relay32/kernel32.spec]
Added WritePrivateProfileStructA, GetPrivateProfileStructA,
GetPrivateProfileSectionNames16.
Tue Jun 23 01:34:43 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [ole/ole2nls.c]
GetStringTypeEx32A: Implemented CT_CTYPE2 and CT_CTYPE3 cases.
LCMapString32A: Map final '\0' for '\0'-terminated strings.
* [misc/shellord.c] [files/profile.c] [graphics/driver.c]
[loader/module.c] [msdos/int21.c] [windows/driver.c] [files/drive.c]
Changed lstrcmpi32A -> strcasecmp. Should be OK in these places.
Sat Jun 20 23:40:00 1998 Bertho Stultiens <bertho@akhphd.au.dk>
* [tools/wrc/]
Wrc version 1.0.2 (20-Jun-1998). Please revert to
the file tools/wrc/CHANGES for details.
Sat Jun 20 14:58:00 1998 Marcel Baur <mbaur@g26.ethz.ch>
* [ole/ole2nls.c] [ole/nls/*]
Added the first 57 nls files, most are not yet complete.
Wed Jun 17 11:16:54 1998 David Luyer <luyer@ucs.uwa.edu.au>
* [relay32/relay386.c] [if1632/relay.c]
Move debug_relay_(include|exclude)_list handling into
seperate function RELAY_ShowDebugmsgsRelay(). Include
checking of this for 16 bit calls (originally only
32-bit calls).
* [relay32/snoop.c] [misc/main.c]
Add debug_snoop_(include|exclude)_list as per the relay stuff.
Fix typo and add information on -debugmsg +/-relay=... in
help on -debugmsg. Refer to availability of snoop too.
Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/header.c][include/header.h][include/commctrl.h]
Added owner draw support.
* [windows/nonclient.c][windows/sysmetics.c]
Fixed menu bar height for Win95 look.
Split NC_AdjustRect95() into NC_AdjustRectOuter95() and
NC_AdjustRectInner95 to fix a menu bar bug.
Improved Win95 look.
* [controls/progress.c]
Improved drawing code. Borders will be drawn by non-client code.
* [controls/updown.c]
Changed memory allocation and fixed some bugs.
* [controls/toolbar.c]
Fixed TB_BUTTONSTRUCTSIZE bug in MFC programs.
Several improvements.
* [misc/shell.c]
Added stub for BrowseForFoldersA().
* [misc/shellord.c]
Added stub for SHELL32_147().
* [controls/comctl32undoc.c]
Minor changes.
* [documentation/common_controls]
New File: Documentation about development status, undocumented
features and functions of the common controls.
----------------------------------------------------------------------
Sun Jun 15 10:30:35 1998 Andreas Mohr <100.30936@germany.net>
* [files/dos_fs.c] [files/file.c] [if1632/wprocs.spec]
......@@ -112,6 +350,27 @@ Fri Jun 12 06:23:19 1998 Matthew Becker <mbecker@glasscity.net>
Added stubs for OpenDesktopA, SetThreadDesktop, and
SetUserObjectInformationA.
Wed Jun 10 20:28:08 1998 James Juran <jrj120@psu.edu>
* [debugger/break.c]
Fixed bug introduced in 980503 that broke the -debug command
line option for PE executable files.
* [configure.in] [include/acconfig.h] [include/debugtools.h]
[documentation/debug-msgs]
Added 'configure' options to compile out debugging messages.
Use --disable-debug to disable all debugging messages, and
--disable-trace to just disable TRACE messages. This results
in a stripped executable that is 15-20% smaller. This option
is very much untested--don't expect it to work.
* [documentation/debug-msgs] [documentation/debugging]
Minor updates.
* [*/*.c]
Fixed some compile warnings. This also includes the
compile_warnings_trivial patch from WineHQ.
Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [windows/sysmetrics.c][include/sysmetrics.h]
......
......@@ -50,6 +50,7 @@ LIBSUBDIRS = \
EMUSUBDIRS = \
debugger \
graphics/psdrv \
graphics/win16drv \
if1632 \
miscemu
......@@ -95,6 +96,7 @@ LIBOBJS = \
EMUOBJS = \
debugger/debugger.o \
graphics/psdrv/psdrv.o \
graphics/win16drv/win16drv.o \
if1632/if1632.o \
miscemu/miscemu.o
......
......@@ -2447,7 +2447,7 @@ EOF
fi
for ac_func in clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid
for ac_func in clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2454: checking for $ac_func" >&5
......@@ -3303,6 +3303,7 @@ documentation/Makefile
files/Makefile
graphics/Makefile
graphics/metafiledrv/Makefile
graphics/psdrv/Makefile
graphics/win16drv/Makefile
graphics/x11drv/Makefile
if1632/Makefile
......@@ -3435,6 +3436,7 @@ documentation/Makefile
files/Makefile
graphics/Makefile
graphics/metafiledrv/Makefile
graphics/psdrv/Makefile
graphics/win16drv/Makefile
graphics/x11drv/Makefile
if1632/Makefile
......
......@@ -235,7 +235,7 @@ fi
dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid)
AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
AC_CHECK_HEADERS(wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h)
AC_HEADER_STAT()
AC_C_CONST()
......@@ -442,6 +442,7 @@ documentation/Makefile
files/Makefile
graphics/Makefile
graphics/metafiledrv/Makefile
graphics/psdrv/Makefile
graphics/win16drv/Makefile
graphics/x11drv/Makefile
if1632/Makefile
......
......@@ -11,6 +11,7 @@
*
* TODO
* - Fix DSA_InsertItem.
* - Fix DSA_GetItem.
* - Write documentation.
*/
......@@ -39,10 +40,6 @@ typedef struct _DPA_DATA
} DPA_DATA, *LPDPA_DATA;
DWORD WINAPI Alloc (DWORD);
DWORD WINAPI ReAlloc (DWORD, DWORD);
DWORD WINAPI Free (DWORD);
DWORD WINAPI DSA_Create (DWORD, DWORD);
......@@ -51,31 +48,32 @@ DWORD WINAPI DPA_GetPtr (DWORD, DWORD);
DWORD WINAPI DPA_InsertPtr (DWORD, DWORD, DWORD);
LPSTR WINAPI COMCTL32_StrChrA (LPSTR lpString, CHAR cChar);
DWORD WINAPI
Alloc (DWORD dwParam1)
COMCTL32_Alloc (DWORD dwParam)
{
DWORD dwPtr;
dwPtr = (DWORD)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, dwParam1);
dwPtr = (DWORD)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, dwParam);
TRACE (commctrl, "(0x%08lx) ret=0x%08lx\n", dwParam1, dwPtr);
TRACE (commctrl, "(0x%08lx) ret=0x%08lx\n", dwParam, dwPtr);
return dwPtr;
}
DWORD WINAPI
ReAlloc (DWORD dwParam1, DWORD dwParam2)
COMCTL32_ReAlloc (DWORD dwParam1, DWORD dwParam2)
{
DWORD dwPtr;
if (dwParam1 == 0)
dwPtr = (DWORD)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, dwParam2);
dwPtr = (DWORD)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
dwParam2);
else
dwPtr = (DWORD)HeapReAlloc (SystemHeap, HEAP_ZERO_MEMORY,
dwPtr = (DWORD)HeapReAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
(LPVOID)dwParam1, dwParam2);
TRACE (commctrl, "(0x%08lx 0x%08lx) ret=0x%08lx\n",
......@@ -86,15 +84,21 @@ ReAlloc (DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI
Free (DWORD dwParam1)
COMCTL32_Free (DWORD dwParam)
{
TRACE (commctrl, "(0x%08lx)\n", dwParam1);
HeapFree (SystemHeap, 0, (LPVOID)dwParam1);
TRACE (commctrl, "(0x%08lx)\n", dwParam);
HeapFree (GetProcessHeap (), 0, (LPVOID)dwParam);
return 0;
}
DWORD WINAPI
COMCTL32_GetSize (DWORD dwParam)
{
TRACE (commctrl, "(0x%08lx)\n", dwParam);
return (HeapSize (GetProcessHeap (), 0, (LPVOID)dwParam));
}
......@@ -136,6 +140,36 @@ DSA_Destroy (DWORD dwParam1)
DWORD WINAPI
DSA_GetItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
{
FIXME (commctrl, "(0x%08lx 0x%08lx 0x%08lx): stub!\n",
dwParam1, dwParam2, dwParam3);
return 0;
}
DWORD WINAPI
DSA_GetItemPtr (DWORD dwParam1, DWORD dwParam2)
{
LPDSA_DATA dsaPtr = (LPDSA_DATA)dwParam1;
TRACE (commctrl, "(0x%08lx 0x%08lx)\n", dwParam1, dwParam2);
if (dsaPtr == NULL)
return 0;
if (dsaPtr->ptrs == NULL)
return 0;
if ((dwParam2 < 0) || (dwParam2 >= dsaPtr->dwEntryCount))
return 0;
TRACE (commctrl, "ret=0x%08lx\n", (DWORD)dsaPtr->ptrs[dwParam2]);
return (DWORD)dsaPtr->ptrs[dwParam2];
}
DWORD WINAPI
DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
{
LPDSA_DATA dsaPtr = (LPDSA_DATA)dwParam1;
......@@ -188,24 +222,6 @@ DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
}
DWORD WINAPI
DSA_GetItemPtr (DWORD dwParam1, DWORD dwParam2)
{
LPDSA_DATA dsaPtr = (LPDSA_DATA)dwParam1;
TRACE (commctrl, "(0x%08lx 0x%08lx)\n", dwParam1, dwParam2);
if (dsaPtr == NULL)
return 0;
if (dsaPtr->ptrs == NULL)
return 0;
if ((dwParam2 < 0) || (dwParam2 >= dsaPtr->dwEntryCount))
return 0;
TRACE (commctrl, "ret=0x%08lx\n", (DWORD)dsaPtr->ptrs[dwParam2]);
return (DWORD)dsaPtr->ptrs[dwParam2];
}
DWORD WINAPI
......
......@@ -218,7 +218,7 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
/***********************************************************************
* MenuHelp (COMCTL32.2)
* MenuHelp [COMCTL32.2]
*
*
*
......@@ -245,7 +245,6 @@ MenuHelp (UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, HMENU32 hMainMenu,
else {
if (HIWORD(wParam) & MF_POPUP) {
TRACE (commctrl, "popup menu selected!\n");
FIXME (commctrl, "no popup menu texts!\n");
szStatusText[0] = 0;
}
......@@ -281,7 +280,7 @@ CreateToolbarEx (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
INT32 dxBitmap, INT32 dyBitmap, UINT32 uStructSize)
{
HWND32 hwndTB =
CreateWindowEx32A(0, TOOLBARCLASSNAME32A, "", style, 0, 0, 0, 0,
CreateWindowEx32A (0, TOOLBARCLASSNAME32A, "", style, 0, 0, 0, 0,
hwnd, (HMENU32)wID, 0, NULL);
if(hwndTB) {
TBADDBITMAP tbab;
......@@ -348,35 +347,39 @@ CreateToolbar (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
/***********************************************************************
* GetEffectiveClientRect [COMCTL32.4]
*
* PARAMS
* hwnd [I] handle to the client window.
* lpRect [O] pointer to the rectangle of the client window
* lpInfo [I] pointer to an array of integers
*
*
* NOTES
*/
VOID WINAPI
GetEffectiveClientRect (HWND32 hwnd, LPRECT32 lpRect, LPINT32 lpInfo)
{
RECT32 rcClient, rcCtrl;
HWND32 hwndCtrl;
LPINT32 lpRun;
INT32 idCtrl, *lpRun;
TRACE (commctrl, "hwnd=0x%08lx lpRect=0x%08lx lpInfo=0x%08lx\n",
(DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo);
GetClientRect32 (hwnd, &rcClient);
#if 0
lpRun = lpInfo;
TRACE (commctrl, "*lpRun=0x%08x\n", *lpRun);
while (*lpRun) {
lpRun++;
TRACE (commctrl, "control id 0x%08x\n", *lpRun);
hwndCtrl = GetDlgItem32 (hwnd, *lpRun);
GetWindowRect32 (hwndCtrl, &rcCtrl);
do {
lpRun += 3;
idCtrl = *lpRun;
if (idCtrl) {
TRACE (commctrl, "control id 0x%x\n", idCtrl);
GetWindowRect32 (GetDlgItem32 (hwnd, idCtrl), &rcCtrl);
MapWindowPoints32 (NULL, hwnd, (LPPOINT32)&rcCtrl, 2);
SubtractRect32 (&rcClient, &rcClient, &rcCtrl);
lpRun++;
TRACE (commctrl, "*lpRun=0x%08x\n", *lpRun);
}
} while (idCtrl);
#endif
CopyRect32 (lpRect, &rcClient);
}
......@@ -6,7 +6,6 @@
* TODO:
* - Imagelist support (partially).
* - Callback items.
* - Owner draw support.
* - Order list support.
* - Control specific cursors (over dividers).
* - Hottrack support (partially).
......@@ -38,8 +37,10 @@
static INT32
HEADER_DrawItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi, BOOL32 bHotTrack)
HEADER_DrawItem (WND *wndPtr, HDC32 hdc, INT32 iItem, BOOL32 bHotTrack)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_ITEM *phdi = &infoPtr->items[iItem];
RECT32 r;
INT32 oldBkMode;
......@@ -62,7 +63,18 @@ HEADER_DrawItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi, BOOL32 bHotTrack)
DrawEdge32 (hdc, &r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST);
if (phdi->fmt & HDF_OWNERDRAW) {
/* FIXME: owner drawn items */
DRAWITEMSTRUCT32 dis;
dis.CtlType = ODT_HEADER;
dis.CtlID = wndPtr->wIDmenu;
dis.itemID = iItem;
dis.itemAction = ODA_DRAWENTIRE;
dis.itemState = phdi->bDown ? ODS_SELECTED : 0;
dis.hwndItem = wndPtr->hwndSelf;
dis.hDC = hdc;
dis.rcItem = r;
dis.itemData = phdi->lParam;
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_DRAWITEM,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&dis);
}
else {
UINT32 uTextJustify = DT_LEFT;
......@@ -161,7 +173,6 @@ HEADER_DrawItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi, BOOL32 bHotTrack)
}
if (phdi->fmt & HDF_IMAGE) {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
// ImageList_Draw (infoPtr->himl, phdi->iImage,...);
......@@ -203,7 +214,7 @@ HEADER_Refresh (WND *wndPtr, HDC32 hdc)
x = rect.left;
for (i = 0; i < infoPtr->uNumItem; i++) {
x = HEADER_DrawItem (wndPtr, hdc, &infoPtr->items[i], FALSE);
x = HEADER_DrawItem (wndPtr, hdc, i, FALSE);
}
if ((x <= rect.right) && (infoPtr->uNumItem > 0)) {
......@@ -219,14 +230,14 @@ HEADER_Refresh (WND *wndPtr, HDC32 hdc)
static void
HEADER_RefreshItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi)
HEADER_RefreshItem (WND *wndPtr, HDC32 hdc, INT32 iItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HFONT32 hFont, hOldFont;
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject32 (SYSTEM_FONT);
hOldFont = SelectObject32 (hdc, hFont);
HEADER_DrawItem (wndPtr, hdc, phdi, FALSE);
HEADER_DrawItem (wndPtr, hdc, iItem, FALSE);
SelectObject32 (hdc, hOldFont);
}
......@@ -501,8 +512,8 @@ HEADER_DeleteItem (WND *wndPtr, WPARAM32 wParam)
if (infoPtr->uNumItem == 1) {
TRACE(header, "Simple delete!\n");
if (infoPtr->items[0].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[0].pszText);
HeapFree (SystemHeap, 0, infoPtr->items);
HeapFree (GetProcessHeap (), 0, infoPtr->items[0].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items);
infoPtr->items = 0;
infoPtr->uNumItem = 0;
}
......@@ -511,10 +522,10 @@ HEADER_DeleteItem (WND *wndPtr, WPARAM32 wParam)
TRACE(header, "Complex delete! [iItem=%d]\n", iItem);
if (infoPtr->items[iItem].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[iItem].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
infoPtr->uNumItem--;
infoPtr->items = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (HEADER_ITEM) * infoPtr->uNumItem);
/* pre delete copy */
if (iItem > 0) {
......@@ -528,7 +539,7 @@ HEADER_DeleteItem (WND *wndPtr, WPARAM32 wParam)
(infoPtr->uNumItem - iItem) * sizeof(HEADER_ITEM));
}
HeapFree (SystemHeap, 0, oldItems);
HeapFree (GetProcessHeap (), 0, oldItems);
}
HEADER_SetItemBounds (wndPtr);
......@@ -669,7 +680,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
iItem = infoPtr->uNumItem;
if (infoPtr->uNumItem == 0) {
infoPtr->items = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (HEADER_ITEM));
infoPtr->uNumItem++;
}
......@@ -677,7 +688,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HEADER_ITEM *oldItems = infoPtr->items;
infoPtr->uNumItem++;
infoPtr->items = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (HEADER_ITEM) * infoPtr->uNumItem);
/* pre insert copy */
if (iItem > 0) {
......@@ -691,7 +702,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
(infoPtr->uNumItem - iItem) * sizeof(HEADER_ITEM));
}
HeapFree (SystemHeap, 0, oldItems);
HeapFree (GetProcessHeap (), 0, oldItems);
}
infoPtr->items[iItem].bDown = FALSE;
......@@ -703,7 +714,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (phdi->mask & HDI_TEXT) {
len = lstrlen32A (phdi->pszText);
infoPtr->items[iItem].pszText =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, len+1);
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (infoPtr->items[iItem].pszText, phdi->pszText);
infoPtr->items[iItem].cchTextMax = phdi->cchTextMax;
}
......@@ -748,7 +759,7 @@ HEADER_Layout (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
lpLayout->pwpos->cy = 0;
else
lpLayout->pwpos->cy = infoPtr->nHeight;
lpLayout->pwpos->flags = SWP_NOACTIVATE|SWP_NOZORDER;
lpLayout->pwpos->flags = SWP_NOZORDER;
TRACE (header, "Layout x=%d y=%d cx=%d cy=%d\n",
lpLayout->pwpos->x, lpLayout->pwpos->y,
......@@ -818,9 +829,9 @@ HEADER_SetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (phdi->mask & HDI_TEXT) {
INT32 len = lstrlen32A (phdi->pszText);
if (infoPtr->items[iItem].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[iItem].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
infoPtr->items[iItem].pszText =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, len+1);
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (infoPtr->items[iItem].pszText, phdi->pszText);
infoPtr->items[iItem].cchTextMax = phdi->cchTextMax;
}
......@@ -859,7 +870,7 @@ HEADER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HFONT32 hOldFont;
HDC32 hdc;
infoPtr = (HEADER_INFO *)HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY,
infoPtr = (HEADER_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(HEADER_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
......@@ -896,15 +907,15 @@ HEADER_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (infoPtr->items) {
for (iItem = 0; iItem < infoPtr->uNumItem; iItem++) {
if (infoPtr->items[iItem].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[iItem].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
}
HeapFree (SystemHeap, 0, infoPtr->items);
HeapFree (GetProcessHeap (), 0, infoPtr->items);
}
if (infoPtr->himl)
ImageList_Destroy (infoPtr->himl);
HeapFree (SystemHeap, 0, infoPtr);
HeapFree (GetProcessHeap (), 0, infoPtr);
return 0;
}
......@@ -962,7 +973,7 @@ HEADER_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* Send WM_CUSTOMDRAW */
hdc = GetDC32 (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, &infoPtr->items[iItem]);
HEADER_RefreshItem (wndPtr, hdc, iItem);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
TRACE (header, "Pressed item %d!\n", iItem);
......@@ -987,8 +998,6 @@ HEADER_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
}
return 0;
}
......@@ -1010,7 +1019,7 @@ HEADER_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if ((iItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER)) {
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
hdc = GetDC32 (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, &infoPtr->items[infoPtr->iMoveItem]);
HEADER_RefreshItem (wndPtr, hdc, infoPtr->iMoveItem);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
HEADER_SendClickNotify (wndPtr, HDN_ITEMCLICK32A, infoPtr->iMoveItem);
......@@ -1086,7 +1095,7 @@ HEADER_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
else
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
hdc = GetDC32 (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, &infoPtr->items[infoPtr->iMoveItem]);
HEADER_RefreshItem (wndPtr, hdc, infoPtr->iMoveItem);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
TRACE (header, "Moving pressed item %d!\n", infoPtr->iMoveItem);
......@@ -1127,7 +1136,7 @@ HEADER_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
if ((wndPtr->dwStyle & HDS_BUTTONS) && (wndPtr->dwStyle & HDS_HOTTRACK)) {
FIXME (header, "hot track support!\n");
}
return 0;
......
......@@ -13,6 +13,7 @@
#include "win.h"
#include "combo.h"
#include "debug.h"
#include "tweak.h"
/* Unimplemented yet:
* - LBS_NOSEL
......@@ -1330,7 +1331,7 @@ static LRESULT LISTBOX_InsertItem( WND *wnd, LB_DESCR *descr, INT32 index,
if (index <= descr->focus_item)
{
descr->focus_item++;
LISTBOX_MoveCaret( wnd, descr, descr->focus_item - 1, FALSE );
LISTBOX_MoveCaret( wnd, descr, descr->focus_item, FALSE );
}
/* If listbox was empty, set focus to the first item */
......@@ -1447,7 +1448,7 @@ static LRESULT LISTBOX_RemoveItem( WND *wnd, LB_DESCR *descr, INT32 index )
if (index <= descr->focus_item)
{
descr->focus_item--;
LISTBOX_MoveCaret( wnd, descr, descr->focus_item + 1, FALSE );
LISTBOX_MoveCaret( wnd, descr, descr->focus_item, FALSE );
}
return LB_OKAY;
}
......@@ -2484,6 +2485,11 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
}
break;
case WM_NCCREATE:
if (TWEAK_Win95Look)
wnd->dwExStyle |= WS_EX_CLIENTEDGE;
return DefWindowProc32A( hwnd, msg, wParam, lParam );
default:
if ((msg >= WM_USER) && (msg < 0xc000))
WARN(listbox, "[%04x]: unknown msg %04x wp %08x lp %08lx\n",
......
......@@ -653,6 +653,9 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner,
{
dwSize = GetTextExtent( hdc, lpitem->text, strlen(lpitem->text) );
lpitem->rect.right += LOWORD(dwSize);
if (TWEAK_Win95Look)
lpitem->rect.bottom += MAX (HIWORD(dwSize), sysMetrics[SM_CYMENU]- 1);
else
lpitem->rect.bottom += MAX( HIWORD(dwSize), SYSMETRICS_CYMENU );
lpitem->xTab = 0;
......@@ -698,6 +701,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND32 hwndOwner )
lpitem = &lppop->items[start];
orgX = maxX;
orgY = SYSMETRICS_CYBORDER;
maxTab = maxTabWidth = 0;
/* Parse items until column break or end of menu */
......@@ -731,6 +735,9 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND32 hwndOwner )
lppop->Height = MAX( lppop->Height, orgY );
}
if(TWEAK_Win95Look)
lppop->Height++;
lppop->Width = maxX;
ReleaseDC32( 0, hdc );
}
......@@ -881,22 +888,10 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
*/
}
if (lpitem->fState & MF_HILITE) {
RECT32 r = rect;
r.top += MENU_HighlightTopNudge;
r.bottom += MENU_HighlightBottomNudge;
r.left += MENU_HighlightLeftNudge;
r.right += MENU_HighlightRightNudge;
FillRect32( hdc, &r, GetSysColorBrush32(COLOR_HIGHLIGHT) );
}
else {
RECT32 r = rect;
r.top += MENU_HighlightTopNudge;
r.bottom += MENU_HighlightBottomNudge;
r.left += MENU_HighlightLeftNudge;
r.right += MENU_HighlightRightNudge;
FillRect32( hdc, &r, GetSysColorBrush32(COLOR_MENU) );
}
if (lpitem->fState & MF_HILITE)
FillRect32( hdc, &rect, GetSysColorBrush32(COLOR_HIGHLIGHT) );
else
FillRect32( hdc, &rect, GetSysColorBrush32(COLOR_MENU) );
SetBkMode32( hdc, TRANSPARENT );
......@@ -1147,9 +1142,6 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
lprect->bottom = lprect->top + lppop->Height;
if (suppress_draw) return lppop->Height;
if(TWEAK_Win95Look)
++lprect->bottom;
FillRect32(hDC, lprect, GetSysColorBrush32(COLOR_MENU) );
if(!TWEAK_Win95Look) {
......@@ -1157,6 +1149,11 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
MoveTo( hDC, lprect->left, lprect->bottom );
LineTo32( hDC, lprect->right, lprect->bottom );
}
else {
SelectObject32( hDC, GetSysColorPen32(COLOR_3DFACE));
MoveTo( hDC, lprect->left, lprect->bottom );
LineTo32( hDC, lprect->right, lprect->bottom );
}
if (lppop->nItems == 0) return SYSMETRICS_CYMENU;
for (i = 0; i < lppop->nItems; i++)
......
......@@ -29,25 +29,20 @@
/***********************************************************************
* PROGRESS_Paint
* Draw the arrows. The background need not be erased.
* If dc!=0, it draws on it
* PROGRESS_Draw
* Draws the progress bar.
*/
static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
static void
PROGRESS_Draw (WND *wndPtr, HDC32 hdc)
{
PROGRESS_INFO *infoPtr = PROGRESS_GetInfoPtr(wndPtr);
HBRUSH32 hbrBar, hbrBk;
int rightBar, rightMost, ledWidth;
PAINTSTRUCT32 ps;
RECT32 rect;
HDC32 hdc;
TRACE(progress, "paint pos=%d min=%d, max=%d\n",
TRACE(progress, "refresh pos=%d min=%d, max=%d\n",
infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal);
/* get a dc */
hdc = dc==0 ? BeginPaint32(wndPtr->hwndSelf, &ps) : dc;
/* get the required bar brush */
if (infoPtr->ColorBar == CLR_DEFAULT)
hbrBar = GetSysColorBrush32(COLOR_HIGHLIGHT);
......@@ -60,11 +55,10 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
else
hbrBk = CreateSolidBrush32 (infoPtr->ColorBk);
/* get rect for the bar, adjusted for the border */
/* get client rectangle */
GetClientRect32 (wndPtr->hwndSelf, &rect);
/* draw the border */
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST);
/* draw the background */
FillRect32(hdc, &rect, hbrBk);
rect.left++; rect.right--; rect.top++; rect.bottom--;
......@@ -125,13 +119,40 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
/* delete background brush */
if (infoPtr->ColorBk != CLR_DEFAULT)
DeleteObject32 (hbrBk);
}
/* clean-up */
if(!dc)
EndPaint32(wndPtr->hwndSelf, &ps);
/***********************************************************************
* PROGRESS_Refresh
* Draw the progress bar. The background need not be erased.
*/
static void
PROGRESS_Refresh (WND *wndPtr)
{
HDC32 hdc;
hdc = GetDC32 (wndPtr->hwndSelf);
PROGRESS_Draw (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
}
/***********************************************************************
* PROGRESS_Paint
* Draw the progress bar. The background need not be erased.
* If dc!=0, it draws on it
*/
static void
PROGRESS_Paint (WND *wndPtr)
{
PAINTSTRUCT32 ps;
HDC32 hdc;
hdc = BeginPaint32 (wndPtr->hwndSelf, &ps);
PROGRESS_Draw (wndPtr, hdc);
EndPaint32 (wndPtr->hwndSelf, &ps);
}
/***********************************************************************
* PROGRESS_CoercePos
* Makes sure the current position (CUrVal) is within bounds.
*/
......@@ -157,9 +178,14 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
switch(message)
{
case WM_NCCREATE:
wndPtr->dwExStyle |= WS_EX_STATICEDGE;
return TRUE;
case WM_CREATE:
/* allocate memory for info struct */
infoPtr = (PROGRESS_INFO *)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr =
(PROGRESS_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(PROGRESS_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
......@@ -175,7 +201,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
case WM_DESTROY:
TRACE(progress, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
HeapFree (SystemHeap, 0, infoPtr);
HeapFree (GetProcessHeap (), 0, infoPtr);
break;
case WM_ERASEBKGND:
......@@ -194,7 +220,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
break;
case WM_PAINT:
PROGRESS_Paint(wndPtr, wParam);
PROGRESS_Paint (wndPtr);
break;
case PBM_DELTAPOS:
......@@ -204,8 +230,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(wParam != 0){
infoPtr->CurVal += (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
......@@ -216,8 +241,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(temp != wParam){
infoPtr->CurVal = (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
......@@ -231,8 +255,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal+1;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
......@@ -251,10 +274,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->CurVal > infoPtr->MaxVal)
infoPtr->CurVal = infoPtr->MinVal;
if(temp != infoPtr->CurVal)
{
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
}
PROGRESS_Refresh (wndPtr);
return temp;
case PBM_SETRANGE32:
......@@ -266,8 +286,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal+1;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
......@@ -287,16 +306,14 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if (wParam)
UNKNOWN_PARAM(PBM_SETBARCOLOR, wParam, lParam);
infoPtr->ColorBar = (COLORREF)lParam;
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
break;
case PBM_SETBKCOLOR:
if (wParam)
UNKNOWN_PARAM(PBM_SETBKCOLOR, wParam, lParam);
infoPtr->ColorBk = (COLORREF)lParam;
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
break;
default:
......@@ -316,7 +333,8 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
* Registers the progress bar window class.
*
*/
void PROGRESS_Register(void)
void
PROGRESS_Register(void)
{
WNDCLASS32A wndClass;
......
......@@ -12,12 +12,13 @@
#include "static.h"
#include "heap.h"
#include "debug.h"
#include "tweak.h"
static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintIconfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintBitmapfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintEtchedfn( WND *wndPtr, HDC32 hdc );
static COLORREF color_windowframe, color_background, color_window;
......@@ -42,9 +43,9 @@ static pfPaint staticPaintFunc[SS_TYPEMASK+1] =
NULL, /* SS_OWNERDRAW */
STATIC_PaintBitmapfn, /* SS_BITMAP */
NULL, /* SS_ENHMETAFILE */
NULL, /* SS_ETCHEDHORIZ */
NULL, /* SS_ETCHEDVERT */
NULL, /* SS_ETCHEDFRAME */
STATIC_PaintEtchedfn, /* SS_ETCHEDHORIZ */
STATIC_PaintEtchedfn, /* SS_ETCHEDVERT */
STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */
};
......@@ -170,6 +171,9 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
switch (uMsg)
{
case WM_NCCREATE:
if (TWEAK_Win95Look && (wndPtr->dwStyle & SS_SUNKEN))
wndPtr->dwExStyle |= WS_EX_STATICEDGE;
if (style == SS_ICON)
{
CREATESTRUCT32A *cs = (CREATESTRUCT32A *)lParam;
......@@ -416,3 +420,48 @@ static void STATIC_PaintBitmapfn(WND *wndPtr, HDC32 hdc )
GDI_HEAP_UNLOCK(infoPtr->hIcon);
}
}
static void STATIC_PaintEtchedfn( WND *wndPtr, HDC32 hdc )
{
RECT32 rc;
HBRUSH32 hbrush;
HPEN32 hpen;
if (!TWEAK_Win95Look) return;
GetClientRect32( wndPtr->hwndSelf, &rc );
hbrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
FillRect32( hdc, &rc, hbrush );
switch (wndPtr->dwStyle & SS_TYPEMASK)
{
case SS_ETCHEDHORZ:
hpen = SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DSHADOW));
MoveToEx32 (hdc, rc.left, rc.bottom / 2 - 1, NULL);
LineTo32 (hdc, rc.right - 1, rc.bottom / 2 - 1);
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DHIGHLIGHT));
MoveToEx32 (hdc, rc.left, rc.bottom / 2, NULL);
LineTo32 (hdc, rc.right, rc.bottom / 2);
LineTo32 (hdc, rc.right, rc.bottom / 2 - 1);
SelectObject32 (hdc, hpen);
break;
case SS_ETCHEDVERT:
hpen = SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DSHADOW));
MoveToEx32 (hdc, rc.right / 2 - 1, rc.top, NULL);
LineTo32 (hdc, rc.right / 2 - 1, rc.bottom - 1);
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DHIGHLIGHT));
MoveToEx32 (hdc, rc.right / 2, rc.top, NULL);
LineTo32 (hdc, rc.right / 2, rc.bottom);
LineTo32 (hdc, rc.right / 2 -1 , rc.bottom);
SelectObject32 (hdc, hpen);
break;
case SS_ETCHEDFRAME:
DrawEdge32 (hdc, &rc, EDGE_ETCHED, BF_RECT);
break;
}
}
......@@ -103,7 +103,7 @@ SB_DrawPart( HDC32 hdc, LPRECT32 lprc, HICON32 hIcon,
/* now draw text */
if (text) {
int oldbkmode = SetBkMode32(hdc, TRANSPARENT);
LPSTR p = text;
LPSTR p = (LPSTR)text;
UINT32 align = DT_LEFT;
if (*p == '\t') {
p++;
......
......@@ -8,7 +8,9 @@
* arrow keys
* - I am not sure about the default values for the Min, Max, Pos
* (in the UPDOWN_INFO the fields: MinVal, MaxVal, CurVal)
* - I think I do not handle correctly the WS_BORDER style.
* - I think I don not handle correctly the WS_BORDER style.
* (Should be fixed. <ekohl@abo.rhein-zeitung.de>)
*
* Testing:
* Not much. The following have not been tested at all:
* - horizontal arrows
......@@ -63,7 +65,8 @@ static int accelIndex = -1;
"UpDown Ctrl: Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
#define UPDOWN_GetInfoPtr(wndPtr) ((UPDOWN_INFO *)wndPtr->wExtra)
#define UPDOWN_GetInfoPtr(wndPtr) ((UPDOWN_INFO *)wndPtr->wExtra[0])
/***********************************************************************
* UPDOWN_InBounds
......@@ -189,7 +192,7 @@ static BOOL32 UPDOWN_GetBuddyInt(WND *wndPtr)
return FALSE;
}
else{
/* we have a regural window, so will get the text */
/* we have a regular window, so will get the text */
if (!GetWindowText32A(infoPtr->Buddy, txt, sizeof(txt)))
return FALSE;
......@@ -238,7 +241,7 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
if(WIDGETS_IsControl32(WIN_FindWndPtr(infoPtr->Buddy), BIC32_LISTBOX)){
SendMessage32A(infoPtr->Buddy, LB_SETCURSEL32, infoPtr->CurVal, 0);
}
else{ /* Regural window, so set caption to the number */
else{ /* Regular window, so set caption to the number */
len = sprintf(txt1, (infoPtr->Base==16) ? "%X" : "%d", infoPtr->CurVal);
sep = UPDOWN_GetThousandSep();
......@@ -265,19 +268,15 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
}
/***********************************************************************
* UPDOWN_Paint
* UPDOWN_Draw [Internal]
*
* Draw the arrows. The background need not be erased.
*/
static void UPDOWN_Paint(WND *wndPtr)
static void UPDOWN_Draw (WND *wndPtr, HDC32 hdc)
{
UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr(wndPtr);
PAINTSTRUCT32 ps;
BOOL32 prssed;
RECT32 rect;
HDC32 hdc;
/* start painting the button */
hdc = BeginPaint32( wndPtr->hwndSelf, &ps );
/* Draw the incr button */
UPDOWN_GetArrowRect(wndPtr, &rect, TRUE);
......@@ -298,10 +297,38 @@ static void UPDOWN_Paint(WND *wndPtr)
(wndPtr->dwStyle & UDS_HORZ ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN) |
(prssed ? DFCS_PUSHED : 0) |
(wndPtr->dwStyle&WS_DISABLED ? DFCS_INACTIVE : 0) );
}
/***********************************************************************
* UPDOWN_Refresh [Internal]
*
* Synchronous drawing (must NOT be used in WM_PAINT).
* Calls UPDOWN_Draw.
*/
static void UPDOWN_Refresh (WND *wndPtr)
{
HDC32 hdc;
hdc = GetDC32 (wndPtr->hwndSelf);
UPDOWN_Draw (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
}
/***********************************************************************
* UPDOWN_Paint [Internal]
*
* Asynchronous drawing (must ONLY be used in WM_PAINT).
* Calls UPDOWN_Draw.
*/
static void UPDOWN_Paint (WND *wndPtr)
{
PAINTSTRUCT32 ps;
HDC32 hdc;
/* clean-up */
EndPaint32( wndPtr->hwndSelf, &ps );
hdc = BeginPaint32 (wndPtr->hwndSelf, &ps);
UPDOWN_Draw (wndPtr, hdc);
EndPaint32 (wndPtr->hwndSelf, &ps);
}
/***********************************************************************
......@@ -355,6 +382,7 @@ static BOOL32 UPDOWN_SetBuddy(WND *wndPtr, HWND32 hwndBud)
/* now position the up/down */
/* Since the UDS_ALIGN* flags were used, */
/* we will pick the position and size of the window. */
SetWindowPos32(wndPtr->hwndSelf,0,x,budRect.top-DEFAULT_ADDTOP,DEFAULT_WIDTH,
(budRect.bottom-budRect.top)+DEFAULT_ADDTOP+DEFAULT_ADDBOT,
SWP_NOACTIVATE|SWP_NOZORDER);
......@@ -413,7 +441,8 @@ static void UPDOWN_DoAction(WND *wndPtr, int delta, BOOL32 incr)
/* Also, notify it */
/* FIXME: do we need to send the notification only if
we do not have the UDS_SETBUDDYINT style set? */
SendMessage32A(infoPtr->Buddy,
SendMessage32A(GetParent32 (wndPtr->hwndSelf),
wndPtr->dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
MAKELONG(incr ? SB_LINEUP : SB_LINEDOWN, infoPtr->CurVal),
wndPtr->hwndSelf);
......@@ -457,7 +486,7 @@ static BOOL32 UPDOWN_CancelMode(WND *wndPtr)
ReleaseCapture(); /* if we still have it */
infoPtr->Flags = 0; /* get rid of any flags */
UPDOWN_Paint(wndPtr); /* redraw the control just in case */
UPDOWN_Refresh (wndPtr); /* redraw the control just in case */
return TRUE;
}
......@@ -505,7 +534,7 @@ static void UPDOWN_HandleMouseEvent(WND *wndPtr, UINT32 msg, POINT32 pt)
infoPtr->Flags |= FLAG_MOUSEIN;
/* repaint the control */
UPDOWN_Paint(wndPtr);
UPDOWN_Refresh (wndPtr);
/* process the click */
UPDOWN_DoAction(wndPtr, 1, infoPtr->Flags & FLAG_INCR);
......@@ -541,7 +570,7 @@ static void UPDOWN_HandleMouseEvent(WND *wndPtr, UINT32 msg, POINT32 pt)
}
/* If state changed, redraw the control */
if(temp != infoPtr->Flags)
UPDOWN_Paint(wndPtr);
UPDOWN_Refresh (wndPtr);
break;
default:
......@@ -562,9 +591,16 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
switch(message)
{
case WM_CREATE:
case WM_NCCREATE:
/* get rid of border, if any */
wndPtr->dwStyle &= ~WS_BORDER;
return TRUE;
case WM_CREATE:
infoPtr =
(UPDOWN_INFO*)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(UPDOWN_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
/* initialize the info struct */
infoPtr->AccelCount=0; infoPtr->AccelVect=0;
......@@ -583,6 +619,10 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
case WM_DESTROY:
if(infoPtr->AccelVect)
free(infoPtr->AccelVect);
HeapFree (GetProcessHeap (), 0, infoPtr);
wndPtr->wExtra[0] = 0;
TRACE(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
break;
......@@ -796,10 +836,10 @@ void UPDOWN_Register(void)
if( GlobalFindAtom32A( UPDOWN_CLASS32A ) ) return;
ZeroMemory( &wndClass, sizeof( WNDCLASS32A ) );
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
wndClass.style = CS_GLOBALCLASS | CS_VREDRAW;
wndClass.lpfnWndProc = (WNDPROC32)UpDownWindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(UPDOWN_INFO);
wndClass.cbWndExtra = sizeof(UPDOWN_INFO*);
wndClass.hCursor = LoadCursor32A( 0, IDC_ARROW32A );
wndClass.hbrBackground = (HBRUSH32)(COLOR_3DFACE + 1);
wndClass.lpszClassName = UPDOWN_CLASS32A;
......
COMMON CONTROLS
their development status
and their UNDOCUMENTED features and functions
-----------------------------------------------------
1. Introduction
---------------
The information provided herein is based on the dll version 4.72 which
is included in MS Internet Explorer 4.01.
All information about common controls should be collected in this document.
All Wine programmers are encouraged to add their knowledge to this document.
2. General Information
----------------------
Further information about common controls can be found in the MS Platform SDK
and the MS Internet Client SDK (most recent). Information from these SDK's
will NOT be repeated here. Only information which can NOT be found in these
SDK's will be collected here. Some information in the SDK's mentioned above
is (intentionally???) WRONG. Corrections to wrong information will be
collected here too.
3. Controls
-----------
This paragraph describes the development status of the common controls.
3.1 Animation Control
---------------------
Status:
- Nothing done at all.
3.2 Combo Box Ex Control
------------------------
Status:
- Nothing done at all.
3.3 Date and Time Picker Control
--------------------------------
Status:
- Nothing done at all.
3.4 Drag List Box Control
-------------------------
Status:
- Nothing done at all.
3.5 Flat Scroll Bar Control
---------------------------
Status:
- Nothing done at all.
3.6 Header Control
------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Almost finished.
3.7 Hot Key Control
-------------------
Status:
- Nothing done at all.
3.8 Image List (no control)
---------------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Almost finished.
Notes:
Most of my test programs work as expected. But when image lists are used
in other controls (e.g. Toolbar) they don't seem to be error-free.
It looks like I have to do a major re-write (use DIB's instead of DDB's).
3.9 IP Address Control
----------------------
Status:
- Nothing done at all.
3.10 List View Control
----------------------
Status:
- Nothing done at all.
Notes:
This control id NEEDED in many places. Any volunteers??
3.11 Month Calendar Control
---------------------------
Status:
- Nothing done at all.
3.12 Pager Control
------------------
Status:
- Dummy control. No functionality.
- Not yet published.
Notes:
The dummy source code is available from the author.
3.13 Progress Bar Control
-------------------------
Author:
Original implementation by Dimitrie O. Paun.
Fixes and improvements by Eric Kohl.
Status:
- Almost finished (should behave like the original).
Notes:
WM_GETFONT and WM_SETFONT are not implemented yet. They seem to be
useless because progress bars usually don't display any textual
information. But if M$ implemented an undocumented flag to display
textual information (e.g. percentage) these messages would make sense.
3.14 Property Sheet
-------------------
Status:
- Nothing done at all.
Notes:
- This control id NEEDED in many places.
- Tab control has to be implemented first.
Any volunteers??
3.15 Rebar Control (Cool Bar)
-----------------------------
Status:
- Dummy control. No functionality.
- Not yet published.
Notes:
The dummy source code is available from the author.
3.16 Status Bar Control
-----------------------
Author:
Original implementation by Bruce Milner.
Fixes and improvements by Eric Kohl.
Status:
- Almost finished.
Notes:
- Tool tips need to be added, but since they are not done yet...
Notes:
Have a look at controls/status.c for a list of bugs and missing features.
3.17 Tab Control
----------------
Status:
- Nothing done at all.
- needed.
3.18 Toolbar Control
--------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress.
- Basic functionality is almost done. (dll version 4.0)
3.19 Tooltip Control
--------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress.
- Not yet published, but will be published soon.
3.20 Trackbar Control
---------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress.
- Not yet published, but will be published soon.
3.21 Tree View Control
----------------------
Status:
- Nothing done at all.
- needed.
3.22 Updown Control
-------------------
Author:
Original implementation by Dimitrie O. Paun.
Some minor changes by Eric Kohl <ekohl@abo.rhein-zeitung.de>.
Status:
- Unknown.
Notes:
- Have a look at controls/updown.c for a list of bugs and missing
features.
- The status is unknown, because I did not have a close look at this
control. One test-program looked quite good, but in Win95's
cdplayer.exe the control does not show at all.
Any volunteers??
4. Additional Information
-------------------------
Has to be written...
5. Undocumented features
------------------------
There are quite a lot of undocumented functions like:
- DSA (Dynnamic String Array?) functions.
- DPA (Dymnamic Pointer Array?) functions.
- MRU ("Most Recently Used" List) functions.
- other unknown functions.
Have a look at relay32/comctl32.spec.
5.1 Dymnamic String Arrays ??? (DSA)
------------------------------------
Most of the DSA functions are implemented. I used TASKMAN.EXE to write them.
Since TASKMAN.EXE doesn't bail out or crash I think I've done it right.
Have a look at the source code to get more information.
Further documentation will be written...
5.2 Dynamic Pointer Arrays ??? (DPA)
------------------------------------
Similar to the DSA functions, but they just store pointers. I have written
some stubs and semi-stubs. They are used by Explorer and IE4 but the
implementation is still incomplete since both programs seem to crash because
of other incomplete functions.
Have a look at the source code to get more information.
Further documentation will be written...
5.3 MenuHelp
------------
Has to be written...
5.4 GetEffectiveClientRect
--------------------------
Has to be written...
6. Epilogue
-----------
You see, much work has still to be done. If you are interested in writing
a control send me an e-mail. If you like to fix bugs or add some
functionality send an e-mail to the author of the control.
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Printing in Wine
================
Printing in Wine can be done in one of two ways. Both of which are very alpha.
1. Use a windows 3.1 printer driver.
2. Use the builtin Wine Postscript driver (+ ghostscript to produce output for
non-postscript printers).
1. External printer drivers
---------------------------
At present only 16 bit drivers will work.
Add
printer=on
to the [wine] section of wine.conf (or ~/.winerc). This lets CreateDC proceed
if its driver argument is a 16 bit driver.
You will probably also need to add
TTEnable=0
TTOnly=0
to the [TrueType] section of win.ini .
The code for the driver interface is in graphics/win16drv .
2. Builtin Wine Postscript driver
---------------------------------
Enables printing of postscript files via a driver built into Wine. See
graphics/psdrv/README for installation instructions. The code for the
postscript driver is in graphics/psdrv .
Spooling
========
Spooling is rather primitive. The [spooler] section of wine.conf maps a port
(e.g. LPT1:) to a file or a command via a pipe. For example the following lines
LPT1:=foo.ps
LPT2:=|lpr
map LPT1: to file foo.ps and LPT2: to the lpr command. If a job is sent to an
unlisted port then a file is created with that port's name e.g. for LPT3: a
file called LPT3: would be created.
This file contains information on the implementation of the direct play
and direct play lobby features.
Most methods and APIs are not implemented at this point. Examine the code
to see what has been implemented. Stay tuned for some information here once
there is more implementation (and I figure out what the heck I'm doing).
The files are include/dplay.h and multimedia/dplay.c.
I think I can safely say that any application which requires direct play
or direct play lobby will not work at this point. Priority will be to get
lserver.exe and star wars rebellion going (at least the direct play portions).
TODO:
Just about everything
.\" -*- nroff -*-
.TH WINE 1 "September 1, 1995" "Version 9/1/95" "Windows Emulation"
.TH WINE 1 "June 22, 1998" "Version 980614" "Windows Emulator"
.SH NAME
wine \- run Windows programs under Unix
.SH SYNOPSIS
......@@ -16,44 +16,50 @@ wine \- run Windows programs under Unix
invokes the Windows emulator.
.PP
.B wine
currently runs a number of games and small applications (approximately
half of the applets and common games actually run), although the entire API
has not been implemented.
.PP
See the files
.B README,
.B ChangeLog,
.B configure,
and the
.B Makefile
contained in the source distribution
to compile
.B wine.
currently runs a growing list of applications written for both Win3.1 and
Win95. Older, simpler applications work better than newer, more complex
ones. A large percentage of the API has been implemented, although there
are still several major pieces of work left to do.
.SH REQUIREMENTS
At present,
.B wine
will run under any Linux kernel more recent than 0.99.13, or
under recent releases of NetBSD/i386, FreeBSD and OpenBSD/i386.
.PP
The current support for multithreaded applications relies on the
.B clone(2)
system call, which is currently available only on Linux systems running
libc6 (glibc2).
.PP
.B X
must be installed.
must be installed. To use Wine's support for multithreaded applications,
your X libraries must be reetrant. If you have libc6 (glibc2), or you
compiled the libraries yourself, they were probably compiled with the
reetrant option enabled.
.PP
.B libXpm
must be installed. (It is probably available from the same site
must be installed. It is probably available from the same site
.B wine
was, or the sources may be FTP'd from ftp.x.org).
was, or the sources may be FTP'd from ftp.x.org. Usually it's in a
package named something like XFree86-devel.
.SH INSTALLATION
To install
.B Wine,
run "./configure", which will detect your specific setup and create
the Makefiles. You can run "./configure --help" to see the available
configuration options. Then do "make depend; make" to build the
run "./configure" in the top-level directory of the source, which will
detect your specific setup and create the Makefiles. You can run
"./configure --help" to see the available configuration options. Then do
"make depend; make" to build the
.B wine
executable, and then "make install" to install it. By default,
.B wine
is installed in /usr/local/bin; you can specify a different path with
the --prefix option when running
.B configure.
.PP
For more information, see the
.B README
file contained in the source distribution
.SH OPTIONS
.TP
.I -backingstore
......@@ -62,17 +68,39 @@ Turn on backing store
.I -debug
Enter the debugger before starting application
.TP
.I -debugmsg name[,name]
Turn debugging messages on or off - for instance,
.I -debugmsg +dll,+heap
will turn on DLL and heap debugging messages. The full list is: all, accel,
atom, bitblt, bitmap, caret, cdaudio, class, clipboard, clipping, combo,
comm, commdlg, crtdll, cursor, dc, dde, dialog, dll, dosfs, driver, edit,
env, event, exec, file, fixup, font, gdi, global, graphics, heap, hook,
icon, int, key, keyboard, ldt, listbox, local, mci, mcianim, mciwave, mdi,
menu, message, metafile, midi, mmio, mmsys, mmtime, module, msg, nonclient,
ole, palette, profile, prop, reg, region, relay, resource, scroll, segment,
selector,sem, sendmsg, shm, stress, string, syscolor, task, text, timer, toolhelp,ver, vxd, win, win32, winsock.
.I -debugmsg [xxx]#name[,[xxx1]#name1]
Turn debugging messages on or off.
.RS +7
.PP
xxx can be one of the following: err, warn, fixme, or trace, and # can be
either + or -. Note that there is not a space between names.
.PP
For instance:
.PP
.I -debugmsg warn+dll,+heap
will turn on DLL and heap warning messages.
.br
.I -debugmsg fixme-all,warn+cursor,+relay
will turn off all FIXME messages, turn on cursor warning messages, and turn
on all relay messages (API calls).
.PP
The full list of names is: all, accel, advapi, aspi, atom, bitblt, bitmap,
caret, cd, cdaudio, class, clipboard, clipping, combo, comm, commctrl,
commdlg, console, crtdll, cursor, dc, dde, ddeml, ddraw, debug, dialog,
dinput, dll, dosfs, driver, dsound, edit, event, exec, file, fixup, font,
gdi, global, graphics, header, heap, hook, icon, imagelist, int, int21,
int31, key, keyboard, ldt, listbox, local, mci, mcianim, mciwave, mdi, menu,
message, metafile, midi, mmaux, mmio, mmsys, mmtime, module, mpr, msg,
nonclient, ntdll, ole, palette, print, process, profile, prop, reg, region,
relay, resource, scroll, security, segment, selector, sem, sendmsg, shell,
shm, snoop, sound, stress, string, syscolor, task, text, thread, thunk, timer,
toolhelp, tweak, uitools, updown, ver, virtual, vxd, win, win16drv, win32,
wing, winsock, wnet, x11, x11drv.
.PP
For more information on debugging messages, see the file
.I documentation/debug-msgs
in the source distribution.
.RE
.TP
.I -depth n
Change the depth to use for multiple-depth screens
......@@ -133,7 +161,7 @@ Turn on synchronous display mode
.TP
.I -winver version
Specify which Windows version WINE should imitate.
Possible arguments are: win31, win95 and nt351.
Possible arguments are: win31, win95, nt351, and nt40.
.PD 1
.SH PROGRAM/ARGUMENTS
The program name may be specified in DOS format (C:\\WINDOWS\\SOL.EXE) or in
......@@ -155,7 +183,9 @@ the
.B configure
script. Alternatively, you may have a
.I .winerc
file of this format in your home directory.
file of this format in your home directory or the environment variable
.B WINE_INI
pointing to a configuration file.
.SH CONFIGURATION FILE FORMAT
All entries are grouped in sections; a section begins with the line
.br
......@@ -290,6 +320,14 @@ Used to specify which messages will be excluded from the logfile.
.br
default: none
.br Used to specify which messages will be included in the logfile.
.PP
.B [Tweak.Layout]
.br
.I format: Win95Look=<true|false>
.br
default: false
.br
Use Win95 look (true) or Win3.1 look (false).
.SH SAMPLE CONFIGURATION FILE
[Drive A]
.br
......@@ -340,6 +378,12 @@ lpt1=/dev/lp0
Exclude=WM_TIMER;WM_SETCURSOR;WM_MOUSEMOVE;WM_NCHITTEST;
.br
Include=WM_COMMAND;
.PP
[Tweak.Layout]
.br Win95Look=[true|false]
.br Win95Look=true enables Win95-like windows layouts; Win95Look=false
uses Win3.1-like displays. If this section is not included, it defaults
to false.
.SH AUTHORS
.B Wine
is available thanks to the work of Bob Amstadt, Dag Asheim,
......@@ -356,9 +400,6 @@ Erik Svendsen, Goran Thyni, Jimmy Tirtawangsa, Jon Tombs,
Linus Torvalds, Gregory Trubetskoy, Michael Veksler, Morten Welinder,
Jan Willamowius, Carl Williams, Karl Guenter Wuensch, Eric Youngdale,
and James Youngman.
.PP
This man page is maintained by Mike Phillips (msphil@facstaff.wm.edu), so
please send all corrections, comments, flames, etc., to him.
.SH BUGS
There are too many to count, much less list. Some bugs of note, however,
are that programs requiring VBRUNxxx.DLL are unreliable (with reports of
......@@ -366,18 +407,11 @@ some working), OLE is not in place, the internal COMMDLG support is not yet
at 100% (although rapidly improving). Color support for other than 8bpp
(256 colors) is currently flaky.
.PP
A partial list of applications known to work with
.B wine
include: sol, cruel, golf, clock, notepad, charmap, calc, and wzip11.
The following URLs point to different success/testing lists:
.br
.I http://www.ifi.uio.no/~dash/wine/working-apps.html
.br
.I http://dutifp.twi.tudelft.nl:8000/wine/
A status report on many appplications is available from
.I http://www.winehq.com/apps.cgi.
Users can add, modify, and delete entries on this list.
.PP
We would like to hear about what software does run under
.B Wine,
and such reports may be posted to
Bug reports and successes may be posted to
.I comp.emulators.ms-windows.wine.
.SH AVAILABILITY
The most recent public version of
......@@ -385,6 +419,20 @@ The most recent public version of
can be ftp'ed from tsx-11.mit.edu in the /pub/linux/ALPHA/Wine/development
directory. The releases are in the format 'Wine-yymmdd.tar.gz',
or 'Wine-yymmdd.diff.gz' for the diff's from the previous release.
.PP
The
.B wine
homepage is at
.I http://www.winehq.com.
This website contains a great deal of information about
.B wine
as well as a collection of unofficial patches against the current release.
.PP
The
.B wine
newsgroup is
.I comp.emulators.ms-windows.wine.
All discussions about the project take place in this forum.
.SH FILES
.PD 0
.TP
......@@ -392,14 +440,12 @@ or 'Wine-yymmdd.diff.gz' for the diff's from the previous release.
The invoker program.
.TP
.I /usr/local/etc/wine.conf
Main configuration file for wine.
.TP
.I ChangeLog
Changes in Wine, since the beginning (most recent changes first)
Global configuration file for wine.
.TP
.I configure
Shell script to automatically generate Makefiles. Usually followed by
make to compile wine.
.I /usr/local/lib/wine.sym
Global symbol table (used in debugger)
.TP
.I Wine newsgroup
Subscribe to comp.emulators.ms-windows.wine
.I ~/.winerc
User-specific configuration file
.SH "SEE ALSO"
clone(2)
......@@ -190,7 +190,7 @@ BYTE WINAPI GetTempDrive( BYTE ignored )
char buffer[2];
/* FIXME: apparently Windows does something with the ignored byte */
if (!GetTempPath32A( sizeof(buffer), buffer )) buffer[0] = 'C';
return toupper(buffer[0]) - 'A';
return toupper(buffer[0]);
}
......
......@@ -102,7 +102,7 @@ static DRIVETYPE DRIVE_GetDriveType( const char *name )
PROFILE_GetWineIniString( name, "Type", "hd", buffer, sizeof(buffer) );
for (i = 0; i < sizeof(DRIVE_Types)/sizeof(DRIVE_Types[0]); i++)
{
if (!lstrcmpi32A( buffer, DRIVE_Types[i] )) return (DRIVETYPE)i;
if (!strcasecmp( buffer, DRIVE_Types[i] )) return (DRIVETYPE)i;
}
MSG("%s: unknown type '%s', defaulting to 'hd'.\n", name, buffer );
return TYPE_HD;
......@@ -117,7 +117,7 @@ static UINT32 DRIVE_GetFSFlags( const char *name, const char *value )
const FS_DESCR *descr;
for (descr = DRIVE_Filesystems; descr->name; descr++)
if (!lstrcmpi32A( value, descr->name )) return descr->flags;
if (!strcasecmp( value, descr->name )) return descr->flags;
MSG("%s: unknown filesystem type '%s', defaulting to 'unix'.\n",
name, value );
return DRIVE_CASE_SENSITIVE | DRIVE_CASE_PRESERVING;
......
......@@ -242,7 +242,7 @@ static BOOL32 PROFILE_DeleteSection( PROFILESECTION **section, LPCSTR name )
{
while (*section)
{
if ((*section)->name && !lstrcmpi32A( (*section)->name, name ))
if ((*section)->name && !strcasecmp( (*section)->name, name ))
{
PROFILESECTION *to_del = *section;
*section = to_del->next;
......@@ -266,12 +266,12 @@ static BOOL32 PROFILE_DeleteKey( PROFILESECTION **section,
{
while (*section)
{
if ((*section)->name && !lstrcmpi32A( (*section)->name, section_name ))
if ((*section)->name && !strcasecmp( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
if (!lstrcmpi32A( (*key)->name, key_name ))
if (!strcasecmp( (*key)->name, key_name ))
{
PROFILEKEY *to_del = *key;
*key = to_del->next;
......@@ -300,12 +300,12 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section,
{
while (*section)
{
if ((*section)->name && !lstrcmpi32A( (*section)->name, section_name ))
if ((*section)->name && !strcasecmp( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
if (!lstrcmpi32A( (*key)->name, key_name )) return *key;
if (!strcasecmp( (*key)->name, key_name )) return *key;
key = &(*key)->next;
}
if (!create) return NULL;
......@@ -476,7 +476,7 @@ static INT32 PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name,
PROFILEKEY *key;
while (section)
{
if (section->name && !lstrcmpi32A( section->name, section_name ))
if (section->name && !strcasecmp( section->name, section_name ))
{
INT32 oldlen = len;
for (key = section->key; key; key = key->next)
......@@ -664,7 +664,7 @@ int PROFILE_EnumerateWineIniSection(
/* Search for the correct section */
for(scansect = WineProfile; scansect; scansect = scansect->next) {
if(scansect->name && !lstrcmpi32A(scansect->name, section)) {
if(scansect->name && !strcasecmp(scansect->name, section)) {
/* Enumerate each key with the callback */
for(scankey = scansect->key; scankey; scankey = scankey->next) {
......@@ -752,6 +752,12 @@ int PROFILE_LoadWineIni(void)
const char *p;
FILE *f;
if ( (p = getenv( "WINE_INI" )) && (f = fopen( p, "r" )) )
{
WineProfile = PROFILE_Load( f );
fclose( f );
return 1;
}
if ((p = getenv( "HOME" )) != NULL)
{
lstrcpyn32A(buffer, p, MAX_PATHNAME_LEN - sizeof(PROFILE_WineIniName));
......@@ -1077,11 +1083,67 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section,
WORD WINAPI GetPrivateProfileSectionNames16( LPSTR buffer, WORD size,
LPCSTR filename )
{
FIXME(profile, "(%p,%d,%s):stub\n", buffer, size, filename);
buffer[0] = buffer[1] = '\0';
return 0;
char *buf;
int l,cursize;
PROFILESECTION *section;
if (PROFILE_Open( filename )) {
buf=buffer;
cursize=0;
section=CurProfile.section;
for ( ; section; section = section->next) {
l=strlen (section->name);
cursize+=l+1;
if (cursize > size+1)
return size-2;
strcpy (buf,section->name);
buf+=l;
*buf=0;
buf++;
}
buf++;
*buf=0;
return (buf-buffer);
}
return FALSE;
}
/***********************************************************************
* GetPrivateProfileStruct32A (KERNEL32.370)
*/
WORD WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key,
LPVOID buf, UINT32 len, LPCSTR filename)
{
PROFILEKEY *k;
if (PROFILE_Open( filename )) {
k=PROFILE_Find ( &CurProfile.section, section, key, FALSE);
if (!k) return FALSE;
lstrcpyn32A( buf, k->value, strlen(k->value));
return TRUE;
}
return FALSE;
}
/***********************************************************************
* WritePrivateProfileStruct32A (KERNEL32.744)
*/
WORD WINAPI WritePrivateProfileStruct32A (LPCSTR section, LPCSTR key,
LPVOID buf, UINT32 bufsize, LPCSTR filename)
{
if ((!section) && (!key) && (!buf)) { /* flush the cache */
PROFILE_FlushFile();
return FALSE;
}
if (!PROFILE_Open( filename )) return FALSE;
return PROFILE_SetString( section, key, buf);
}
/***********************************************************************
* WriteOutProfiles (KERNEL.315)
*/
......
......@@ -7,6 +7,7 @@
#include "gdi.h"
#include "heap.h"
#include "debug.h"
#include <string.h>
typedef struct tagGRAPHICS_DRIVER
{
......@@ -54,7 +55,7 @@ const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name )
GRAPHICS_DRIVER *driver = firstDriver;
while (driver)
{
if (!lstrcmpi32A( driver->name, name )) return driver->funcs;
if (!strcasecmp( driver->name, name )) return driver->funcs;
driver = driver->next;
}
return genericDriver ? genericDriver->funcs : NULL;
......@@ -71,7 +72,7 @@ BOOL32 DRIVER_UnregisterDriver( LPCSTR name )
GRAPHICS_DRIVER **ppDriver = &firstDriver;
while (*ppDriver)
{
if (!lstrcmpi32A( (*ppDriver)->name, name ))
if (!strcasecmp( (*ppDriver)->name, name ))
{
GRAPHICS_DRIVER *driver = *ppDriver;
(*ppDriver) = driver->next;
......
DEFS = -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = psdrv
C_SRCS = \
afm.c \
driver.c \
escape.c \
font.c \
graphics.c \
init.c \
objects.c \
ps.c \
text.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:
Wine Postscript Driver
======================
When complete this will allow Wine to generate Postscript files without needing
an external printer driver. It should be possible to print to a non Postscript
printer by filtering the output through ghostscript.
Installation
------------
At the moment the driver will only work for 16 bit apps, the move to 32 bit
should be quite easy, I'd just like to improve it first. The driver behaves as
if it were a DRV file called WINEPS.DRV . To install it as the default printer
driver add
device=Wine Postscript Driver,WINEPS,LPT1:
to the [windows] section of win.ini . You may prefer to add
Wine Postscript Driver=WINEPS,LPT1:
to the [devices] section of win.ini instead.
You will need Adobe Font Metric (AFM) files for the (type 1 Postscript) fonts
that you wish to use. You can get these from
ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles . The directories base17 or
base35 are good places to start.
Note that these are only the font metrics and not the fonts themselves. At
present the driver does not download additional fonts, so you can only use
fonts that are already present on the printer.
Then create a [afmfiles] section in your wine.conf (or ~/.winerc) and add a
line of the form
file=/unix/path/name/filename.afm
for each AFM file that you wish to use. [This might change in the future]
Note that you need not set printer=on in the [wine] section of wine.conf, this
enables printing via external printer drivers and does not affect wineps.
If you're lucky you should now be able to produce PS files from Wine!
I've tested it with win3.1 notepad/write, Winword6 and Origin4.0 with some
degree of success - you should be able to get something out, it may not be in
the right place.
TODO / Bugs
-----------
Driver doesn't read PPD files - it should.
A4 portrait mode is hard coded in at the moment.
Graphics are basically non-existent. Only MoveTo/LineTo/Rectangle with a thin
black pen.
No colour.
AFM parsing is not finished (or ideal).
No TrueType download.
Many partial-implemented functions.
Probably many more...
Since the driver is very very alpha, things are likely to change quickly.
Please contact me if you want to help so that we can avoid duplication.
Huw Davies <h.davies1@physics.ox.ac.uk>
/*
* Adobe Font Metric (AFM) file parsing
* See http://www.adobe.com/supportservice/devrelations/PDFS/TN/5004.AFM_Spec.pdf
*
* Copyright 1998 Huw D M Davies
*
*/
#include <string.h>
#include "windows.h"
#include "winnt.h" /* HEAP_ZERO_MEMORY */
#include "psdrv.h"
#include "options.h"
#include "debug.h"
#include "heap.h"
#include <ctype.h>
/* ptr to fonts for which we have afm files */
FontFamily *PSDRV_AFMFontList = NULL;
/***********************************************************
*
* PSDRV_AFMGetCharMetrics
*
* Parses CharMetric section of AFM file.
*
* Actually only collects the widths of numbered chars and puts then in
* afm->CharWidths.
*/
static void PSDRV_AFMGetCharMetrics(AFM *afm, FILE *fp)
{
char buf[256];
char *cp, *item, *value;
int i, charno;
for(i = 0; i < afm->NumofMetrics; i++) {
if(!fgets(buf, sizeof(buf), fp)) {
ERR(psdrv, "Unexpected EOF\n");
return;
}
cp = buf + strlen(buf);
do {
*cp = '\0';
cp--;
} while(cp > buf && isspace(*cp));
item = strtok(buf, ";");
if(!strncmp(item, "C ", 2)) {
value = strchr(item, ' ');
sscanf(value, " %d", &charno);
} else if(!strncmp(item, "CH ", 3)) {
value = strrchr(item, ' ');
sscanf(value, " %x", &charno);
} else {
WARN(psdrv, "Don't understand '%s'\n", item);
return;
}
while((item = strtok(NULL, ";"))) {
while(isspace(*item))
item++;
value = strchr(item, ' ');
if(!value) /* last char maybe a ';' but no white space after it */
break;
value++;
if(!strncmp("WX ", item, 3) || !strncmp("W0X ", item, 4)) {
if(charno >= 0 && charno <= 0xff)
sscanf(value, "%f", &(afm->CharWidths[charno]));
}
/* would carry on here to scan in BBox, name and ligs */
}
}
return;
}
/***********************************************************
*
* PSDRV_AFMParse
*
* Fills out an AFM structure and associated substructures (see psdrv.h)
* for a given AFM file. All memory is allocated from the process heap.
* Returns a ptr to the AFM structure or NULL on error.
*
* This is not complete (we don't handle kerning yet) and not efficient
*/
static AFM *PSDRV_AFMParse(char const *file)
{
FILE *fp;
char buf[256];
char *value;
AFM *afm;
char *cp;
if((fp = fopen(file, "r")) == NULL) {
MSG("Can't open AFM file '%s'. Please check wine.conf .\n", file);
return NULL;
}
afm = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AFM));
if(!afm) {
fclose(fp);
return NULL;
}
while(fgets(buf, sizeof(buf), fp)) {
cp = buf + strlen(buf);
do {
*cp = '\0';
cp--;
} while(cp > buf && isspace(*cp));
value = strchr(buf, ' ');
if(value)
value++;
if(!strncmp("FontName", buf, 8)) {
afm->FontName = HEAP_strdupA(GetProcessHeap(), 0, value);
continue;
}
if(!strncmp("FullName", buf, 8)) {
afm->FullName = HEAP_strdupA(GetProcessHeap(), 0, value);
continue;
}
if(!strncmp("FamilyName", buf, 10)) {
afm->FamilyName = HEAP_strdupA(GetProcessHeap(), 0, value);
continue;
}
if(!strncmp("Weight", buf, 6)) {
if(!strncmp("Roman", value, 5) || !strncmp("Medium", value, 6)
|| !strncmp("Book", value, 4))
afm->Weight = FW_NORMAL;
else if(!strncmp("Demi", value, 4))
afm->Weight = FW_DEMIBOLD;
else if(!strncmp("Bold", value, 4))
afm->Weight = FW_BOLD;
else if(!strncmp("Light", value, 5))
afm->Weight = FW_LIGHT;
else {
FIXME(psdrv, "Unkown AFM Weight '%s'\n", value);
afm->Weight = FW_NORMAL;
}
continue;
}
if(!strncmp("ItalicAngle", buf, 11)) {
sscanf(value, "%f", &(afm->ItalicAngle));
continue;
}
if(!strncmp("IsFixedPitch", buf, 12)) {
if(!strncasecmp("false", value, 5))
afm->IsFixedPitch = FALSE;
else
afm->IsFixedPitch = TRUE;
continue;
}
if(!strncmp("FontBBox", buf, 8)) {
sscanf(value, "%f %f %f %f", &(afm->FontBBox.llx),
&(afm->FontBBox.lly), &(afm->FontBBox.urx),
&(afm->FontBBox.ury) );
continue;
}
if(!strncmp("UnderlinePosition", buf, 17)) {
sscanf(value, "%f", &(afm->UnderlinePosition) );
continue;
}
if(!strncmp("UnderlineThickness", buf, 18)) {
sscanf(value, "%f", &(afm->UnderlineThickness) );
continue;
}
if(!strncmp("CapHeight", buf, 9)) {
sscanf(value, "%f", &(afm->CapHeight) );
continue;
}
if(!strncmp("XHeight", buf, 7)) {
sscanf(value, "%f", &(afm->XHeight) );
continue;
}
if(!strncmp("Ascender", buf, 8)) {
sscanf(value, "%f", &(afm->Ascender) );
continue;
}
if(!strncmp("Descender", buf, 9)) {
sscanf(value, "%f", &(afm->Descender) );
continue;
}
if(!strncmp("StartCharMetrics", buf, 16)) {
sscanf(value, "%d", &(afm->NumofMetrics) );
PSDRV_AFMGetCharMetrics(afm, fp);
continue;
}
}
fclose(fp);
if(afm->Ascender == 0.0) afm->Ascender = 1000.0;
return afm;
}
/***********************************************************
*
* PSDRV_AddAFMtoList
*
* Adds an afm to the current font list. Creates new family node if necessary.
*/
static void PSDRV_AddAFMtoList(AFM *afm)
{
FontFamily *family = PSDRV_AFMFontList;
FontFamily **insert = &PSDRV_AFMFontList;
AFM *tmpafm;
while(family) {
if(!strcmp(family->FamilyName, afm->FamilyName))
break;
insert = &(family->next);
family = family->next;
}
if(!family) {
family = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(*family));
*insert = family;
family->FamilyName = HEAP_strdupA(GetProcessHeap(), 0,
afm->FamilyName);
family->afm = afm;
return;
}
tmpafm = family->afm;
while(tmpafm->next)
tmpafm = tmpafm->next;
tmpafm->next = afm;
return;
}
/***********************************************************
*
* PSDRV_afmfilesCallback
*
* Callback for PROFILE_EnumerateWineIniSection
*/
static void PSDRV_afmfilesCallback(char const *key, char const *value,
void *user)
{
AFM *afm;
afm = PSDRV_AFMParse(value);
if(afm)
PSDRV_AddAFMtoList(afm);
return;
}
/***********************************************************
*
* PSDRV_DumpFontList
*
*/
static void PSDRV_DumpFontList(void)
{
FontFamily *family;
AFM *afm;
for(family = PSDRV_AFMFontList; family; family = family->next) {
TRACE(psdrv, "Family '%s'\n", family->FamilyName);
for(afm = family->afm; afm; afm = afm->next) {
TRACE(psdrv, "\tFontName '%s'\n", afm->FontName);
}
}
return;
}
/***********************************************************
*
* PSDRV_GetFontMetrics
*
* Only exported function in this file. Parses all afm files listed in
* [afmfiles] of wine.conf .
*/
BOOL32 PSDRV_GetFontMetrics(void)
{
PROFILE_EnumerateWineIniSection( "afmfiles", PSDRV_afmfilesCallback, NULL);
PSDRV_DumpFontList();
return TRUE;
}
/*
* Exported functions from the Postscript driver.
*
* [Ext]DeviceMode, DeviceCapabilities.
*
* Will need ExtTextOut for winword6 (urgh!)
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
static DEVMODE16 DefaultDevMode =
{
/* dmDeviceName */ "Wine Postscript Driver",
/* dmSpecVersion */ 0x30a,
/* dmDriverVersion */ 0x001,
/* dmSize */ sizeof(DEVMODE16),
/* dmDriverExtra */ 0,
/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_PAPERLENGTH |
DM_PAPERWIDTH,
/* dmOrientation */ DMORIENT_PORTRAIT,
/* dmPaperSize */ DMPAPER_A4,
/* dmPaperLength */ 2930,
/* dmPaperWidth */ 2000,
/* dmScale */ 0,
/* dmCopies */ 0,
/* dmDefaultSource */ 0,
/* dmPrintQuality */ 0,
/* dmColor */ 0,
/* dmDuplex */ 0,
/* dmYResolution */ 0,
/* dmTTOption */ 0,
/* dmCollate */ 0,
/* dmFormName */ "",
/* dmUnusedPadding */ 0,
/* dmBitsPerPel */ 0,
/* dmPelsWidth */ 0,
/* dmPelsHeight */ 0,
/* dmDisplayFlags */ 0,
/* dmDisplayFrequency */ 0
};
static char PaperNames[][64] = {"My A4"};
static WORD Papers[] = {DMPAPER_A4};
static POINT16 PaperSizes[] = {{2110, 2975}};
static char BinNames[][24] = {"My Bin"};
static WORD Bins[] = {DMBIN_AUTO};
static LONG Resolutions[][2] = { {600,600} };
/***************************************************************
*
* PSDRV_ExtDeviceMode16 [WINEPS.90]
*
* Just returns default devmode at the moment
*/
INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODE16 lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
LPDEVMODE16 lpdmInput, LPSTR lpszProfile, WORD fwMode)
{
TRACE(psdrv,
"(hwnd=%04x, hDriver=%04x, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04x)\n",
hwnd, hDriver, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile,
fwMode);
if(!fwMode)
return sizeof(DefaultDevMode);
if(fwMode & DM_COPY)
memcpy(lpdmOutput, &DefaultDevMode, sizeof(DefaultDevMode));
return IDOK;
}
/***************************************************************
*
* PSDRV_DeviceCapabilities16 [WINEPS.91]
*
*/
DWORD WINAPI PSDRV_DeviceCapabilities16(LPSTR lpszDevice, LPSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput, LPDEVMODE16 lpdm)
{
TRACE(psdrv, "Cap=%d\n", fwCapability);
switch(fwCapability) {
case DC_PAPERS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Papers, sizeof(Papers));
return sizeof(Papers) / sizeof(WORD);
case DC_PAPERSIZE:
if(lpszOutput != NULL)
memcpy(lpszOutput, PaperSizes, sizeof(PaperSizes));
return sizeof(PaperSizes) / sizeof(POINT16);
case DC_BINS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Bins, sizeof(Bins));
return sizeof(Bins) / sizeof(WORD);
case DC_BINNAMES:
if(lpszOutput != NULL)
memcpy(lpszOutput, BinNames, sizeof(BinNames));
return sizeof(BinNames) / sizeof(BinNames[0]);
case DC_PAPERNAMES:
if(lpszOutput != NULL)
memcpy(lpszOutput, PaperNames, sizeof(PaperNames));
return sizeof(PaperNames) / sizeof(PaperNames[0]);
case DC_ORIENTATION:
return 90;
case DC_ENUMRESOLUTIONS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Resolutions, sizeof(Resolutions));
return sizeof(Resolutions) / sizeof(Resolutions[0]);
default:
FIXME(psdrv, "Unsupported capability %d\n", fwCapability);
}
return -1;
}
/***************************************************************
*
* PSDRV_DeviceMode16 [WINEPS.13]
*
*/
void WINAPI PSDRV_DeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPSTR lpszDevice, LPSTR lpszPort)
{
PSDRV_ExtDeviceMode16( hwnd, hDriver, NULL, lpszDevice, lpszPort, NULL,
NULL, DM_PROMPT );
return;
}
/*
* Postscript driver Escape function
*
* Copyright 1998 Huw D M Davies
*/
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
#include "print.h"
INT32 PSDRV_Escape( DC *dc, INT32 nEscape, INT32 cbInput,
SEGPTR lpInData, SEGPTR lpOutData )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
switch(nEscape) {
case NEXTBAND: {
RECT16 *r = (RECT16 *)PTR_SEG_TO_LIN(lpOutData);
if(!physDev->job.banding) {
physDev->job.banding = TRUE;
SetRect16( r, 0, 0, dc->w.devCaps->horzRes,
dc->w.devCaps->vertRes );
TRACE(psdrv, "NEXTBAND returning %d,%d - %d,%d\n", r->left,
r->top, r->right, r->bottom );
return 1;
}
SetRect16( r, 0, 0, 0, 0 );
TRACE(psdrv, "NEXTBAND rect to 0,0 - 0,0\n" );
physDev->job.banding = FALSE;
} /* Fall through */
case NEWFRAME:
TRACE(psdrv, "NEWFRAME\n");
if(!physDev->job.hJob) {
FIXME(psdrv, "hJob == 0. Now what?\n");
return 0;
}
if(!PSDRV_WriteEndPage( dc ))
return 0;
physDev->job.NeedPageHeader = TRUE;
return 1;
case STARTDOC:
TRACE(psdrv, "STARTDOC\n");
if(physDev->job.hJob) {
FIXME(psdrv, "hJob != 0. Now what?\n");
return 0;
}
physDev->job.hJob = OpenJob(physDev->job.output,
PTR_SEG_TO_LIN(lpInData), dc->hSelf);
if(!physDev->job.hJob) {
WARN(psdrv, "OpenJob failed\n");
return 0;
}
physDev->job.banding = FALSE;
physDev->job.NeedPageHeader = FALSE;
physDev->job.PageNo = 1;
if(!PSDRV_WriteHeader( dc, PTR_SEG_TO_LIN(lpInData), cbInput ))
return 0;
if(!PSDRV_WriteNewPage( dc ))
return 0;
return 1;
case QUERYESCSUPPORT:
if(cbInput != 2) {
WARN(psdrv, "cbInput != 2 (=%d) for QUERYESCSUPPORT\n", cbInput);
return 0;
} else {
UINT16 num = *(UINT16 *)PTR_SEG_TO_LIN(lpInData);
TRACE(psdrv, "QUERYESCSUPPORT for %d\n", num);
return 0;
}
case SETABORTPROC:
FIXME(psdrv, "SETABORTPROC: ignoring\n");
return 1;
case GETPHYSPAGESIZE:
{
POINT16 *p = (POINT16 *)PTR_SEG_TO_LIN(lpOutData);
p->x = dc->w.devCaps->horzRes;
p->y = dc->w.devCaps->vertRes;
TRACE(psdrv, "GETPHYSPAGESIZE: returning %dx%d\n", p->x, p->y);
return 1;
}
case GETPRINTINGOFFSET:
{
POINT16 *p = (POINT16 *)PTR_SEG_TO_LIN(lpOutData);
p->x = p->y = 0;
TRACE(psdrv, "GETPRINTINGOFFSET: returning %dx%d\n", p->x, p->y);
return 1;
}
case GETSCALINGFACTOR:
{
POINT16 *p = (POINT16 *)PTR_SEG_TO_LIN(lpOutData);
p->x = p->y = 0;
TRACE(psdrv, "GETSCALINGFACTOR: returning %dx%d\n", p->x, p->y);
return 1;
}
case ENDDOC:
TRACE(psdrv, "ENDDOC\n");
if(!physDev->job.hJob) {
FIXME(psdrv, "hJob == 0. Now what?\n");
return 0;
}
physDev->job.NeedPageHeader = FALSE;
if(!PSDRV_WriteFooter( dc ))
return 0;
if( CloseJob( physDev->job.hJob ) == SP_ERROR ) {
WARN(psdrv, "CloseJob error\n");
return 0;
}
physDev->job.hJob = 0;
return 1;
default:
FIXME(psdrv, "Unimplemented code 0x%x\n", nEscape);
return 0;
}
}
/*
* Postscript driver font functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include <string.h>
#include "windows.h"
#include "print.h"
#include "psdrv.h"
#include "debug.h"
/***********************************************************************
* PSDRV_FONT_SelectObject
*/
HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
FONTOBJ *font )
{
HFONT16 prevfont = dc->w.hFont;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
LOGFONT16 *lf = &(font->logfont);
BOOL32 bd = FALSE, it = FALSE;
AFM *afm;
FontFamily *family;
char FaceName[LF_FACESIZE];
TRACE(psdrv, "FaceName = '%s' Height = %d Italic = %d Weight = %d\n",
lf->lfFaceName, lf->lfHeight, lf->lfItalic, lf->lfWeight);
dc->w.hFont = hfont;
if(lf->lfItalic)
it = TRUE;
if(lf->lfWeight > 550)
bd = TRUE;
lstrcpy32A(FaceName, lf->lfFaceName);
if(FaceName[0] == '\0') {
switch(lf->lfPitchAndFamily & 0xf0) {
case FF_DONTCARE:
break;
case FF_ROMAN:
case FF_SCRIPT:
lstrcpy32A(FaceName, "Times");
break;
case FF_SWISS:
lstrcpy32A(FaceName, "Helvetica");
break;
case FF_MODERN:
lstrcpy32A(FaceName, "Courier");
break;
case FF_DECORATIVE:
lstrcpy32A(FaceName, "Symbol");
break;
}
}
if(FaceName[0] == '\0') {
switch(lf->lfPitchAndFamily & 0x0f) {
case VARIABLE_PITCH:
lstrcpy32A(FaceName, "Times");
break;
default:
lstrcpy32A(FaceName, "Courier");
break;
}
}
for(family = PSDRV_AFMFontList; family; family = family->next) {
if(!lstrncmp32A(FaceName, family->FamilyName,
strlen(family->FamilyName)))
break;
}
if(!family)
family = PSDRV_AFMFontList;
for(afm = family->afm; afm; afm = afm->next) {
if( (bd == (afm->Weight == FW_BOLD)) &&
(it == (afm->ItalicAngle != 0.0)) )
break;
}
if(!afm)
afm = family->afm; /* not ideal */
physDev->font.afm = afm;
physDev->font.size = YLSTODS(dc, lf->lfHeight);
if(physDev->font.size < 0) {
TRACE(psdrv, "physDev->font.size < 0\n");
physDev->font.size = abs(physDev->font.size);
TRACE(psdrv, "physDev->font.size now %d\n", physDev->font.size);
}
physDev->font.scale = physDev->font.size /
(afm->Ascender - afm->Descender);
physDev->font.escapement = lf->lfEscapement;
physDev->font.tm.tmHeight = physDev->font.size;
physDev->font.tm.tmAscent = afm->Ascender * physDev->font.scale;
physDev->font.tm.tmDescent = -afm->Descender * physDev->font.scale;
physDev->font.tm.tmInternalLeading = physDev->font.tm.tmHeight * 0.2;
physDev->font.tm.tmExternalLeading = physDev->font.tm.tmHeight * 0.2;
physDev->font.tm.tmAveCharWidth = afm->CharWidths[120] * /* x */
physDev->font.scale;
physDev->font.tm.tmMaxCharWidth = afm->CharWidths[77] * /* M */
physDev->font.scale;
physDev->font.tm.tmWeight = afm->Weight;
physDev->font.tm.tmItalic = afm->ItalicAngle != 0.0;
physDev->font.tm.tmUnderlined = lf->lfUnderline;
physDev->font.tm.tmStruckOut = lf->lfStrikeOut;
physDev->font.tm.tmFirstChar = 32;
physDev->font.tm.tmLastChar = 251;
physDev->font.tm.tmDefaultChar = 128;
physDev->font.tm.tmBreakChar = 32;
physDev->font.tm.tmPitchAndFamily = afm->IsFixedPitch ? 0 :
TMPF_FIXED_PITCH;
physDev->font.tm.tmPitchAndFamily |= TMPF_DEVICE;
physDev->font.tm.tmCharSet = ANSI_CHARSET;
physDev->font.tm.tmOverhang = 0;
physDev->font.tm.tmDigitizedAspectX = dc->w.devCaps->logPixelsY;
physDev->font.tm.tmDigitizedAspectY = dc->w.devCaps->logPixelsX;
physDev->font.set = FALSE;
TRACE(psdrv, "Selected PS font '%s' size %d weight %d\n",
physDev->font.afm->FontName, physDev->font.size,
physDev->font.tm.tmWeight );
return prevfont;
}
/***********************************************************************
* PSDRV_GetTextMetrics
*/
BOOL32 PSDRV_GetTextMetrics(DC *dc, TEXTMETRIC32A *metrics)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
memcpy(metrics, &(physDev->font.tm), sizeof(physDev->font.tm));
return TRUE;
}
/***********************************************************************
* PSDRV_GetTextExtentPoint
*/
BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
LPSIZE32 size )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
INT32 i;
float width;
size->cy = YDSTOLS(dc, physDev->font.tm.tmHeight);
width = 0.0;
for(i = 0; i < count && str[i]; i++)
width += physDev->font.afm->CharWidths[ (UINT32)str[i] ];
width *= physDev->font.scale;
size->cx = XDSTOLS(dc, width);
return TRUE;
}
/***********************************************************************
* PSDRV_SetFont
*/
BOOL32 PSDRV_SetFont( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
if(physDev->font.set) return TRUE;
PSDRV_WriteReencodeFont(dc);
PSDRV_WriteSetFont(dc);
physDev->font.set = TRUE;
return TRUE;
}
/***********************************************************************
* PSDRV_GetFontMetric
*/
static UINT32 PSDRV_GetFontMetric(DC *dc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
ENUMLOGFONTEX16 *pLF, INT16 size)
{
memset( pLF, 0, sizeof(*pLF) );
memset( pTM, 0, sizeof(*pTM) );
#define plf ((LPLOGFONT16)pLF)
plf->lfHeight = pTM->tmHeight = size;
plf->lfWidth = pTM->tmAveCharWidth = size * 0.7;
plf->lfWeight = pTM->tmWeight = pafm->Weight;
plf->lfItalic = pTM->tmItalic = pafm->ItalicAngle != 0.0;
plf->lfUnderline = pTM->tmUnderlined = 0;
plf->lfStrikeOut = pTM->tmStruckOut = 0;
plf->lfCharSet = pTM->tmCharSet = ANSI_CHARSET;
/* convert pitch values */
pTM->tmPitchAndFamily = pafm->IsFixedPitch ? 0 : TMPF_FIXED_PITCH;
pTM->tmPitchAndFamily |= TMPF_DEVICE;
plf->lfPitchAndFamily = 0;
lstrcpyn32A( plf->lfFaceName, pafm->FamilyName, LF_FACESIZE );
#undef plf
pTM->tmAscent = pTM->tmHeight * 0.2;
pTM->tmDescent = pTM->tmHeight - pTM->tmAscent;
pTM->tmInternalLeading = pTM->tmHeight * 0.2;
pTM->tmMaxCharWidth = pTM->tmHeight * 0.7;
pTM->tmDigitizedAspectX = dc->w.devCaps->logPixelsY;
pTM->tmDigitizedAspectY = dc->w.devCaps->logPixelsX;
*(INT32*)&pTM->tmFirstChar = 32;
/* return font type */
return DEVICE_FONTTYPE;
}
/***********************************************************************
* PSDRV_EnumDeviceFonts
*/
BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
{
ENUMLOGFONTEX16 lf;
NEWTEXTMETRIC16 tm;
BOOL32 b, bRet = 0;
AFM *afm;
FontFamily *family;
if( plf->lfFaceName[0] ) {
TRACE(psdrv, "lfFaceName = '%s'\n", plf->lfFaceName);
for(family = PSDRV_AFMFontList; family; family = family->next) {
if(!lstrncmp32A(plf->lfFaceName, family->FamilyName,
strlen(family->FamilyName)))
break;
}
if(family) {
for(afm = family->afm; afm; afm = afm->next) {
TRACE(psdrv, "Got '%s'\n", afm->FontName);
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm,
PSDRV_GetFontMetric( dc, afm, &tm, &lf, 200 ), lp )) )
bRet = b;
else break;
}
}
} else {
TRACE(psdrv, "lfFaceName = NULL\n");
for(family = PSDRV_AFMFontList; family; family = family->next) {
afm = family->afm;
TRACE(psdrv, "Got '%s'\n", afm->FontName);
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm,
PSDRV_GetFontMetric( dc, afm, &tm, &lf, 200 ), lp )) )
bRet = b;
else break;
}
}
return bRet;
}
/*
* Postscript driver graphics functions
*
* Copyright 1998 Huw D M Davies
*
* Not much here yet...
*/
#include <string.h>
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
#include "print.h"
/**********************************************************************
* PSDRV_MoveToEx
*/
BOOL32 PSDRV_MoveToEx(DC *dc, INT32 x, INT32 y, LPPOINT32 pt)
{
TRACE(psdrv, "%d %d\n", x, y);
if (pt)
{
pt->x = dc->w.CursPosX;
pt->y = dc->w.CursPosY;
}
dc->w.CursPosX = x;
dc->w.CursPosY = y;
return PSDRV_WriteMoveTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
}
/***********************************************************************
* PSDRV_LineTo
*/
BOOL32 PSDRV_LineTo(DC *dc, INT32 x, INT32 y)
{
TRACE(psdrv, "%d %d\n", x, y);
PSDRV_WriteLineTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
PSDRV_WriteStroke(dc);
dc->w.CursPosX = x;
dc->w.CursPosY = y;
return TRUE;
}
/***********************************************************************
* PSDRV_Rectangle
*/
BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,
INT32 bottom)
{
INT32 width = XLSTODS(dc, right - left);
INT32 height = YLSTODS(dc, bottom - top);
TRACE(psdrv, "%d %d - %d %d\n", left, top, right, bottom);
PSDRV_WriteRectangle(dc, XLPTODP(dc, left), YLPTODP(dc, top),
width, height);
PSDRV_WriteStroke(dc);
return TRUE;
}
/***********************************************************************
* PSDRV_Ellipse
*/
BOOL32 PSDRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom )
{
TRACE(psdrv, "%d %d - %d %d\n", left, top, right, bottom);
return TRUE;
}
/*
* Postscript driver initialization functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "gdi.h"
#include "psdrv.h"
#include "debug.h"
#include "heap.h"
static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
static BOOL32 PSDRV_DeleteDC( DC *dc );
static const DC_FUNCTIONS PSDRV_Funcs =
{
NULL, /* pArc */
NULL, /* pBitBlt */
NULL, /* pChord */
PSDRV_CreateDC, /* pCreateDC */
PSDRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
PSDRV_Ellipse, /* pEllipse */
PSDRV_EnumDeviceFonts, /* pEnumDeviceFonts */
PSDRV_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExcludeVisRect */
NULL, /* pExtFloodFill */
PSDRV_ExtTextOut, /* pExtTextOut */
NULL, /* pGetCharWidth */
NULL, /* pGetPixel */
PSDRV_GetTextExtentPoint, /* pGetTextExtentPoint */
PSDRV_GetTextMetrics, /* pGetTextMetrics */
NULL, /* pIntersectClipRect */
NULL, /* pIntersectVisRect */
PSDRV_LineTo, /* pLineTo */
PSDRV_MoveToEx, /* pMoveToEx */
NULL, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrg (optional) */
NULL, /* pOffsetWindowOrg (optional) */
NULL, /* pPaintRgn */
NULL, /* pPatBlt */
NULL, /* pPie */
NULL, /* pPolyPolygon */
NULL, /* pPolyPolyline */
NULL, /* pPolygon */
NULL, /* pPolyline */
NULL, /* pRealizePalette */
PSDRV_Rectangle, /* pRectangle */
NULL, /* pRestoreDC */
NULL, /* pRoundRect */
NULL, /* pSaveDC */
NULL, /* pScaleViewportExt (optional) */
NULL, /* pScaleWindowExt (optional) */
NULL, /* pSelectClipRgn */
PSDRV_SelectObject, /* pSelectObject */
NULL, /* pSelectPalette */
NULL, /* pSetBkColor */
NULL, /* pSetBkMode */
NULL, /* pSetDeviceClipping */
NULL, /* pSetDIBitsToDevice */
NULL, /* pSetMapMode (optional) */
NULL, /* pSetMapperFlags */
NULL, /* pSetPixel */
NULL, /* pSetPolyFillMode */
NULL, /* pSetROP2 */
NULL, /* pSetRelAbs */
NULL, /* pSetStretchBltMode */
NULL, /* pSetTextAlign */
NULL, /* pSetTextCharacterExtra */
NULL, /* pSetTextColor */
NULL, /* pSetTextJustification */
NULL, /* pSetViewportExt (optional) */
NULL, /* pSetViewportOrg (optional) */
NULL, /* pSetWindowExt (optional) */
NULL, /* pSetWindowOrg (optional) */
NULL, /* pStretchBlt */
NULL /* pStretchDIBits */
};
/* Default entries for devcaps */
static DeviceCaps PSDRV_DevCaps = {
/* version */ 0,
/* technology */ DT_RASPRINTER,
/* horzSize */ 200,
/* vertSize */ 288,
/* horzRes */ 4733,
/* vertRes */ 6808,
/* bitsPixel */ 1,
/* planes */ 1,
/* numBrushes */ -1,
/* numPens */ 10,
/* numMarkers */ 0,
/* numFonts */ 39,
/* numColors */ 2,
/* pdeviceSize */ 0,
/* curveCaps */ CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES |
CC_WIDE | CC_STYLED | CC_WIDESTYLED | CC_INTERIORS |
CC_ROUNDRECT,
/* lineCaps */ LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
LC_STYLED | LC_WIDESTYLED | LC_INTERIORS,
/* polygoalnCaps */ PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON |
PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED |
PC_INTERIORS,
/* textCaps */ 0, /* psdrv 0x59f7 */
/* clipCaps */ CP_RECTANGLE,
/* rasterCaps */ RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 |
RC_DI_BITMAP | RC_DIBTODEV | RC_BIGFONT |
RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS,
/* psdrv 0x6e99 */
/* aspectX */ 600,
/* aspectY */ 600,
/* aspectXY */ 848,
/* pad1 */ { 0 },
/* logPixelsX */ 600,
/* logPixelsY */ 600,
/* pad2 */ { 0 },
/* palette size */ 0,
/* ..etc */ 0, 0 };
/*********************************************************************
* PSDRV_Init
*
* Initializes font metrics and registers driver. Called from GDI_Init()
*
*/
BOOL32 PSDRV_Init(void)
{
TRACE(psdrv, "\n");
PSDRV_GetFontMetrics();
return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs );
}
/**********************************************************************
* PSDRV_CreateDC
*/
static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData )
{
PSDRV_PDEVICE *physDev;
TRACE(psdrv, "(%s %s %s %p)\n", driver, device, output, initData);
if(!PSDRV_AFMFontList) {
MSG("To use WINEPS you need to install some AFM files.\n");
return FALSE;
}
dc->w.devCaps = &PSDRV_DevCaps;
dc->w.hVisRgn = CreateRectRgn32(0, 0, dc->w.devCaps->horzRes,
dc->w.devCaps->vertRes);
physDev = (PSDRV_PDEVICE *)HeapAlloc( GetProcessHeap(), 0,
sizeof(*physDev) );
if (!physDev) return FALSE;
dc->physDev = physDev;
physDev->job.output = HEAP_strdupA( GetProcessHeap(), 0, output );
if (!physDev->job.output) return FALSE;
physDev->job.hJob = 0;
return TRUE;
}
/**********************************************************************
* PSDRV_DeleteDC
*/
static BOOL32 PSDRV_DeleteDC( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
TRACE(psdrv, "\n");
HeapFree( GetProcessHeap(), 0, physDev->job.output );
HeapFree( GetProcessHeap(), 0, physDev );
dc->physDev = NULL;
return TRUE;
}
/*
* Postscript driver object handling
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "psdrv.h"
#include "font.h"
#include "pen.h"
#include "brush.h"
#include "bitmap.h"
#include "debug.h"
/***********************************************************************
* PSDRV_BITMAP_SelectObject
*/
static HBITMAP16 PSDRV_BITMAP_SelectObject( DC * dc, HBITMAP16 hbitmap,
BITMAPOBJ * bmp )
{
FIXME(psdrv, "stub\n");
return 0;
}
/***********************************************************************
* PSDRV_BRUSH_SelectObject
*/
static HBRUSH32 PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
BRUSHOBJ * brush )
{
FIXME(psdrv, "stub\n");
return 0;
}
/***********************************************************************
* PSDRV_PEN_SelectObject
*/
static HPEN32 PSDRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
{
FIXME(psdrv, "stub\n");
return 0;
}
/***********************************************************************
* PSDRV_SelectObject
*/
HGDIOBJ32 PSDRV_SelectObject( DC *dc, HGDIOBJ32 handle )
{
GDIOBJHDR * ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
HGDIOBJ32 ret = 0;
if (!ptr) return 0;
TRACE(psdrv, "hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic)
{
case PEN_MAGIC:
ret = PSDRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
break;
case BRUSH_MAGIC:
ret = PSDRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
break;
case BITMAP_MAGIC:
ret = PSDRV_BITMAP_SelectObject( dc, handle, (BITMAPOBJ *)ptr );
break;
case FONT_MAGIC:
ret = PSDRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
break;
case REGION_MAGIC:
ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
break;
default:
ERR(psdrv, "Unknown object magic %04x\n", ptr->wMagic);
break;
}
GDI_HEAP_UNLOCK( handle );
return ret;
}
/*
* Postscript output functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "psdrv.h"
#include "print.h"
#include "debug.h"
char psheader[] = /* title */
"%%!PS-Adobe-3.0 (not quite)\n"
"%%%%Creator: Wine Postscript Driver\n"
"%%%%Title: %s\n"
"%%%%BoundingBox: 0 0 595 842\n"
"%%%%Pages: (atend)\n"
"%%%%EndComments\n"
"%%%%BeginProlog\n"
"/reencodefont {\n"
"findfont\n"
"dup length dict begin\n"
"{1 index /FID ne {def} {pop pop} ifelse} forall\n"
"/Encoding ISOLatin1Encoding def\n"
"currentdict\n"
"end\n"
"definefont pop\n"
"} bind def\n"
"%%%%EndProlog\n"
"%%%%BeginSetup\n"
"%%%%EndSetup\n";
char psnewpage[] = /* name, number */
"%%%%Page: %s %d\n"
"%%%%BeginPageSetup\n"
"/pgsave save def\n"
"72 600 div dup scale\n"
"0 7014 translate\n"
"1 -1 scale\n"
"%%%%EndPageSetup\n";
char psendpage[] =
"pgsave restore\n"
"showpage\n";
char psfooter[] = /* pages */
"%%%%Trailer\n"
"%%%%Pages: %d\n"
"%%%%EOF\n";
char psmoveto[] = /* x, y */
"%d %d moveto\n";
char pslineto[] = /* x, y */
"%d %d lineto\n";
char psrlineto[] = /* dx, dy */
"%d %d rlineto\n";
char psstroke[] =
"stroke\n";
char psrectangle[] = /* x, y, width, height, -width */
"%d %d moveto\n"
"%d 0 rlineto\n"
"0 %d rlineto\n"
"%d 0 rlineto\n"
"closepath\n";
char psshow[] = /* string */
"(%s) show\n";
char pssetfont[] = /* fontname, xscale, yscale, ascent, escapement */
"/%s findfont\n"
"[%d 0 0 %d 0 %d]\n"
"%d 10 div matrix rotate\n"
"matrix concatmatrix\n"
"makefont setfont\n";
char psreencodefont[] = /* newfontname basefontname*/
"/%s /%s reencodefont\n";
int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
if(physDev->job.NeedPageHeader) {
physDev->job.PageNo++;
if( !PSDRV_WriteNewPage(dc) )
return FALSE;
physDev->job.NeedPageHeader = FALSE;
}
return WriteSpool( physDev->job.hJob, lpData, cch );
}
INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *titlebuf;
titlebuf = (char *)HeapAlloc( GetProcessHeap(), 0, len+1 );
if(!titlebuf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
}
memcpy(titlebuf, title, len);
titlebuf[len] = '\0';
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psheader) + len);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree( GetProcessHeap(), 0, titlebuf );
return 0;
}
wsprintf32A(buf, psheader, title);
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, titlebuf );
HeapFree( GetProcessHeap(), 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, titlebuf );
HeapFree( GetProcessHeap(), 0, buf );
return 1;
}
INT32 PSDRV_WriteFooter( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psfooter) + 100 );
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
}
wsprintf32A(buf, psfooter, physDev->job.PageNo);
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, buf );
return 1;
}
INT32 PSDRV_WriteEndPage( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
if( WriteSpool( physDev->job.hJob, psendpage, sizeof(psendpage)-1 ) !=
sizeof(psendpage)-1 ) {
WARN(psdrv, "WriteSpool error\n");
return 0;
}
return 1;
}
INT32 PSDRV_WriteNewPage( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf;
char name[100];
wsprintf32A(name, "%d", physDev->job.PageNo);
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psnewpage) + 100 );
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
}
wsprintf32A(buf, psnewpage, name, physDev->job.PageNo);
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, buf );
return 1;
}
BOOL32 PSDRV_WriteMoveTo(DC *dc, INT32 x, INT32 y)
{
char buf[100];
wsprintf32A(buf, psmoveto, x, y);
return PSDRV_WriteSpool(dc, buf, strlen(buf));
}
BOOL32 PSDRV_WriteLineTo(DC *dc, INT32 x, INT32 y)
{
char buf[100];
wsprintf32A(buf, pslineto, x, y);
return PSDRV_WriteSpool(dc, buf, strlen(buf));
}
BOOL32 PSDRV_WriteStroke(DC *dc)
{
return PSDRV_WriteSpool(dc, psstroke, sizeof(psstroke)-1);
}
BOOL32 PSDRV_WriteRectangle(DC *dc, INT32 x, INT32 y, INT32 width,
INT32 height)
{
char buf[100];
wsprintf32A(buf, psrectangle, x, y, width, height, -width);
return PSDRV_WriteSpool(dc, buf, strlen(buf));
}
static char encodingext[] = "-ISOLatin1";
BOOL32 PSDRV_WriteSetFont(DC *dc)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *newbuf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0,
sizeof(pssetfont) + strlen(physDev->font.afm->FontName) + 40);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
newbuf = (char *)HeapAlloc( GetProcessHeap(), 0,
strlen(physDev->font.afm->FontName) + sizeof(encodingext));
if(!newbuf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree(GetProcessHeap(), 0, buf);
return FALSE;
}
wsprintf32A(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
wsprintf32A(buf, pssetfont, newbuf,
physDev->font.tm.tmHeight, -physDev->font.tm.tmHeight,
physDev->font.tm.tmAscent, -physDev->font.escapement);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf);
return TRUE;
}
BOOL32 PSDRV_WriteReencodeFont(DC *dc)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *newbuf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0,
sizeof(psreencodefont) + 2 * strlen(physDev->font.afm->FontName)
+ sizeof(encodingext));
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
newbuf = (char *)HeapAlloc( GetProcessHeap(), 0,
strlen(physDev->font.afm->FontName) + sizeof(encodingext));
if(!newbuf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree(GetProcessHeap(), 0, buf);
return FALSE;
}
wsprintf32A(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
wsprintf32A(buf, psreencodefont, newbuf, physDev->font.afm->FontName);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, newbuf);
HeapFree(GetProcessHeap(), 0, buf);
return TRUE;
}
BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count)
{
char *buf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psshow) + count);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
wsprintf32A(buf, psshow, str);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf);
return TRUE;
}
/*
* Postscript driver text functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include <string.h>
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
#include "print.h"
/***********************************************************************
* PSDRV_ExtTextOut
*/
BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
const RECT32 *lprect, LPCSTR str, UINT32 count,
const INT32 *lpDx )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *strbuf;
SIZE32 sz;
TRACE(psdrv, "(x=%d, y=%d, flags=0x%08x, str='%s', count=%d)\n", x, y,
flags, str, count);
strbuf = (char *)HeapAlloc( GetProcessHeap(), 0, count + 1);
if(!strbuf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
if(dc->w.textAlign & TA_UPDATECP) {
x = dc->w.CursPosX;
y = dc->w.CursPosY;
}
x = XLPTODP(dc, x);
y = YLPTODP(dc, y);
GetTextExtentPoint32A(dc->hSelf, str, count, &sz);
sz.cx = XLSTODS(dc, sz.cx);
sz.cy = YLSTODS(dc, sz.cy);
switch(dc->w.textAlign & (TA_LEFT | TA_CENTER | TA_RIGHT) ) {
case TA_LEFT:
if(dc->w.textAlign & TA_UPDATECP)
dc->w.CursPosX = XDPTOLP(dc, x + sz.cx);
break;
case TA_CENTER:
x -= sz.cx/2;
break;
case TA_RIGHT:
x -= sz.cx;
if(dc->w.textAlign & TA_UPDATECP)
dc->w.CursPosX = XDPTOLP(dc, x);
break;
}
switch(dc->w.textAlign & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
case TA_TOP:
break;
case TA_BASELINE:
y -= physDev->font.tm.tmAscent;
break;
case TA_BOTTOM:
y -= sz.cy;
break;
}
memcpy(strbuf, str, count);
*(strbuf + count) = '\0';
PSDRV_SetFont(dc);
PSDRV_WriteMoveTo(dc, x, y);
PSDRV_WriteShow(dc, strbuf, strlen(strbuf));
HeapFree(GetProcessHeap(), 0, strbuf);
return TRUE;
}
......@@ -1404,7 +1404,6 @@ BOOL32 X11DRV_BitBlt( DC *dcDst, INT32 xDst, INT32 yDst,
result = (BOOL32)CALL_LARGE_STACK( BITBLT_DoStretchBlt, &params );
LeaveCriticalSection( &X11DRV_CritSection );
DIB_UpdateDIBSection( dcDst, TRUE );
DIB_UpdateDIBSection( dcSrc, TRUE );
return result;
}
......@@ -1427,6 +1426,5 @@ BOOL32 X11DRV_StretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
result = (BOOL32)CALL_LARGE_STACK( BITBLT_DoStretchBlt, &params );
LeaveCriticalSection( &X11DRV_CritSection );
DIB_UpdateDIBSection( dcDst, TRUE );
DIB_UpdateDIBSection( dcSrc, TRUE );
return result;
}
......@@ -246,7 +246,7 @@ X11DRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom )
BOOL32
X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
{
INT32 width, oldwidth;
INT32 width, oldwidth, oldjoinstyle;
TRACE(graphics, "(%d %d %d %d)\n",
left, top, right, bottom);
......@@ -276,6 +276,9 @@ X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
}
if(width == 1) width=0;
dc->u.x.pen.width=width;
oldjoinstyle=dc->u.x.pen.linejoin;
if(dc->u.x.pen.type!=PS_GEOMETRIC)
dc->u.x.pen.linejoin=PS_JOIN_MITER;
if ((right > left + width) && (bottom > top + width))
{
......@@ -291,6 +294,7 @@ X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
right-left-1, bottom-top-1 );
dc->u.x.pen.width=oldwidth;
dc->u.x.pen.linejoin=oldjoinstyle;
return TRUE;
}
......
......@@ -23,10 +23,12 @@ HPEN32 X11DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
dc->w.hPen = hpen;
dc->u.x.pen.style = pen->logpen.lopnStyle & PS_STYLE_MASK;
dc->u.x.pen.type = pen->logpen.lopnStyle & PS_TYPE_MASK;
dc->u.x.pen.endcap = pen->logpen.lopnStyle & PS_ENDCAP_MASK;
dc->u.x.pen.linejoin = pen->logpen.lopnStyle & PS_JOIN_MASK;
dc->u.x.pen.width = pen->logpen.lopnWidth.x * dc->vportExtX / dc->wndExtX;
dc->u.x.pen.width = (pen->logpen.lopnWidth.x * dc->vportExtX +
dc->wndExtX / 2) / dc->wndExtX;
if (dc->u.x.pen.width < 0) dc->u.x.pen.width = -dc->u.x.pen.width;
if (dc->u.x.pen.width == 1) dc->u.x.pen.width = 0; /* Faster */
dc->u.x.pen.pixel = COLOR_ToPhysical( dc, pen->logpen.lopnColor );
......
......@@ -197,14 +197,14 @@ static void LFD_GetWeight( fontInfo* fi, LPSTR lpStr, int j)
fi->fi_flags |= FI_POLYWEIGHT;
else if( j == 4 )
{
if( !lstrncmpi32A( "bold", lpStr, 4) )
if( !strncasecmp( "bold", lpStr, 4) )
fi->df.dfWeight = FW_BOLD;
else if( !lstrncmpi32A( "demi", lpStr, 4) )
else if( !strncasecmp( "demi", lpStr, 4) )
{
fi->fi_flags |= FI_FW_DEMI;
fi->df.dfWeight = FW_DEMIBOLD;
}
else if( !lstrncmpi32A( "book", lpStr, 4) )
else if( !strncasecmp( "book", lpStr, 4) )
{
fi->fi_flags |= FI_FW_BOOK;
fi->df.dfWeight = FW_REGULAR;
......@@ -212,14 +212,14 @@ static void LFD_GetWeight( fontInfo* fi, LPSTR lpStr, int j)
}
else if( j == 5 )
{
if( !lstrncmpi32A( "light", lpStr, 5) )
if( !strncasecmp( "light", lpStr, 5) )
fi->df.dfWeight = FW_LIGHT;
else if( !lstrncmpi32A( "black", lpStr, 5) )
else if( !strncasecmp( "black", lpStr, 5) )
fi->df.dfWeight = FW_BLACK;
}
else if( j == 6 && !lstrncmpi32A( "medium", lpStr, 6) )
else if( j == 6 && !strncasecmp( "medium", lpStr, 6) )
fi->df.dfWeight = FW_REGULAR;
else if( j == 8 && !lstrncmpi32A( "demibold", lpStr, 8) )
else if( j == 8 && !strncasecmp( "demibold", lpStr, 8) )
fi->df.dfWeight = FW_DEMIBOLD;
else
fi->df.dfWeight = FW_DONTCARE; /* FIXME: try to get something
......@@ -274,7 +274,7 @@ static int LFD_InitFontInfo( fontInfo* fi, LPSTR lpstr )
/* width name - */
lpch = LFD_Advance( lpstr = lpch, 1);
if( !*lpch ) return FALSE;
if( lstrncmpi32A( "normal", lpstr, 6) ) /* XXX 'narrow', 'condensed', etc... */
if( strncasecmp( "normal", lpstr, 6) ) /* XXX 'narrow', 'condensed', etc... */
dec_style_check = TRUE;
else
fi->fi_flags |= FI_NORMAL;
......@@ -751,28 +751,28 @@ static BYTE XFONT_FixupFlags( LPCSTR lfFaceName )
switch( lfFaceName[0] )
{
case 'h':
case 'H': if(!lstrcmpi32A(lfFaceName, "Helvetica") )
case 'H': if(!strcasecmp(lfFaceName, "Helvetica") )
return FF_SWISS;
break;
case 'c':
case 'C': if(!lstrcmpi32A(lfFaceName, "Courier") ||
!lstrcmpi32A(lfFaceName, "Charter") )
case 'C': if(!strcasecmp(lfFaceName, "Courier") ||
!strcasecmp(lfFaceName, "Charter") )
return FF_ROMAN;
break;
case 'p':
case 'P': if( !lstrcmpi32A(lfFaceName,"Palatino") )
case 'P': if( !strcasecmp(lfFaceName,"Palatino") )
return FF_ROMAN;
break;
case 't':
case 'T': if(!lstrncmpi32A(lfFaceName, "Times", 5) )
case 'T': if(!strncasecmp(lfFaceName, "Times", 5) )
return FF_ROMAN;
break;
case 'u':
case 'U': if(!lstrcmpi32A(lfFaceName, "Utopia") )
case 'U': if(!strcasecmp(lfFaceName, "Utopia") )
return FF_ROMAN;
break;
case 'z':
case 'Z': if(!lstrcmpi32A(lfFaceName, "Zapf Dingbats") )
case 'Z': if(!strcasecmp(lfFaceName, "Zapf Dingbats") )
return FF_DECORATIVE;
}
return 0;
......@@ -786,7 +786,7 @@ static BOOL32 XFONT_CheckResourceName( LPSTR resource, LPCSTR name, INT32 n )
{
resource = LFD_Advance( resource, 2 );
if( resource )
return (!lstrncmpi32A( resource, name, n ));
return (!strncasecmp( resource, name, n ));
return FALSE;
}
......@@ -857,8 +857,8 @@ static void XFONT_WindowsNames( char* buffer )
while( *buffer && isspace(*buffer) ) buffer++;
for( fr = NULL, pfr = fontList; pfr; pfr = pfr->next )
{
i = lstrlen32A( pfr->resource );
if( !lstrncmpi32A( pfr->resource, buffer, i) )
i = strlen( pfr->resource );
if( !strncasecmp( pfr->resource, buffer, i) )
{
if( fr )
{
......@@ -884,7 +884,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias )
while( 1 )
{
/* check if we already got one */
if( !lstrcmpi32A( pfa->faTypeFace, lpAlias ) )
if( !strcasecmp( pfa->faTypeFace, lpAlias ) )
{
TRACE(font,"\tredundant alias '%s' -> '%s'\n",
lpAlias, lpTypeFace );
......@@ -966,14 +966,14 @@ static void XFONT_LoadAliases( char** buffer, int buf_size )
{
int length;
length = lstrlen32A( lpAlias );
length = strlen( lpAlias );
if( lpResource && length )
{
fontResource* fr, *frMatch = NULL;
for (fr = fontList; fr ; fr = fr->next)
{
if( !lstrcmpi32A( fr->resource, lpResource ) ) frMatch = fr;
if( !strcasecmp( fr->resource, lpResource ) ) frMatch = fr;
if( XFONT_CheckResourceName( fr->resource, lpAlias, length ) )
{
/* alias is not needed since the real font is present */
......@@ -990,7 +990,7 @@ static void XFONT_LoadAliases( char** buffer, int buf_size )
for(pfa = aliasTable; pfa; pfa = pfa->next)
{
/* Remove lpAlias from aliasTable - we should free the old entry */
if(!lstrcmp32A(lpAlias, pfa->faAlias))
if(!strcmp(lpAlias, pfa->faAlias))
{
if(prev)
prev->next = pfa->next;
......@@ -999,7 +999,7 @@ static void XFONT_LoadAliases( char** buffer, int buf_size )
}
/* Update any references to the substituted font in aliasTable */
if(!lstrcmp32A(frMatch->lfFaceName,
if(!strcmp(frMatch->lfFaceName,
pfa->faTypeFace))
pfa->faTypeFace = HEAP_strdupA( SystemHeap, 0,
lpAlias );
......@@ -1037,11 +1037,11 @@ static char* XFONT_UserMetricsCache( char* buffer, int* buf_size )
pwd = getpwuid(getuid());
if( pwd && pwd->pw_dir )
{
int i = lstrlen32A( pwd->pw_dir ) + lstrlen32A( INIWinePrefix ) +
lstrlen32A( INIFontMetrics ) + 2;
int i = strlen( pwd->pw_dir ) + strlen( INIWinePrefix ) +
strlen( INIFontMetrics ) + 2;
if( i > *buf_size )
buffer = (char*) HeapReAlloc( SystemHeap, 0, buffer, *buf_size = i );
lstrcpy32A( buffer, pwd->pw_dir );
strcpy( buffer, pwd->pw_dir );
strcat( buffer, INIWinePrefix );
strcat( buffer, INIFontMetrics );
} else buffer[0] = '\0';
......@@ -1170,7 +1170,7 @@ static BOOL32 XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count
for( j = i = 0, pfr = fontList; pfr; pfr = pfr->next )
{
i += lstrlen32A( pfr->resource ) + 1;
i += strlen( pfr->resource ) + 1;
j += pfr->count;
}
i += n_ff * sizeof(fontResource) + j * sizeof(fontInfo) + sizeof(int);
......@@ -1207,7 +1207,7 @@ static BOOL32 XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count
write( fd, &i, sizeof(int) );
for( pfr = fontList; pfr && i == j; pfr = pfr->next )
{
i = lstrlen32A( pfr->resource ) + 1;
i = strlen( pfr->resource ) + 1;
j = write( fd, pfr->resource, i );
}
}
......@@ -1349,7 +1349,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
printf("%i\t: %s\n", i, x_pattern[i] );
#endif
j = lstrlen32A( x_pattern[i] );
j = strlen( x_pattern[i] );
if( j ) x_checksum ^= __genericCheckSum( x_pattern[i], j );
}
x_checksum |= X_PFONT_MAGIC;
......@@ -1395,8 +1395,8 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
for( pfr = NULL, fr = fontList; fr; fr = fr->next )
{
if( !lstrncmpi32A(fr->resource, typeface, j) &&
lstrlen32A(fr->resource) == j ) break;
if( !strncasecmp(fr->resource, typeface, j) &&
strlen(fr->resource) == j ) break;
pfr = fr;
}
......@@ -1433,7 +1433,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
{
/* set scalable font height to 24 to get an origin for extrapolation */
j = lstrlen32A(typeface); j += 0x10;
j = strlen(typeface); j += 0x10;
if( j > buf_size )
buffer = (char*)HeapReAlloc( SystemHeap, 0, buffer, buf_size = j );
......@@ -1482,7 +1482,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
/* check if we're dealing with X11 R6 server */
lstrcpy32A(buffer, "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1");
strcpy(buffer, "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1");
if( (x_fs = TSXLoadQueryFont(display, buffer)) )
{
XTextCaps |= TC_SF_X_YINDEP;
......@@ -1739,7 +1739,7 @@ static fontResource* XFONT_FindFIList( fontResource* pfr, const char* pTypeFace
{
while( pfr )
{
if( !lstrcmpi32A( pfr->lfFaceName, pTypeFace ) ) break;
if( !strcasecmp( pfr->lfFaceName, pTypeFace ) ) break;
pfr = pfr->next;
}
return pfr;
......@@ -1761,7 +1761,7 @@ static BOOL32 XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm )
LPSTR str = NULL;
for( fa = aliasTable; fa; fa = fa->next )
if( !lstrcmpi32A( fa->faAlias, fm.plf->lfFaceName ) )
if( !strcmp( fa->faAlias, fm.plf->lfFaceName ) )
{
str = fa->faTypeFace;
break;
......@@ -1834,7 +1834,7 @@ static fontObject* XFONT_LookupCachedFont( LPLOGFONT16 plf, UINT16* checksum )
if( !memcmp( plf, &fontCache[i].lf,
sizeof(LOGFONT16) - LF_FACESIZE ) &&
!lstrncmpi32A( plf->lfFaceName, fontCache[i].lf.lfFaceName,
!strncasecmp( plf->lfFaceName, fontCache[i].lf.lfFaceName,
LF_FACESIZE ) )
{
/* remove temporarily from the lru list */
......
......@@ -38,6 +38,7 @@ DLLS = \
win87em.spec \
winaspi.spec \
windebug.spec \
wineps.spec \
wing.spec \
winsock.spec \
wprocs.spec
......@@ -49,6 +50,7 @@ C_SRCS = \
dummy.c \
relay.c \
signal.c \
snoop.c \
thunk.c
GEN_ASM_SRCS = \
......
......@@ -76,6 +76,7 @@ extern const WIN16_DESCRIPTOR WIN32S16_Descriptor;
extern const WIN16_DESCRIPTOR WIN87EM_Descriptor;
extern const WIN16_DESCRIPTOR WINASPI_Descriptor;
extern const WIN16_DESCRIPTOR WINDEBUG_Descriptor;
extern const WIN16_DESCRIPTOR WINEPS_Descriptor;
extern const WIN16_DESCRIPTOR WING_Descriptor;
extern const WIN16_DESCRIPTOR WINSOCK_Descriptor;
extern const WIN16_DESCRIPTOR WPROCS_Descriptor;
......@@ -117,6 +118,7 @@ static BUILTIN16_DLL BuiltinDLLs[] =
{ &WIN32S16_Descriptor, 0 },
{ &WIN87EM_Descriptor, DLL_FLAG_NOT_USED },
{ &WINASPI_Descriptor, 0 },
{ &WINEPS_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &WING_Descriptor, 0 },
{ &WINSOCK_Descriptor, 0 },
/* Last entry */
......
......@@ -64,7 +64,7 @@ file krnl386.exe
64 pascal16 AccessResource(word word) AccessResource16
65 pascal SizeofResource(word word) SizeofResource16
66 pascal16 AllocResource(word word long) AllocResource
67 pascal SetResourceHandler(word segstr segptr) THUNK_SetResourceHandler
67 pascal SetResourceHandler(word segstr segptr) SetResourceHandler
68 pascal16 InitAtomTable(word) InitAtomTable16
69 pascal16 FindAtom(segstr) FindAtom16
70 pascal16 AddAtom(segstr) AddAtom16
......@@ -133,7 +133,7 @@ file krnl386.exe
130 pascal FileCDR(ptr) FileCDR
131 pascal GetDOSEnvironment() GetDOSEnvironment
132 pascal GetWinFlags() GetWinFlags
133 pascal16 GetExePtr(word) GetExePtr
133 register GetExePtr(word) WIN16_GetExePtr
134 pascal16 GetWindowsDirectory(ptr word) GetWindowsDirectory16
135 pascal16 GetSystemDirectory(ptr word) GetSystemDirectory16
136 pascal16 GetDriveType(word) GetDriveType16
......@@ -322,7 +322,7 @@ file krnl386.exe
480 stub KERNEL_480
481 stub KERNEL_481
482 pascal LoadLibrary32(str) LoadLibrary32A
485 stub KERNEL_485
485 pascal GetProcessDWORD(long s_word) GetProcessDword
486 stub KERNEL_486
491 stub RegisterServiceProcess
500 stub KERNEL_500
......
......@@ -7,7 +7,7 @@ type win16
5 pascal mmsystemGetVersion() mmsystemGetVersion16
6 pascal DriverProc(long word word long long) DriverProc
8 stub WMMMIDIRUNONCE
30 pascal16 OutputDebugStr(ptr) OutputDebugString16
30 pascal16 OutputDebugStr(str) OutputDebugString16
31 pascal DriverCallback(long word word word long long long) DriverCallback
32 stub STACKENTER
33 stub STACKLEAVE
......
......@@ -55,6 +55,9 @@ BOOL32 RELAY_Init(void)
}
/* from relay32/relay386.c */
extern debug_relay_includelist;
extern debug_relay_excludelist;
/***********************************************************************
* RELAY_DebugCallFrom16
......@@ -65,14 +68,18 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
STACK16FRAME *frame;
WORD ordinal;
char *args16;
const char *funstr;
int i;
/* from relay32/relay386.c */
extern int RELAY_ShowDebugmsgRelay(const char *);
if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16;
DPRINTF( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip,
&ordinal ));
funstr = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal);
if (!funstr) return; /* happens for the two snoop register relays */
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Call %s(",funstr);
VA_START16( args16 );
if (func_type & 4) /* cdecl */
......@@ -184,12 +191,16 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT *context)
{
STACK16FRAME *frame;
WORD ordinal;
const char *funstr;
/* from relay32/relay386.c */
extern int RELAY_ShowDebugmsgRelay(const char *);
if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16;
DPRINTF( "Ret %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip,
&ordinal ));
funstr = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal);
if (!funstr) return;
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Ret %s() ",funstr);
switch(func_type)
{
case 0: /* long */
......
/*
* 386-specific Win16 dll<->dll snooping functions
*
* Copyright 1998 Marcus Meissner
*/
#ifdef __i386__
#include <assert.h>
#include "windows.h"
#include "winbase.h"
#include "winnt.h"
#include "heap.h"
#include "global.h"
#include "selectors.h"
#include "stackframe.h"
#include "snoop.h"
#include "debugstr.h"
#include "debug.h"
#pragma pack(1)
void WINAPI SNOOP16_Entry(CONTEXT *context);
void WINAPI SNOOP16_Return(CONTEXT *context);
extern void CallFrom16_p_regs_();
/* Generic callfrom16_p_regs function entry.
* pushw %bp 0x55
* pushl $DOS3Call DWORD fun32
* .byte 0x9a 0x9a
* .long CallFrom16_p_regs_ DWORD addr
* .long 0x90900023 WORD seg;nop;nop
*/
typedef struct tagSNOOP16_FUN {
/* code part */
BYTE lcall; /* 0x9a call absolute with segment */
DWORD snr;
/* unreached */
int nrofargs;
FARPROC16 origfun;
char *name;
} SNOOP16_FUN;
typedef struct tagSNOOP16_DLL {
HMODULE16 hmod;
HANDLE16 funhandle;
SNOOP16_FUN *funs;
LPCSTR name;
struct tagSNOOP16_DLL *next;
} SNOOP16_DLL;
typedef struct tagSNOOP16_RETURNENTRY {
/* code part */
BYTE lcall; /* 0x9a call absolute with segment */
DWORD snr;
/* unreached */
FARPROC16 origreturn;
SNOOP16_DLL *dll;
DWORD ordinal;
WORD origSP;
WORD *args; /* saved args across a stdcall */
} SNOOP16_RETURNENTRY;
typedef struct tagSNOOP16_RETURNENTRIES {
SNOOP16_RETURNENTRY entry[65500/sizeof(SNOOP16_RETURNENTRY)];
HANDLE16 rethandle;
struct tagSNOOP16_RETURNENTRIES *next;
} SNOOP16_RETURNENTRIES;
typedef struct tagSNOOP16_RELAY {
/* code part */
BYTE prefix; /* 0x66 , 32bit prefix */
BYTE pushbp; /* 0x55 */
BYTE pushl; /* 0x68 */
DWORD realfun; /* SNOOP16_Return */
BYTE lcall; /* 0x9a call absolute with segment */
DWORD callfromregs;
WORD seg;
/* unreached */
} SNOOP16_RELAY;
#pragma pack(4)
static SNOOP16_DLL *firstdll = NULL;
static SNOOP16_RETURNENTRIES *firstrets = NULL;
static SNOOP16_RELAY *snr;
static HANDLE16 xsnr = 0;
void
SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
SNOOP16_DLL **dll = &(firstdll);
char *s;
if (!TRACE_ON(snoop)) return;
if (!snr) {
xsnr=GLOBAL_Alloc(GMEM_ZEROINIT,2*sizeof(*snr),0,TRUE,TRUE,FALSE);
snr = GlobalLock16(xsnr);
snr[0].prefix = 0x66;
snr[0].pushbp = 0x55;
snr[0].pushl = 0x68;
snr[0].realfun = (DWORD)SNOOP16_Entry;
snr[0].lcall = 0x9a;
snr[0].callfromregs = (DWORD)CallFrom16_p_regs_;
GET_CS(snr[0].seg);
snr[1].prefix = 0x66;
snr[1].pushbp = 0x55;
snr[1].pushl = 0x68;
snr[1].realfun = (DWORD)SNOOP16_Return;
snr[1].lcall = 0x9a;
snr[1].callfromregs = (DWORD)CallFrom16_p_regs_;
GET_CS(snr[1].seg);
}
while (*dll) {
if ((*dll)->hmod == pModule->self)
return; /* already registered */
dll = &((*dll)->next);
}
*dll = (SNOOP16_DLL*)HeapAlloc(SystemHeap,HEAP_ZERO_MEMORY,sizeof(SNOOP16_DLL));
(*dll)->next = NULL;
(*dll)->hmod = pModule->self;
if ((s=strrchr(name,'\\')))
name = s+1;
(*dll)->name = HEAP_strdupA(SystemHeap,0,name);
if ((s=strrchr((*dll)->name,'.')))
*s='\0';
(*dll)->funhandle = GlobalHandleToSel(GLOBAL_Alloc(GMEM_ZEROINIT,65535,0,TRUE,FALSE,FALSE));
(*dll)->funs = GlobalLock16((*dll)->funhandle);
if (!(*dll)->funs) {
HeapFree(SystemHeap,0,*dll);
FIXME(snoop,"out of memory\n");
return;
}
memset((*dll)->funs,0,65535);
}
FARPROC16
SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
SNOOP16_DLL *dll = firstdll;
SNOOP16_FUN *fun;
NE_MODULE *pModule = NE_GetPtr(hmod);
unsigned char *cpnt;
char name[200];
if (!TRACE_ON(snoop) || !pModule || !HIWORD(origfun))
return origfun;
if (!*(LPBYTE)PTR_SEG_TO_LIN(origfun)) /* 0x00 is an imposs. opcode, poss. dataref. */
return origfun;
while (dll) {
if (hmod == dll->hmod)
break;
dll=dll->next;
}
if (!dll) /* probably internal */
return origfun;
if (ordinal>65535/sizeof(SNOOP16_FUN))
return origfun;
fun = dll->funs+ordinal;
/* already done? */
fun->lcall = 0x9a;
fun->snr = MAKELONG(0,xsnr);
fun->origfun = origfun;
if (fun->name)
return (FARPROC16)(SEGPTR)MAKELONG(((char*)fun-(char*)dll->funs),dll->funhandle);
cpnt = (unsigned char *)pModule + pModule->name_table;
while (*cpnt) {
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD*)(cpnt+*cpnt+1) == ordinal) {
sprintf(name,"%.*s",*cpnt,cpnt+1);
break;
}
}
/* Now search the non-resident names table */
if (!*cpnt && pModule->nrname_handle) {
cpnt = (char *)GlobalLock16( pModule->nrname_handle );
while (*cpnt) {
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD*)(cpnt+*cpnt+1) == ordinal) {
sprintf(name,"%.*s",*cpnt,cpnt+1);
break;
}
}
}
if (*cpnt)
fun->name = HEAP_strdupA(SystemHeap,0,name);
else
fun->name = HEAP_strdupA(SystemHeap,0,"");
fun->lcall = 0x9a;
fun->snr = MAKELONG(0,xsnr);
fun->origfun = origfun;
fun->nrofargs = -1;
return (FARPROC16)(SEGPTR)MAKELONG(((char*)fun-(char*)dll->funs),dll->funhandle);
}
#define CALLER1REF (*(DWORD*)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context)+4)))
void WINAPI SNOOP16_Entry(CONTEXT *context) {
DWORD ordinal=0;
DWORD entry=(DWORD)PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5;
WORD xcs = CS_reg(context);
SNOOP16_DLL *dll = firstdll;
SNOOP16_FUN *fun = NULL;
SNOOP16_RETURNENTRIES **rets = &firstrets;
SNOOP16_RETURNENTRY *ret;
int i,max;
while (dll) {
if (xcs == dll->funhandle) {
fun = (SNOOP16_FUN*)entry;
ordinal = fun-dll->funs;
break;
}
dll=dll->next;
}
if (!dll) {
FIXME(snoop,"entrypoint 0x%08lx not found\n",entry);
return; /* oops */
}
/* guess cdecl ... */
if (fun->nrofargs<0) {
/* Typical cdecl return frame is:
* add esp, xxxxxxxx
* which has (for xxxxxxxx up to 255 the opcode "83 C4 xx".
*/
LPBYTE reteip = (LPBYTE)PTR_SEG_TO_LIN(CALLER1REF);
if ((reteip[0]==0x83)&&(reteip[1]==0xc4))
fun->nrofargs=reteip[2]/2;
}
while (*rets) {
for (i=0;i<sizeof((*rets)->entry)/sizeof((*rets)->entry[0]);i++)
if (!(*rets)->entry[i].origreturn)
break;
if (i!=sizeof((*rets)->entry)/sizeof((*rets)->entry[0]))
break;
rets = &((*rets)->next);
}
if (!*rets) {
HANDLE16 hand = GlobalHandleToSel(GLOBAL_Alloc(GMEM_ZEROINIT,65535,0,TRUE,FALSE,FALSE));
*rets = GlobalLock16(hand);
memset(*rets,0,65535);
(*rets)->rethandle = hand;
i = 0; /* entry 0 is free */
}
ret = &((*rets)->entry[i]);
ret->lcall = 0x9a;
ret->snr = MAKELONG(sizeof(SNOOP16_RELAY),xsnr);
ret->origreturn = (FARPROC16)CALLER1REF;
CALLER1REF = MAKELONG((char*)&(ret->lcall)-(char*)((*rets)->entry),(*rets)->rethandle);
ret->dll = dll;
ret->args = NULL;
ret->ordinal = ordinal;
ret->origSP = SP_reg(context);
IP_reg(context)= LOWORD(fun->origfun);
CS_reg(context)= HIWORD(fun->origfun);
DPRINTF("Call %s.%ld: %s(",dll->name,ordinal,fun->name);
if (fun->nrofargs>0) {
max = fun->nrofargs; if (max>16) max=16;
for (i=max;i--;)
DPRINTF("%04x%s",*(WORD*)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context))+8+sizeof(WORD)*i),i?",":"");
if (max!=fun->nrofargs)
DPRINTF(" ...");
} else if (fun->nrofargs<0) {
DPRINTF("<unknown, check return>");
ret->args = HeapAlloc(SystemHeap,0,16*sizeof(WORD));
memcpy(ret->args,(LPBYTE)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context))+8),sizeof(WORD)*16);
}
DPRINTF(") ret=%04x:%04x\n",HIWORD((DWORD)(*rets)->entry[i].origreturn),LOWORD((DWORD)(*rets)->entry[i].origreturn));
}
void WINAPI SNOOP16_Return(CONTEXT *context) {
SNOOP16_RETURNENTRY *ret = (SNOOP16_RETURNENTRY*)(PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5);
/* We haven't found out the nrofargs yet. If we called a cdecl
* function it is too late anyway and we can just set '0' (which
* will be the difference between orig and current SP
* If pascal -> everything ok.
*/
if (ret->dll->funs[ret->ordinal].nrofargs<0)
ret->dll->funs[ret->ordinal].nrofargs=(SP_reg(context)-ret->origSP-4)/2;
IP_reg(context) = LOWORD(ret->origreturn);
CS_reg(context) = HIWORD(ret->origreturn);
if (ret->args) {
int i,max;
DPRINTF("Ret %s.%ld: %s(",ret->dll->name,ret->ordinal,ret->dll->funs[ret->ordinal].name);
max = ret->dll->funs[ret->ordinal].nrofargs;
if (max>16) max=16;
for (i=max;i--;)
DPRINTF("%04x%s",ret->args[i],i?",":"");
DPRINTF(") retval = %04x:%04x ret=%04x:%04x\n",
DX_reg(context),AX_reg(context),HIWORD(ret->origreturn),LOWORD(ret->origreturn)
);
HeapFree(SystemHeap,0,ret->args);
ret->args = NULL;
} else
DPRINTF("Ret %s.%ld: %s() retval = %04x:%04x ret=%04x:%04x\n",
ret->dll->name,ret->ordinal,ret->dll->funs[ret->ordinal].name,
DX_reg(context),AX_reg(context),HIWORD(ret->origreturn),LOWORD(ret->origreturn)
);
ret->origreturn = NULL; /* mark as empty */
}
#else /* !__i386__ */
void SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
FIXME(snoop,"snooping works only on i386 for now.\n");
return;
}
FARPROC16 SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
return origfun;
}
#endif /* !__i386__ */
......@@ -152,6 +152,7 @@ static const CALLBACKS_TABLE CALLBACK_EmulatorTable =
(void *)CallTo16_word_ww, /* CallBootAppProc */
(void *)CallTo16_word_www, /* CallLoadAppSegProc */
(void *)CallTo16_word_, /* CallSystemTimerProc */
(void *)CallTo16_word_www, /* CallResourceHandlerProc */
(void *)CallTo16_long_l, /* CallWOWCallbackProc */
THUNK_WOWCallback16Ex, /* CallWOWCallback16Ex */
(void *)CallTo16_long_l, /* CallASPIPostProc */
......@@ -566,55 +567,6 @@ FARPROC16 WINAPI THUNK_SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
/***********************************************************************
* THUNK_SetResourceHandler (KERNEL.67)
*/
FARPROC16 WINAPI THUNK_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC16 proc )
{
static FARPROC16 defDIBIconLoader16 = NULL;
static FARPROC16 defDIBCursorLoader16 = NULL;
static FARPROC16 defResourceLoader16 = NULL;
THUNK *thunk = NULL;
if( !defResourceLoader16 )
{
HMODULE16 hUser = GetModuleHandle16("USER");
defDIBIconLoader16 = NE_GetEntryPoint( hUser, 357 );
defDIBCursorLoader16 = NE_GetEntryPoint( hUser, 356 );
defResourceLoader16 = MODULE_GetWndProcEntry16( "DefResourceHandler" );
}
if( proc == defResourceLoader16 )
thunk = (THUNK*)&NE_DefResourceHandler;
else if( proc == defDIBIconLoader16 )
thunk = (THUNK*)&LoadDIBIconHandler;
else if( proc == defDIBCursorLoader16 )
thunk = (THUNK*)&LoadDIBCursorHandler;
else
{
thunk = THUNK_Alloc( proc, (RELAY)CallTo16_word_www );
if( !thunk ) return FALSE;
}
thunk = (THUNK*)SetResourceHandler( hModule, typeId, (FARPROC16)thunk );
if( thunk == (THUNK*)&NE_DefResourceHandler )
return defResourceLoader16;
if( thunk == (THUNK*)&LoadDIBIconHandler )
return defDIBIconLoader16;
if( thunk == (THUNK*)&LoadDIBCursorHandler )
return defDIBCursorLoader16;
if( thunk )
{
proc = thunk->proc;
THUNK_Free( thunk );
return proc;
}
return NULL;
}
/***********************************************************************
* THUNK_WOWCallback16Ex (WOW32.3)(KERNEL32.55)
* Generic thunking routine to call 16 bit functions from 32bit code.
*
......
......@@ -48,7 +48,7 @@ file user.exe
44 pascal16 OpenIcon(word) OpenIcon16
45 pascal16 BringWindowToTop(word) BringWindowToTop16
46 pascal16 GetParent(word) GetParent16
47 pascal16 IsWindow(word) IsWindow16
47 register IsWindow(word) WIN16_IsWindow16
48 pascal16 IsChild(word word) IsChild16
49 pascal16 IsWindowVisible(word) IsWindowVisible16
50 pascal16 FindWindow(segstr str) FindWindow16
......
name wineps
type win16
13 pascal16 DeviceMode(word word str str) PSDRV_DeviceMode16
90 pascal16 ExtDeviceMode(word word ptr str str ptr str word) PSDRV_ExtDeviceMode16
91 pascal DeviceCapabilities(str str word ptr ptr) PSDRV_DeviceCapabilities16
......@@ -14,6 +14,8 @@ type win16
29 pascal DefResourceHandler(word word word) NE_DefResourceHandler
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc16
31 pascal16 ASPI_DOS_func(long) ASPI_DOS_func
32 pascal LoadDIBIconHandler(word word word) LoadDIBIconHandler
33 pascal LoadDIBCursorHandler(word word word) LoadDIBCursorHandler
# Interrupt vectors 0-255 are ordinals 100-355
# The 'word' parameter are the flags pushed on the stack by the interrupt
......
......@@ -34,6 +34,8 @@ typedef struct
DIBSECTION *dibSection;
RGBQUAD *colorMap;
int nColorMap;
/* DIBSECTION mapping status */
enum { DIB_NoHandler, DIB_InSync, DIB_AppMod, DIB_GdiMod } status;
} BITMAPOBJ;
......@@ -51,7 +53,7 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
{ \
int width_bytes = DIB_GetXImageWidthBytes( (width), (bpp) ); \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
(bpp), ZPixmap, 0, xmalloc( (height)*width_bytes ),\
(bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
(width), (height), 32, width_bytes ); \
}
......
......@@ -37,6 +37,7 @@ typedef struct
VOID (CALLBACK *CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 );
WORD (CALLBACK *CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
VOID (CALLBACK *CallSystemTimerProc)( FARPROC16 );
HGLOBAL16 (CALLBACK *CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 );
DWORD (CALLBACK *CallWOWCallbackProc)( FARPROC16, DWORD );
BOOL32 (CALLBACK *CallWOWCallback16Ex)( FARPROC16, DWORD, DWORD, LPVOID,
LPDWORD );
......
......@@ -85,6 +85,12 @@ BOOL32 WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
#define LPSTR_TEXTCALLBACK WINELIB_NAME_AW(LPSTR_TEXTCALLBACK)
/* owner drawn types */
#define ODT_HEADER 100
#define ODT_TAB 101
#define ODT_LISTVIEW 102
/* StatusWindow */
#define STATUSCLASSNAME16 "msctls_statusbar"
......@@ -523,6 +529,7 @@ typedef struct tagNMHEADERA
#define TBSTATE_ELLIPSES 0x40
#define TBSTATE_MARKED 0x80
#define TBSTYLE_BUTTON 0x00
#define TBSTYLE_SEP 0x01
#define TBSTYLE_CHECK 0x02
......@@ -602,10 +609,32 @@ typedef struct tagNMHEADERA
#define TB_SETBUTTONWIDTH (WM_USER+59)
#define TB_SETMAXTEXTROWS (WM_USER+60)
#define TB_GETTEXTROWS (WM_USER+61)
#define TB_GETOBJECT (WM_USER+62)
#define TB_SETDRAWTEXTFLAGS (WM_USER+70)
#define TB_GETHOTITEM (WM_USER+71)
#define TB_SETHOTITEM (WM_USER+72)
#define TB_SETANCHORHIGHLIGHT (WM_USER+73)
#define TB_GETANCHORHIGHLIGHT (WM_USER+74)
#define TB_MAPACCELERATOR32A (WM_USER+78)
#define TB_MAPACCELERATOR32W (WM_USER+90)
#define TB_MAPACCELERATOR WINELIB_NAME_AW(TB_MAPACCELERATOR)
#define TB_GETINSERTMARK (WM_USER+79)
#define TB_SETINSERTMARK (WM_USER+80)
#define TB_INSERTMARKHITTEST (WM_USER+81)
#define TB_MOVEBUTTON (WM_USER+82)
#define TB_GETMAXSIZE (WM_USER+83)
#define TB_SETEXTENDEDSTYLE (WM_USER+84)
#define TB_GETEXTENDEDSTYLE (WM_USER+85)
#define TB_GETPADDING (WM_USER+86)
#define TB_SETPADDING (WM_USER+87)
#define TB_SETINSERTMARKCOLOR (WM_USER+88)
#define TB_GETINSERTMARKCOLOR (WM_USER+89)
#define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME
#define TB_GETCOLORSCHEME CCM_GETCOLORSCHEME
#define TB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
/* This is just for old CreateToolbar. */
......@@ -646,12 +675,33 @@ typedef struct tagTBADDBITMAP {
#define HINST_COMMCTRL ((HINSTANCE32)-1)
HWND32 WINAPI CreateToolbar(HWND32, DWORD, UINT32, INT32, HINSTANCE32,
typedef struct tagTBSAVEPARAMSA {
HKEY hkr;
LPCSTR pszSubKey;
LPCSTR pszValueName;
} TBSAVEPARAMS32A, *LPTBSAVEPARAMS32A;
typedef struct tagTBSAVEPARAMSW {
HKEY hkr;
LPCWSTR pszSubKey;
LPCWSTR pszValueName;
} TBSAVEPARAMSA32W, *LPTBSAVEPARAMSA32W;
#define TBSAVEPARAMS WINELIB_NAMEAW(TBSAVEPARAMS)
#define LPTBSAVEPARAMS WINELIB_NAMEAW(LPTBSAVEPARAMS)
HWND32 WINAPI
CreateToolbar(HWND32, DWORD, UINT32, INT32, HINSTANCE32,
UINT32, LPCOLDTBBUTTON, INT32);
HWND32 WINAPI CreateToolbarEx(HWND32, DWORD, UINT32, INT32, HINSTANCE32,
UINT32, LPCTBBUTTON, INT32, INT32, INT32,
INT32, INT32, UINT32);
HBITMAP32 WINAPI CreateMappedBitmap (HINSTANCE32, INT32, UINT32,
LPCOLORMAP, INT32);
HWND32 WINAPI
CreateToolbarEx(HWND32, DWORD, UINT32, INT32,
HINSTANCE32, UINT32, LPCTBBUTTON,
INT32, INT32, INT32, INT32, INT32, UINT32);
HBITMAP32 WINAPI
CreateMappedBitmap (HINSTANCE32, INT32, UINT32, LPCOLORMAP, INT32);
#endif /* __WINE_COMMCTRL_H */
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment