Release 980913
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net> * [files/file.c] [include/file.h] Fixed SetFilePointer to allow negative positions as in DOS. * [graphics/ddraw.c] Added some methods to IDirect3D. * [ole/compobj.c] [if1632/compobj.spec] Added/implemented CoCreateStandardMalloc16, CoGetClassObject, CoCreateInstance, LookupETask, SetETask, CoGetState16. * [loader/task.c] MakeProcInstance: return 0 if func == NULL. * [*/*] [tools/winapi-check] Added zillions of missing WINAPI's and __cdecl's. (oops, several caused by myself) Wrote script for automated checking. * [if1632/compobj.spec] Many stub names. * [misc/ddeml.c] [ole/compobj.c] Some stubs. Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu> * [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c] [dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h] Added preliminary tab control support. Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [graphics/psdrv/*] More changes to the PostScript driver: Implemented pens and solid brushes. Colour/greyscale for fonts, pens and brushes. To get coloured output you need to have *ColorDevice set to true in your PPD, otherwise you'll get greyscale. Landscape mode now works, as does non-A4 page sizes. Encoding of fonts to ANSI is better, Symbol works again. * [objects/dc.c] [include/gdi.h] [*/*] Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they belong. Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no> * [include/dosexe.h] [include/miscemu.h] [include/msdos.h] [loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c] [msdos/int2f.c] [msdos/interrupts.c] Fixed portability. Adapted some code to make it easier to integrate the DOS subsystem with the DPMI subsystem, made the DPMI simulated real-mode interrupts be handled the V86 way. Added support for .COM files. Made int2f DPMI check fail, to avoid pkunzip crashing in attempting to use DPMI. Generally moved stuff around a little. It is now technically possible to load several DOS programs into the same memory space. Not tested, though. Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de> * [if1632/kernel.spec] Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe. * [win32/except.c] Fixed one bad program behaviour, (deleting SEH while in first walk). RtlUnwind is broken too I think (it should unwind on success, not while walking the exception chain). * [ole/ole2nls.c] Get*DefaultLCID returns 0x400|id. expected by one application. * [if1632/snoop.c] Handle non-standard SP returns more graceful. * [windows/class.c] hinstances are mostly irrelevant for win32. * [memory/string.c] [misc/registry.c] lstrcmpi32W: use toupper for characters < 0x100. (speedup hack for registry.c) Some small speedup hacks for registry.c Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [Makefile.in][configure][configure.in][dlls/Makefile.in] [dlls/comctl32/Makefile.in] Created dlls/comctl32 and moved the common controls stuff to it. * [misc/version.c] Removed COMCTL32_DllGetVersion. The fixed function is part of the common controls stuff. * [dlls/comctl32/*.c][include/commctrl.h] Added structure size tests. * [dlls/comctl32/toolbar.c] Fixed a bug in TOOLBAR_GetMaxWidth(). * [dlls/comctl32/animate.c][include/animate.h] [dlls/comctl32/comboex.c][include/comboex.h] [dlls/comctl32/hotkey.c][include/hotkey.h] [dlls/comctl32/listview.c][include/listview.h] [dlls/comctl32/commctrl.c][include/commctrl.h] New files. Added Animation, ComboBoxEx, Hotkey and Listview control dummies. * [dlls/comctl32/tooltips.c] Fixed a display bug and font selection. * [dlls/comctl32/comctl32undoc.c][include/commctrl.h] Added missing DPA functions. Fixed bugs and published the function prototypes. * [documentation/common_controls] Updated. Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se> * [AUTHORS] [include/authors.h] Added myself as a Wine author. * [memory/virtual.c] [objects/dc.c] Fixed runtime errors for Solaris. * [misc/ddeml.c] [objects/gdiobj.c] Minor fixes. * [win32/device.c] Added stubs for IFSMgr VxDCall and a partial implementation of IFSMgr DeviceIo. * [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec] [relay32/msnet32.spec] [relay32/oledlg.spec] Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL. * [misc/Makefile.in] [misc/imm.c] [include/imm.h] Added news files for implementation of IMM32.DLL. All functions return 0 as is correct for all Western Languages. * [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h] Added new files for implementation of OLEDLG.DLL. Added stubs with FIXME:s for all functions. Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de> * [dlls/shell32/contmenu.c][dlls/shell32/shellole.c] [dlls/shell32/shlfolder.c][dlls/shell32/shlview.c] [documentation/shell32][include/shell.h] Clean up, bugfixes. * [dlls/shell32/enumidlist.c] Fileattributes implemented. * [dlls/shell32/pidl.c] Class pidlmgr splited into functions, structures changed, some functions rewritten. * [dlls/shell32/shell32_main.c] Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation. * [dlls/shell32/shellord.c][relay32/shell32.spec] Parameter documented, implemented SHCloneSpecialIDList. Stub improved ShellExecuteEx32A. New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup, FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp, SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy, SHGetDataFromIDListA, SHFileOperationA. * [include/winnls.h][include/ole2nls.c] TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented in OLE_GetFormatA, GetTimeFormat32A. * [win32/code_page.c] WideCharToMultiByte: parameter checking and returning of strlen implemented. * [windows/keyboard.c][windows/defwnd.c] Debug messages added. * [windows/win.c] WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented. * [controls/menu.c] Missing line added. * [include/winerror.h] Macros for SUCCEEDED and FAILED added. Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de> * [loader/module.c] Bugfix: LoadModule16 should *not* call LoadModule32. * [files/dos_fs.c] Bugfix: don't crash if given directory doesn't exist. Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net> * [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec] Almost completed implementation of [snd]PlaySound (except flags SND_ALIAS_ID and SND_APPLICATION). * [if1632/user.spec][windows/winpos.c] Added SetWindowRgn16 stub. Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru> * [files/drive.c] GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non existent drive. * [msdos/int21.c] INT21_FindFirstFCB: check drive validity to prevent oops. * [win32/file.c] CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE. * [files/dos_fs.c] Make DOSFS_OpenDir treat "" as "/". DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE. * [windows/dialog.c] GetNextDlgTabItem32: use last/first item instead of first/last when hwndCtrl==0. This fixes initial focus. Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au> * [include/process.h] [include/process.c] Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line with thread constant, and Win32 documentation (which calls it a pseudohandle.) Made GetCurrentProcess actually use this constant instead of the value. * [include/process.h] [include/thread.h] [scheduler/thread.c] [scheduler/process.c] [scheduler/handle.c] Modify HANDLE_GetObjPtr to understand about CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE. This allows DuplicateHandle to do the correct thing with these handles. Removed now duplicate functionality from THREAD_GetPtr and PROCESS_GetPtr. * [loader/ne/segment.c] Fixed two places where HFILE32s were being created and passed to 16-bit code. This should unbreak NE self-loading code. Added two casts to remove compile time warnings. Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com> * [msdos/dosmem.c] [msdos/int2f.c] Added beginnings of DOS error table. * [msdos/int1a.c] Stub for subfunction 0xb0. * [msdos/int10.c] [loader/dos/dosvm.c] INT 10 support completely rewritten and lots of debugging added. Now, DOS apps that use INT 10 to write to the screen will work. (Beyond Zork does, at least. Somewhat.) * [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c] Another shot at getting MS's generic error message facility right. * [msdos/int21.c] Command.Com wanted to set its own PSP address. I let it. Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com> * [include/file.h] [misc/lzexpand.c] Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't convert lzw handles. Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> * [misc/registry.c] In RegEnumvalue, ivalue == 0 is a legal request and should return the first entry. * [msdos/int21.c] Add handling for Int21-48/49 in Win16. Makes blinker demo work. * [windows/winproc.c] Add Msg32A<->Msg32W translation for LB_ADDSTRING. Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk> * [windows/win.c] Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD flag when a child window is reparented to the desktop window. Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com> * [controls/menu.c] Menus created with SetMenuItemInfo and InsertMenuItem should work now. Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu> * [controls/combo.c] Added CB_GETITEMHEIGHT. * [windows/winpos.c] WM_NCHITTEST, SWP_FRAMECHANGED bugfixes. Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl> * [files/profile.c] [include/windows.h] Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW, GetPrivateProfileStructW, GetProfileSectionW, WriteProfileSection[AW], WritePrivateProfileStructW.
This commit is contained in:
parent
85ed45e377
commit
a0d77315e4
19
ANNOUNCE
19
ANNOUNCE
|
@ -1,15 +1,14 @@
|
|||
This is release 980822 of Wine, the MS Windows emulator. This is still a
|
||||
This is release 980913 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-980822: (see ChangeLog for details)
|
||||
- Improved mmio support.
|
||||
- VxDCall support.
|
||||
- More common controls and shell32 stuff.
|
||||
- Better DOS executables support.
|
||||
WHAT'S NEW with Wine-980913: (see ChangeLog for details)
|
||||
- Even more common controls stuff.
|
||||
- Many PostScript driver improvements.
|
||||
- More DOS executables support.
|
||||
- Lots of bug fixes.
|
||||
|
||||
See the README file in the distribution for installation instructions.
|
||||
|
@ -18,10 +17,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-980822.tar.gz
|
||||
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980822.tar.gz
|
||||
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980822.tar.gz
|
||||
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980822.tar.gz
|
||||
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980913.tar.gz
|
||||
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980913.tar.gz
|
||||
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980913.tar.gz
|
||||
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980913.tar.gz
|
||||
|
||||
It should also be available from any site that mirrors tsx-11 or sunsite.
|
||||
|
||||
|
|
1
AUTHORS
1
AUTHORS
|
@ -113,6 +113,7 @@ Stephen Simmons,
|
|||
Rick Sladkey,
|
||||
William Smith,
|
||||
Dominik Strasser,
|
||||
Patrik Stridvall,
|
||||
Vadim Strizhevsky,
|
||||
Bertho Stultiens,
|
||||
Erik Svendsen,
|
||||
|
|
2
BUGS
2
BUGS
|
@ -18,7 +18,7 @@ General:
|
|||
|
||||
* Very alpha printing code using win16 drivers.
|
||||
|
||||
* Very alpha internal Postscript driver. [h.davies1@physics.ox.ac.uk]
|
||||
* 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.).
|
||||
|
|
316
ChangeLog
316
ChangeLog
|
@ -1,3 +1,319 @@
|
|||
----------------------------------------------------------------------
|
||||
Fri Sep 11 13:14:35 1998 Andreas Mohr <100.30936@germany.net>
|
||||
|
||||
* [files/file.c] [include/file.h]
|
||||
Fixed SetFilePointer to allow negative positions as in DOS.
|
||||
|
||||
* [graphics/ddraw.c]
|
||||
Added some methods to IDirect3D.
|
||||
|
||||
* [ole/compobj.c] [if1632/compobj.spec]
|
||||
Added/implemented CoCreateStandardMalloc16,
|
||||
CoGetClassObject, CoCreateInstance,
|
||||
LookupETask, SetETask, CoGetState16.
|
||||
|
||||
* [loader/task.c]
|
||||
MakeProcInstance: return 0 if func == NULL.
|
||||
|
||||
* [*/*] [tools/winapi-check]
|
||||
Added zillions of missing WINAPI's and __cdecl's.
|
||||
(oops, several caused by myself)
|
||||
Wrote script for automated checking.
|
||||
|
||||
* [if1632/compobj.spec]
|
||||
Many stub names.
|
||||
|
||||
* [misc/ddeml.c] [ole/compobj.c]
|
||||
Some stubs.
|
||||
|
||||
Tue Sep 9 21:36:48 1998 Anders Carlsson <anders.carlsson@linux.nu>
|
||||
|
||||
* [dlls/comctl32/Makefile.in] [dlls/comctl32/commctrl.c]
|
||||
[dlls/comctl32/tab.c] [include/commctrl.h] [include/tab.h]
|
||||
Added preliminary tab control support.
|
||||
|
||||
Sat Sep 5 16:27:20 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
|
||||
|
||||
* [graphics/psdrv/*]
|
||||
More changes to the PostScript driver:
|
||||
Implemented pens and solid brushes.
|
||||
Colour/greyscale for fonts, pens and brushes.
|
||||
To get coloured output you need to have *ColorDevice set to true
|
||||
in your PPD, otherwise you'll get greyscale.
|
||||
Landscape mode now works, as does non-A4 page sizes.
|
||||
Encoding of fonts to ANSI is better, Symbol works again.
|
||||
|
||||
* [objects/dc.c] [include/gdi.h] [*/*]
|
||||
Moved dc->w.{text,background}Pixel to X11DRV_PDEVICE where they
|
||||
belong.
|
||||
|
||||
Sat Sep 5 05:12:09 1998 Ove Kaaven <ovek@arcticnet.no>
|
||||
|
||||
* [include/dosexe.h] [include/miscemu.h] [include/msdos.h]
|
||||
[loader/dos/dosvm.c] [loader/dos/module.c] [msdos/dpmi.c]
|
||||
[msdos/int2f.c] [msdos/interrupts.c]
|
||||
Fixed portability. Adapted some code to make it easier to
|
||||
integrate the DOS subsystem with the DPMI subsystem, made
|
||||
the DPMI simulated real-mode interrupts be handled the V86
|
||||
way. Added support for .COM files. Made int2f DPMI check
|
||||
fail, to avoid pkunzip crashing in attempting to use DPMI.
|
||||
Generally moved stuff around a little.
|
||||
It is now technically possible to load several DOS programs
|
||||
into the same memory space. Not tested, though.
|
||||
|
||||
Fri Sep 4 21:40:45 1998 Marcus Meissner <marcus@jet.franken.de>
|
||||
|
||||
* [if1632/kernel.spec]
|
||||
Changed 500-53x stubnames accordingly to nt3.51 krnl386.exe.
|
||||
|
||||
* [win32/except.c]
|
||||
Fixed one bad program behaviour, (deleting SEH while in
|
||||
first walk). RtlUnwind is broken too I think (it should unwind
|
||||
on success, not while walking the exception chain).
|
||||
|
||||
* [ole/ole2nls.c]
|
||||
Get*DefaultLCID returns 0x400|id. expected by one application.
|
||||
|
||||
* [if1632/snoop.c]
|
||||
Handle non-standard SP returns more graceful.
|
||||
|
||||
* [windows/class.c]
|
||||
hinstances are mostly irrelevant for win32.
|
||||
|
||||
* [memory/string.c] [misc/registry.c]
|
||||
lstrcmpi32W: use toupper for characters < 0x100. (speedup hack
|
||||
for registry.c)
|
||||
Some small speedup hacks for registry.c
|
||||
|
||||
Thu Sep 3 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
|
||||
|
||||
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
|
||||
[dlls/comctl32/Makefile.in]
|
||||
Created dlls/comctl32 and moved the common controls stuff to it.
|
||||
|
||||
* [misc/version.c]
|
||||
Removed COMCTL32_DllGetVersion. The fixed function is part
|
||||
of the common controls stuff.
|
||||
|
||||
* [dlls/comctl32/*.c][include/commctrl.h]
|
||||
Added structure size tests.
|
||||
|
||||
* [dlls/comctl32/toolbar.c]
|
||||
Fixed a bug in TOOLBAR_GetMaxWidth().
|
||||
|
||||
* [dlls/comctl32/animate.c][include/animate.h]
|
||||
[dlls/comctl32/comboex.c][include/comboex.h]
|
||||
[dlls/comctl32/hotkey.c][include/hotkey.h]
|
||||
[dlls/comctl32/listview.c][include/listview.h]
|
||||
[dlls/comctl32/commctrl.c][include/commctrl.h]
|
||||
New files. Added Animation, ComboBoxEx, Hotkey and
|
||||
Listview control dummies.
|
||||
|
||||
* [dlls/comctl32/tooltips.c]
|
||||
Fixed a display bug and font selection.
|
||||
|
||||
* [dlls/comctl32/comctl32undoc.c][include/commctrl.h]
|
||||
Added missing DPA functions. Fixed bugs and published the
|
||||
function prototypes.
|
||||
|
||||
* [documentation/common_controls]
|
||||
Updated.
|
||||
|
||||
Wed Sep 2 15:43:45 1998 Patrik Stridvall <ps@leissner.se>
|
||||
|
||||
* [AUTHORS] [include/authors.h]
|
||||
Added myself as a Wine author.
|
||||
|
||||
* [memory/virtual.c] [objects/dc.c]
|
||||
Fixed runtime errors for Solaris.
|
||||
|
||||
* [misc/ddeml.c] [objects/gdiobj.c]
|
||||
Minor fixes.
|
||||
|
||||
* [win32/device.c]
|
||||
Added stubs for IFSMgr VxDCall and
|
||||
a partial implementation of IFSMgr DeviceIo.
|
||||
|
||||
* [relay32/Makefile.in] [relay32/builtin32.c] [relay32/imm32.spec]
|
||||
[relay32/msnet32.spec] [relay32/oledlg.spec]
|
||||
Added new spec files for IMM32.DLL, MSNET32.DLL, OLEDLG.DLL.
|
||||
|
||||
* [misc/Makefile.in] [misc/imm.c] [include/imm.h]
|
||||
Added news files for implementation of IMM32.DLL.
|
||||
All functions return 0 as is correct for all Western Languages.
|
||||
|
||||
* [ole/Makefile.in] [ole/oledlg.c] [include/oledlg.h]
|
||||
Added new files for implementation of OLEDLG.DLL.
|
||||
Added stubs with FIXME:s for all functions.
|
||||
|
||||
Wed Sep 2 10:50:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
|
||||
|
||||
* [dlls/shell32/contmenu.c][dlls/shell32/shellole.c]
|
||||
[dlls/shell32/shlfolder.c][dlls/shell32/shlview.c]
|
||||
[documentation/shell32][include/shell.h]
|
||||
Clean up, bugfixes.
|
||||
|
||||
* [dlls/shell32/enumidlist.c]
|
||||
Fileattributes implemented.
|
||||
|
||||
* [dlls/shell32/pidl.c]
|
||||
Class pidlmgr splited into functions, structures changed,
|
||||
some functions rewritten.
|
||||
|
||||
* [dlls/shell32/shell32_main.c]
|
||||
Small changes and bugfixes SHGetFileInfoA, SHGetSpecialFolderLocation.
|
||||
|
||||
* [dlls/shell32/shellord.c][relay32/shell32.spec]
|
||||
Parameter documented, implemented SHCloneSpecialIDList.
|
||||
Stub improved ShellExecuteEx32A.
|
||||
New stubs SHFind_InitMenuPopup, FileMenu_InitMenuPopup,
|
||||
FileMenu_Create, FileMenu_TrackPopupMenuEx, SHWinHelp,
|
||||
SHRunConrolPanel, DAD_ShowDragImage, FileMenu_Destroy,
|
||||
SHGetDataFromIDListA, SHFileOperationA.
|
||||
|
||||
* [include/winnls.h][include/ole2nls.c]
|
||||
TIME_FORCE24HOURFORMAT, TIME_NOTIMEMARKER implemented
|
||||
in OLE_GetFormatA, GetTimeFormat32A.
|
||||
|
||||
* [win32/code_page.c]
|
||||
WideCharToMultiByte: parameter checking and returning of strlen
|
||||
implemented.
|
||||
|
||||
* [windows/keyboard.c][windows/defwnd.c]
|
||||
Debug messages added.
|
||||
|
||||
* [windows/win.c]
|
||||
WIN_SetWindowLong GWL_STYLE and GWL_EXSTYLE implemented.
|
||||
|
||||
* [controls/menu.c]
|
||||
Missing line added.
|
||||
|
||||
* [include/winerror.h]
|
||||
Macros for SUCCEEDED and FAILED added.
|
||||
|
||||
Mon Aug 31 00:55:31 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
|
||||
|
||||
* [loader/module.c]
|
||||
Bugfix: LoadModule16 should *not* call LoadModule32.
|
||||
|
||||
* [files/dos_fs.c]
|
||||
Bugfix: don't crash if given directory doesn't exist.
|
||||
|
||||
Sat Aug 29 15:00:49 1998 Turchanov Sergey <turchanov@usa.net>
|
||||
|
||||
* [include/mmsystem.h][multimedia/mmsystem.c][relay32/winmm.spec]
|
||||
Almost completed implementation of [snd]PlaySound (except
|
||||
flags SND_ALIAS_ID and SND_APPLICATION).
|
||||
|
||||
* [if1632/user.spec][windows/winpos.c]
|
||||
Added SetWindowRgn16 stub.
|
||||
|
||||
Sat Aug 29 02:53:31 1998 Alexander Lukyanov <lav@long.yar.ru>
|
||||
|
||||
* [files/drive.c]
|
||||
GetDriveType32A: return DRIVE_DOESNOTEXIST in case of non
|
||||
existent drive.
|
||||
|
||||
* [msdos/int21.c]
|
||||
INT21_FindFirstFCB: check drive validity to prevent oops.
|
||||
|
||||
* [win32/file.c]
|
||||
CreateFile32A: duplicate STD_{INPUT,OUTPUT}_HANDLE.
|
||||
|
||||
* [files/dos_fs.c]
|
||||
Make DOSFS_OpenDir treat "" as "/".
|
||||
DOSFS_OpenDevice: duplicate STD_{INPUT,OUTPUT}_HANDLE.
|
||||
|
||||
* [windows/dialog.c]
|
||||
GetNextDlgTabItem32: use last/first item instead of first/last
|
||||
when hwndCtrl==0. This fixes initial focus.
|
||||
|
||||
Sat Aug 29 02:46:32 1998 Adrian Harvey <adrian@select.com.au>
|
||||
|
||||
* [include/process.h] [include/process.c]
|
||||
Renamed PROCESS_SELF to CURRENT_PROCESS_PSEUDOHANDLE in line
|
||||
with thread constant, and Win32 documentation (which calls it
|
||||
a pseudohandle.) Made GetCurrentProcess actually use this
|
||||
constant instead of the value.
|
||||
|
||||
* [include/process.h] [include/thread.h] [scheduler/thread.c]
|
||||
[scheduler/process.c] [scheduler/handle.c]
|
||||
Modify HANDLE_GetObjPtr to understand about
|
||||
CURRENT_THREAD_PSEUDOHANDLE and CURRENT_PROCESS_PSEUDOHANDLE.
|
||||
This allows DuplicateHandle to do the correct thing with these
|
||||
handles. Removed now duplicate functionality from THREAD_GetPtr
|
||||
and PROCESS_GetPtr.
|
||||
|
||||
* [loader/ne/segment.c]
|
||||
Fixed two places where HFILE32s were being created and passed to
|
||||
16-bit code. This should unbreak NE self-loading code.
|
||||
Added two casts to remove compile time warnings.
|
||||
|
||||
Fri Aug 28 21:04:13 1998 Joseph Pranevich <knight@baltimore.wwaves.com>
|
||||
|
||||
* [msdos/dosmem.c] [msdos/int2f.c]
|
||||
Added beginnings of DOS error table.
|
||||
|
||||
* [msdos/int1a.c]
|
||||
Stub for subfunction 0xb0.
|
||||
|
||||
* [msdos/int10.c] [loader/dos/dosvm.c]
|
||||
INT 10 support completely rewritten and lots of debugging
|
||||
added. Now, DOS apps that use INT 10 to write to the screen will
|
||||
work. (Beyond Zork does, at least. Somewhat.)
|
||||
|
||||
* [include/miscemu.h] [msdos/dosmem.c] [msdos/int21.c]
|
||||
Another shot at getting MS's generic error message facility
|
||||
right.
|
||||
|
||||
* [msdos/int21.c]
|
||||
Command.Com wanted to set its own PSP address. I let it.
|
||||
|
||||
Wed Aug 26 12:26:20 1998 Matthew Toseland <Matthew.Toseland@btinternet.com>
|
||||
|
||||
* [include/file.h] [misc/lzexpand.c]
|
||||
Fixed LZCopy16 by fixing HFILE16/HFILE32 convertor macros so don't
|
||||
convert lzw handles.
|
||||
|
||||
Tue Aug 25 22:22:55 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
|
||||
|
||||
* [misc/registry.c]
|
||||
In RegEnumvalue, ivalue == 0 is a legal request and should
|
||||
return the first entry.
|
||||
|
||||
* [msdos/int21.c]
|
||||
Add handling for Int21-48/49 in Win16. Makes blinker demo work.
|
||||
|
||||
* [windows/winproc.c]
|
||||
Add Msg32A<->Msg32W translation for LB_ADDSTRING.
|
||||
|
||||
Tue Aug 25 21:03:31 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
|
||||
|
||||
* [windows/win.c]
|
||||
Fix for SetParent(): MS Windows 3.11 does not clear the WS_CHILD
|
||||
flag when a child window is reparented to the desktop window.
|
||||
|
||||
Mon Aug 24 20:55:22 1998 Berend Reitsma <berend at asset-control dot com>
|
||||
|
||||
* [controls/menu.c]
|
||||
Menus created with SetMenuItemInfo and InsertMenuItem should
|
||||
work now.
|
||||
|
||||
Sun Aug 23 23:23:23 1998 Alex Korobka <korobka@ams.sunysb.edu>
|
||||
|
||||
* [controls/combo.c]
|
||||
Added CB_GETITEMHEIGHT.
|
||||
|
||||
* [windows/winpos.c]
|
||||
WM_NCHITTEST, SWP_FRAMECHANGED bugfixes.
|
||||
|
||||
Sat Aug 22 21:15:29 1998 Alex Priem <alexp@sci.kun.nl>
|
||||
|
||||
* [files/profile.c] [include/windows.h]
|
||||
Added GetPrivateProfileSectionNames[AW],GetPrivateProfileSectionW,
|
||||
GetPrivateProfileStructW, GetProfileSectionW,
|
||||
WriteProfileSection[AW], WritePrivateProfileStructW.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Sat Aug 22 17:46:19 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ LIBSUBDIRS = \
|
|||
tools \
|
||||
tools/wrc \
|
||||
controls \
|
||||
dlls/comctl32 \
|
||||
dlls/shell32 \
|
||||
files \
|
||||
graphics \
|
||||
|
@ -77,6 +78,7 @@ INSTALLSUBDIRS = $(DOCSUBDIRS)
|
|||
|
||||
LIBOBJS = \
|
||||
controls/controls.o \
|
||||
dlls/comctl32/comctl32.o \
|
||||
dlls/shell32/shell32.o \
|
||||
files/files.o \
|
||||
graphics/graphics.o \
|
||||
|
|
|
@ -3397,6 +3397,7 @@ Makefile
|
|||
controls/Makefile
|
||||
debugger/Makefile
|
||||
dlls/Makefile
|
||||
dlls/comctl32/Makefile
|
||||
dlls/shell32/Makefile
|
||||
documentation/Makefile
|
||||
files/Makefile
|
||||
|
@ -3534,6 +3535,7 @@ Makefile
|
|||
controls/Makefile
|
||||
debugger/Makefile
|
||||
dlls/Makefile
|
||||
dlls/comctl32/Makefile
|
||||
dlls/shell32/Makefile
|
||||
documentation/Makefile
|
||||
files/Makefile
|
||||
|
|
|
@ -461,6 +461,7 @@ Makefile
|
|||
controls/Makefile
|
||||
debugger/Makefile
|
||||
dlls/Makefile
|
||||
dlls/comctl32/Makefile
|
||||
dlls/shell32/Makefile
|
||||
documentation/Makefile
|
||||
files/Makefile
|
||||
|
|
|
@ -8,27 +8,14 @@ MODULE = controls
|
|||
C_SRCS = \
|
||||
button.c \
|
||||
combo.c \
|
||||
comctl32undoc.c \
|
||||
commctrl.c \
|
||||
desktop.c \
|
||||
edit.c \
|
||||
header.c \
|
||||
icontitle.c \
|
||||
listbox.c \
|
||||
listview.c \
|
||||
menu.c \
|
||||
pager.c \
|
||||
progress.c \
|
||||
rebar.c \
|
||||
scroll.c \
|
||||
static.c \
|
||||
status.c \
|
||||
toolbar.c \
|
||||
tooltips.c \
|
||||
trackbar.c \
|
||||
treeview.c \
|
||||
uitools.c \
|
||||
updown.c \
|
||||
widgets.c
|
||||
|
||||
all: $(MODULE).o
|
||||
|
|
|
@ -129,6 +129,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CBCalcPlacement
|
||||
*
|
||||
|
@ -142,22 +143,6 @@ static void CBCalcPlacement( LPHEADCOMBO lphc, LPRECT32 lprEdit,
|
|||
|
||||
/* get combo height and width */
|
||||
|
||||
if( lphc->editHeight )
|
||||
size.cy = lphc->editHeight;
|
||||
else
|
||||
{
|
||||
HDC32 hDC = GetDC32( lphc->self->hwndSelf );
|
||||
HFONT32 hPrevFont = 0;
|
||||
|
||||
if( lphc->hFont ) hPrevFont = SelectObject32( hDC, lphc->hFont );
|
||||
|
||||
GetTextExtentPoint32A( hDC, "0", 1, &size);
|
||||
|
||||
size.cy += size.cy / 4 + 4 * SYSMETRICS_CYBORDER;
|
||||
|
||||
if( hPrevFont ) SelectObject32( hDC, hPrevFont );
|
||||
ReleaseDC32( lphc->self->hwndSelf, hDC );
|
||||
}
|
||||
size.cx = rect.right - rect.left;
|
||||
|
||||
if( CB_OWNERDRAWN(lphc) )
|
||||
|
@ -181,6 +166,23 @@ static void CBCalcPlacement( LPHEADCOMBO lphc, LPRECT32 lprEdit,
|
|||
}
|
||||
size.cy = u;
|
||||
}
|
||||
else if( lphc->editHeight ) /* explicitly set height */
|
||||
size.cy = lphc->editHeight;
|
||||
else
|
||||
{
|
||||
HDC32 hDC = GetDC32( lphc->self->hwndSelf );
|
||||
HFONT32 hPrevFont = 0;
|
||||
|
||||
if( lphc->hFont ) hPrevFont = SelectObject32( hDC, lphc->hFont );
|
||||
|
||||
GetTextExtentPoint32A( hDC, "0", 1, &size);
|
||||
|
||||
size.cy += size.cy / 4 + 4 * SYSMETRICS_CYBORDER;
|
||||
|
||||
if( hPrevFont ) SelectObject32( hDC, hPrevFont );
|
||||
ReleaseDC32( lphc->self->hwndSelf, hDC );
|
||||
}
|
||||
|
||||
|
||||
/* calculate text and button placement */
|
||||
|
||||
|
@ -1419,10 +1421,17 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message,
|
|||
return SendMessage32A( lphc->hWndLBox, LB_FINDSTRINGEXACT32,
|
||||
wParam, lParam );
|
||||
case CB_SETITEMHEIGHT16:
|
||||
wParam = (INT32)(INT16)wParam;
|
||||
wParam = (INT32)(INT16)wParam; /* signed integer */
|
||||
case CB_SETITEMHEIGHT32:
|
||||
return COMBO_SetItemHeight( lphc, (INT32)wParam, (INT32)lParam);
|
||||
|
||||
case CB_GETITEMHEIGHT16:
|
||||
wParam = (INT32)(INT16)wParam;
|
||||
case CB_GETITEMHEIGHT32:
|
||||
if( (INT32)wParam >= 0 )
|
||||
return SendMessage32A( lphc->hWndLBox, LB_GETITEMHEIGHT32, wParam, 0);
|
||||
return (lphc->RectEdit.bottom - lphc->RectEdit.top);
|
||||
|
||||
case CB_RESETCONTENT16:
|
||||
case CB_RESETCONTENT32:
|
||||
SendMessage32A( lphc->hWndLBox, LB_RESETCONTENT32, 0, 0 );
|
||||
|
|
|
@ -1,586 +0,0 @@
|
|||
/*
|
||||
* Undocumented functions from COMCTL32.DLL
|
||||
*
|
||||
* Copyright 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
|
||||
* 1998 Juergen Schmied <j.schmied@metronet.de>
|
||||
* NOTES
|
||||
* All of these functions are UNDOCUMENTED!! And I mean UNDOCUMENTED!!!!
|
||||
* Do NOT rely on names or contents of undocumented structures and types!!!
|
||||
* These functions are used by EXPLORER.EXE, IEXPLORE.EXE and
|
||||
* COMCTL32.DLL (internally).
|
||||
*
|
||||
* TODO
|
||||
* - Fix DSA_InsertItem.
|
||||
* - Fix DSA_GetItem.
|
||||
* - Write documentation.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include "windows.h"
|
||||
#include "heap.h"
|
||||
#include "debug.h"
|
||||
|
||||
typedef struct _DPA_DATA
|
||||
{
|
||||
DWORD dwEntryCount;
|
||||
DWORD dwMaxCount;
|
||||
DWORD dwGrow;
|
||||
LPDWORD ptrs;
|
||||
} DPA_DATA, *LPDPA_DATA;
|
||||
|
||||
|
||||
DWORD WINAPI DPA_Create (DWORD);
|
||||
DWORD WINAPI DPA_GetPtr (DWORD, DWORD);
|
||||
DWORD WINAPI DPA_InsertPtr (DWORD, DWORD, DWORD);
|
||||
|
||||
|
||||
CRITICAL_SECTION cs_comctl_alloc;
|
||||
HANDLE32 hComctl32Heap=0;
|
||||
/**************************************************************************
|
||||
* Alloc [COMCTL32.71]
|
||||
*
|
||||
*/
|
||||
|
||||
LPVOID WINAPI COMCTL32_Alloc (DWORD dwParam)
|
||||
{ LPVOID lpPtr;
|
||||
|
||||
TRACE (commctrl, "(0x%08lx)\n", dwParam);
|
||||
|
||||
if (hComctl32Heap==0)
|
||||
{ EnterCriticalSection((void*)&cs_comctl_alloc);
|
||||
hComctl32Heap=HeapCreate(0,1,0x4000000);
|
||||
LeaveCriticalSection((void*)&cs_comctl_alloc);
|
||||
TRACE (commctrl, "Heap created: 0x%08x\n", hComctl32Heap);
|
||||
if (! hComctl32Heap)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// lpPtr = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, dwParam);
|
||||
lpPtr = HeapAlloc (hComctl32Heap, HEAP_ZERO_MEMORY, dwParam);
|
||||
TRACE (commctrl, "-- ret=%p\n", lpPtr);
|
||||
return lpPtr;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* ReAlloc [COMCTL32.72]
|
||||
*
|
||||
*/
|
||||
|
||||
LPVOID WINAPI
|
||||
COMCTL32_ReAlloc (LPVOID dwParam1, DWORD dwParam2)
|
||||
{
|
||||
LPVOID dwPtr;
|
||||
TRACE (commctrl, "(0x%08lx 0x%08lx)\n",(DWORD)dwParam1, dwParam2);
|
||||
|
||||
if (dwParam1 == 0)
|
||||
dwPtr = HeapAlloc (hComctl32Heap, HEAP_ZERO_MEMORY,
|
||||
dwParam2);
|
||||
else
|
||||
dwPtr = HeapReAlloc (hComctl32Heap, HEAP_ZERO_MEMORY,
|
||||
dwParam1, dwParam2);
|
||||
|
||||
TRACE (commctrl, "-- ret=0x%08lx\n", (DWORD)dwPtr);
|
||||
|
||||
return dwPtr;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Free [COMCTL32.73]
|
||||
*
|
||||
*/
|
||||
|
||||
DWORD WINAPI
|
||||
COMCTL32_Free (LPVOID dwParam)
|
||||
{
|
||||
TRACE (commctrl, "(0x%08lx)\n", (DWORD)dwParam);
|
||||
HeapFree (hComctl32Heap, 0, dwParam);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* GetSize [COMCTL32.74]
|
||||
*
|
||||
*/
|
||||
|
||||
DWORD WINAPI
|
||||
COMCTL32_GetSize (LPVOID dwParam)
|
||||
{
|
||||
TRACE (commctrl, "(0x%08lx)\n", (DWORD)dwParam);
|
||||
return (HeapSize (hComctl32Heap, 0, dwParam));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Str_SetPtrA [COMCTL32.234]
|
||||
*
|
||||
* PARAMS
|
||||
* dwParam1 [I]
|
||||
* dwParam2 [I]
|
||||
*/
|
||||
|
||||
BOOL32 WINAPI
|
||||
COMCTL32_Str_SetPtrA (LPSTR lpStr, LPVOID *lpPtr)
|
||||
{
|
||||
INT32 len;
|
||||
LPSTR ptr;
|
||||
|
||||
FIXME (commctrl, "(0x%08lx 0x%08lx)\n", (DWORD)lpStr, (DWORD)lpPtr);
|
||||
FIXME (commctrl, "(\"%s\" \"%s\")\n", lpStr, (LPSTR)*lpPtr);
|
||||
|
||||
if (lpStr) {
|
||||
len = lstrlen32A (lpStr);
|
||||
ptr = COMCTL32_ReAlloc (lpPtr, len + 1);
|
||||
if (!(ptr))
|
||||
return FALSE;
|
||||
lstrcpy32A (ptr, lpStr);
|
||||
*lpPtr = ptr;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (*lpPtr) {
|
||||
COMCTL32_Free (*lpPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* The DSA-API is a set of functions to create and manipulate arrays of
|
||||
* fix sized memory blocks. This arrays can store any kind of data (strings,
|
||||
* icons...) so the name "dynamic string array" is a bit misleading.
|
||||
*
|
||||
* STATUS
|
||||
* complete
|
||||
*/
|
||||
typedef struct _DSA_DATA
|
||||
{ DWORD dwEntryCount;
|
||||
BYTE * pData;
|
||||
DWORD dwMaxCount;
|
||||
DWORD dwElementSize;
|
||||
DWORD dwGrow;
|
||||
} DSA_DATA, *LPDSA_DATA;
|
||||
|
||||
/**************************************************************************
|
||||
* DSA_Create [COMCTL32.320] Creates a dynamic string array
|
||||
*
|
||||
* PARAMS
|
||||
* dwSize [I] size of the array elements
|
||||
* dwGrow [I]
|
||||
* RETURNS
|
||||
* pointer to a array control structure. use this like a handle.
|
||||
*/
|
||||
|
||||
LPDSA_DATA WINAPI DSA_Create (DWORD dwSize, DWORD dwGrow)
|
||||
{ LPDSA_DATA dsaPtr;
|
||||
|
||||
TRACE (commctrl, "(size=0x%08lx grow=0x%08lx)\n", dwSize, dwGrow);
|
||||
|
||||
if ((dsaPtr=(LPDSA_DATA)COMCTL32_Alloc(sizeof(DSA_DATA))));
|
||||
{ dsaPtr->dwEntryCount=0x00;
|
||||
dsaPtr->pData=NULL;
|
||||
dsaPtr->dwMaxCount=0x00;
|
||||
dsaPtr->dwElementSize=dwSize;
|
||||
if ( dwGrow == 0 )
|
||||
dsaPtr->dwGrow=1;
|
||||
else
|
||||
dsaPtr->dwGrow=dwGrow;
|
||||
return dsaPtr;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* DSA_Destroy [COMCTL32.321] Destroys a dynamic string array
|
||||
*
|
||||
* PARAMS
|
||||
* dsaPtr [I] pointer to the array control structure
|
||||
* RETURNS
|
||||
* TRUE if dsaPtr = NULL or success
|
||||
* FALSE if failure
|
||||
*/
|
||||
|
||||
BOOL32 WINAPI DSA_Destroy (const LPDSA_DATA dsaPtr )
|
||||
{ TRACE (commctrl, "(%p)\n", dsaPtr);
|
||||
|
||||
if (! dsaPtr)
|
||||
return FALSE;
|
||||
|
||||
if (dsaPtr->pData && (! COMCTL32_Free(dsaPtr->pData)))
|
||||
{ return FALSE;
|
||||
}
|
||||
return COMCTL32_Free (dsaPtr);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* DSA_GetItem [COMCTL32.322]
|
||||
*
|
||||
* PARAMS
|
||||
* dsaPtr [I] pointer to the array control structure
|
||||
* dwItem [I] number of the Item to get
|
||||
+ * pDest [O] destination buffer. Has to be >= dwElementSize.
|
||||
*/
|
||||
|
||||
BOOL32 WINAPI DSA_GetItem (const LPDSA_DATA dsaPtr, DWORD dwItem, LPBYTE pDest)
|
||||
{ BYTE * pSrc;
|
||||
|
||||
TRACE (commctrl, "(%p 0x%08lx %p)\n", dsaPtr, dwItem, pDest);
|
||||
|
||||
if ( (!dsaPtr) || (dwItem < 0) || (dwItem >= dsaPtr->dwEntryCount))
|
||||
return FALSE;
|
||||
|
||||
pSrc = dsaPtr->pData + (dsaPtr->dwElementSize * dwItem);
|
||||
memmove(pDest,pSrc,dsaPtr->dwElementSize);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* DSA_GetItemPtr [COMCTL32.323]
|
||||
*
|
||||
* PARAMS
|
||||
* dsaPtr [I] pointer to the array control structure
|
||||
* dwItem [I] number of the Item to get
|
||||
* RETURNS
|
||||
* pointer ti a item
|
||||
*/
|
||||
LPBYTE WINAPI DSA_GetItemPtr (const LPDSA_DATA dsaPtr, DWORD dwItem)
|
||||
{ BYTE * pSrc;
|
||||
|
||||
TRACE (commctrl, "(%p 0x%08lx)\n", dsaPtr, dwItem);
|
||||
|
||||
if ((!dsaPtr) || (dwItem < 0) || (dwItem >= dsaPtr->dwEntryCount))
|
||||
return FALSE;
|
||||
pSrc = dsaPtr->pData + (dsaPtr->dwElementSize * dwItem);
|
||||
|
||||
TRACE (commctrl, "-- ret=%p\n", pSrc);
|
||||
|
||||
return pSrc;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* DSA_SetItem [COMCTL32.325]
|
||||
*
|
||||
* PARAMS
|
||||
* dsaPtr [I] pointer to the array control structure
|
||||
* dwItem [I] index for the new element
|
||||
* pSrc [I] the element
|
||||
*/
|
||||
BOOL32 WINAPI DSA_SetItem (const LPDSA_DATA dsaPtr, DWORD dwItem, LPBYTE pSrc)
|
||||
{ LPBYTE pDest;
|
||||
DWORD dwSize, dwNewItems;
|
||||
LPBYTE lpTemp;
|
||||
|
||||
TRACE (commctrl, "(%p 0x%08lx %p)\n", dsaPtr, dwItem, pSrc);
|
||||
|
||||
if ((!dsaPtr) || dwItem<0 )
|
||||
return FALSE;
|
||||
|
||||
if (dsaPtr->dwEntryCount <= dwItem) /* within the old array */
|
||||
{ if ( dsaPtr->dwMaxCount > dwItem)
|
||||
{ dsaPtr->dwEntryCount = dwItem; /* within the allocated space, set a new boundary */
|
||||
}
|
||||
else
|
||||
{ /* resize the block of memory*/
|
||||
dwNewItems = dsaPtr->dwGrow * ( (WORD)((dwItem-1)/dsaPtr->dwGrow) +1);
|
||||
dwSize = dsaPtr->dwElementSize * dwNewItems;
|
||||
lpTemp = (LPBYTE) COMCTL32_ReAlloc(dsaPtr->pData,dwSize);
|
||||
if (! lpTemp )
|
||||
{ return FALSE;
|
||||
}
|
||||
dsaPtr->dwMaxCount = dwNewItems;
|
||||
dsaPtr->pData = lpTemp;
|
||||
}
|
||||
}
|
||||
/* put the new entry in */
|
||||
pDest = dsaPtr->pData + (dsaPtr->dwElementSize * dwItem);
|
||||
TRACE (commctrl,"move dest=%p src=%p size=%x",pDest,pSrc,dsaPtr->dwElementSize);
|
||||
memmove(pDest,pSrc,dsaPtr->dwElementSize);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* DSA_InsertItem [COMCTL32.325]
|
||||
*
|
||||
* PARAMS
|
||||
* dsaPtr [I] pointer to the array control structure
|
||||
* dwItem [I] index for the new element
|
||||
* pSrc [I] the element
|
||||
*
|
||||
* RETURNS
|
||||
* the position of the new element
|
||||
*/
|
||||
DWORD WINAPI DSA_InsertItem (const LPDSA_DATA dsaPtr, DWORD dwItem, LPBYTE pSrc)
|
||||
{ DWORD dwNewItems, dwSize,i;
|
||||
LPBYTE lpTemp, lpDest;
|
||||
LPDWORD p;
|
||||
|
||||
TRACE(commctrl, "(%p 0x%08lx %p)\n", dsaPtr, dwItem, pSrc);
|
||||
|
||||
if ( (!dsaPtr) || dwItem<0 )
|
||||
return -1;
|
||||
|
||||
for (i=0; i<dsaPtr->dwElementSize;i+=4)
|
||||
{ p = *(DWORD**)(pSrc+i);
|
||||
if ( IsBadStringPtr32A ((char*)p,256))
|
||||
{ TRACE(commctrl,"-- 0x%04lx=%p\n",i,(DWORD*)p);
|
||||
}
|
||||
else
|
||||
{ TRACE(commctrl,"-- 0x%04lx=%p [%s]\n",i,p,debugstr_a((char*)p));
|
||||
}
|
||||
}
|
||||
|
||||
if (dwItem > dsaPtr->dwEntryCount) /* when dwItem > dwEntryCount then append*/
|
||||
dwItem = dsaPtr->dwEntryCount+1;
|
||||
|
||||
if (dwItem >= dsaPtr->dwMaxCount) /* do we need to resize ? */
|
||||
{ dwNewItems = dsaPtr->dwMaxCount + dsaPtr->dwGrow;
|
||||
dwSize = dsaPtr->dwElementSize * dwNewItems;
|
||||
lpTemp = (LPBYTE)COMCTL32_ReAlloc(dsaPtr->pData,dwSize);
|
||||
if (!lpTemp)
|
||||
{ return -1;
|
||||
}
|
||||
dsaPtr->dwMaxCount = dwNewItems;
|
||||
dsaPtr->pData = lpTemp;
|
||||
}
|
||||
|
||||
if (dwItem < dsaPtr->dwEntryCount) /* do we need to move elements ?*/
|
||||
{ lpTemp = dsaPtr->pData + (dsaPtr->dwElementSize * dwItem);
|
||||
lpDest = lpTemp + dsaPtr->dwElementSize;
|
||||
TRACE (commctrl,"-- move dest=%p src=%p size=%x\n",lpDest,lpTemp,dsaPtr->dwElementSize);
|
||||
memmove (lpDest,lpTemp,dsaPtr->dwElementSize);
|
||||
}
|
||||
/* ok, we can put the new Item in*/
|
||||
dsaPtr->dwEntryCount++;
|
||||
lpDest = dsaPtr->pData + (dsaPtr->dwElementSize * dwItem);
|
||||
TRACE (commctrl,"-- move dest=%p src=%p size=%x\n",lpDest,pSrc,dsaPtr->dwElementSize);
|
||||
memmove (lpDest,pSrc,dsaPtr->dwElementSize);
|
||||
return dsaPtr->dwEntryCount;
|
||||
}
|
||||
/**************************************************************************
|
||||
* DSA_DeleteItem [COMCTL32.326]
|
||||
*
|
||||
* PARAMS
|
||||
* dsaPtr [I] pointer to the array control structure
|
||||
* dwItem [I] index for the element to delete
|
||||
* RETURNS
|
||||
* number of the element deleted
|
||||
*/
|
||||
DWORD WINAPI DSA_DeleteItem (const LPDSA_DATA dsaPtr, DWORD dwItem)
|
||||
{ LPBYTE lpDest,lpSrc;
|
||||
DWORD dwSize;
|
||||
|
||||
TRACE (commctrl, "(%p 0x%08lx)\n", dsaPtr, dwItem);
|
||||
|
||||
if ( (! dsaPtr) || dwItem<0 || dwItem>=dsaPtr->dwEntryCount)
|
||||
return FALSE;
|
||||
|
||||
if ( dwItem < dsaPtr->dwEntryCount-1 ) /* do we need to move ?*/
|
||||
{ lpDest = dsaPtr->pData + (dsaPtr->dwElementSize * dwItem);
|
||||
lpSrc = lpDest + dsaPtr->dwElementSize;
|
||||
dwSize = dsaPtr->dwElementSize * (dsaPtr->dwEntryCount-dwItem-1);
|
||||
TRACE (commctrl,"-- move dest=%p src=%p size=%x\n",lpDest,lpSrc,dwSize);
|
||||
memmove (lpDest,lpSrc,dwSize);
|
||||
}
|
||||
|
||||
dsaPtr->dwEntryCount--;
|
||||
|
||||
if ( (dsaPtr->dwMaxCount-dsaPtr->dwEntryCount) >= dsaPtr->dwGrow) /* free memory ?*/
|
||||
{ dwSize = dsaPtr->dwElementSize * dsaPtr->dwEntryCount;
|
||||
lpDest = (LPBYTE) COMCTL32_ReAlloc(dsaPtr->pData,dwSize);
|
||||
if (!lpDest)
|
||||
{ return FALSE;
|
||||
}
|
||||
dsaPtr->dwMaxCount = dsaPtr->dwEntryCount;
|
||||
dsaPtr->pData = lpDest;
|
||||
|
||||
}
|
||||
return dwItem;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* DSA_DeleteAllItems [COMCTL32.326]
|
||||
* deletes all elements and initializes array
|
||||
*
|
||||
* PARAMS
|
||||
* dsaPtr [I] pointer to the array control structure
|
||||
*
|
||||
* RETURNS
|
||||
* TRUE/FALSE
|
||||
*/
|
||||
BOOL32 WINAPI DSA_DeleteAllItems (const LPDSA_DATA dsaPtr)
|
||||
{ TRACE (commctrl, "(%p)\n", dsaPtr);
|
||||
|
||||
if (! dsaPtr)
|
||||
return FALSE;
|
||||
|
||||
if (dsaPtr->pData && (! COMCTL32_Free(dsaPtr->pData)))
|
||||
{ return FALSE;
|
||||
}
|
||||
dsaPtr->dwEntryCount=0x00;
|
||||
dsaPtr->pData=NULL;
|
||||
dsaPtr->dwMaxCount=0x00;
|
||||
return TRUE;
|
||||
}
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
DWORD WINAPI
|
||||
DPA_Create (DWORD dwParam1)
|
||||
{
|
||||
LPDPA_DATA dpaPtr;
|
||||
|
||||
TRACE (commctrl, "(0x%08lx)\n", dwParam1);
|
||||
|
||||
dpaPtr = (LPDPA_DATA)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, sizeof(DPA_DATA));
|
||||
dpaPtr->dwGrow = dwParam1;
|
||||
|
||||
TRACE (commctrl, "ret=0x%08lx\n", (DWORD)dpaPtr);
|
||||
|
||||
return (DWORD)dpaPtr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DWORD WINAPI
|
||||
DPA_GetPtr (DWORD dwParam1, DWORD dwParam2)
|
||||
{
|
||||
LPDPA_DATA dpaPtr = (LPDPA_DATA)dwParam1;
|
||||
|
||||
TRACE (commctrl, "(0x%08lx 0x%08lx)\n", dwParam1, dwParam2);
|
||||
|
||||
if (dpaPtr == NULL)
|
||||
return 0;
|
||||
if (dpaPtr->ptrs == NULL)
|
||||
return 0;
|
||||
if ((dwParam2 < 0) || (dwParam2 >= dpaPtr->dwEntryCount))
|
||||
return 0;
|
||||
|
||||
TRACE (commctrl, "ret=0x%08lx\n", (DWORD)dpaPtr->ptrs[dwParam2]);
|
||||
|
||||
return (DWORD)dpaPtr->ptrs[dwParam2];
|
||||
}
|
||||
|
||||
|
||||
|
||||
DWORD WINAPI
|
||||
DPA_InsertPtr (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
|
||||
{
|
||||
LPDPA_DATA dpaPtr = (LPDPA_DATA)dwParam1;
|
||||
DWORD dwIndex;
|
||||
|
||||
TRACE (commctrl, "(0x%08lx 0x%08lx 0x%lx)\n",
|
||||
dwParam1, dwParam2, dwParam3);
|
||||
|
||||
if (dpaPtr->ptrs == NULL) {
|
||||
dpaPtr->ptrs = (LPDWORD)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
|
||||
dpaPtr->dwGrow * sizeof(LPVOID));
|
||||
dpaPtr->dwMaxCount = dpaPtr->dwGrow;
|
||||
dwIndex = 0;
|
||||
dpaPtr->ptrs[dwIndex] = dwParam3;
|
||||
}
|
||||
else {
|
||||
FIXME (commctrl, "adding to existing array! stub!\n");
|
||||
|
||||
|
||||
dwIndex = dwParam2;
|
||||
}
|
||||
|
||||
dpaPtr->dwEntryCount++;
|
||||
|
||||
return (dwIndex);
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* DPA_CreateEx [COMCTL32.340]
|
||||
*
|
||||
*/
|
||||
|
||||
DWORD WINAPI
|
||||
DPA_CreateEx (DWORD dwParam1, DWORD dwParam2)
|
||||
{
|
||||
FIXME (commctrl, "(0x%08lx 0x%08lx)\n",
|
||||
dwParam1, dwParam2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* SendNotify [COMCTL32.341]
|
||||
*
|
||||
*/
|
||||
|
||||
DWORD WINAPI
|
||||
COMCTL32_SendNotify (DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4)
|
||||
{
|
||||
FIXME (commctrl, "(0x%08lx 0x%08lx 0x%08lx 0x%08lx)\n",
|
||||
dw1, dw2, dw3, dw4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* StrChrA [COMCTL32.350]
|
||||
*
|
||||
*/
|
||||
|
||||
LPSTR WINAPI
|
||||
COMCTL32_StrChrA (LPCSTR lpString, CHAR cChar)
|
||||
{
|
||||
return strchr (lpString, cChar);
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* StrStrIA [COMCTL32.355]
|
||||
*/
|
||||
|
||||
LPSTR WINAPI
|
||||
COMCTL32_StrStrIA (LPCSTR lpStr1, LPCSTR lpStr2)
|
||||
{
|
||||
INT32 len1, len2, i;
|
||||
CHAR first;
|
||||
|
||||
if (*lpStr2 == 0)
|
||||
return ((LPSTR)lpStr1);
|
||||
len1 = 0;
|
||||
while (lpStr1[len1] != 0) ++len1;
|
||||
len2 = 0;
|
||||
while (lpStr2[len2] != 0) ++len2;
|
||||
if (len2 == 0)
|
||||
return ((LPSTR)(lpStr1 + len1));
|
||||
first = tolower (*lpStr2);
|
||||
while (len1 >= len2) {
|
||||
if (tolower(*lpStr1) == first) {
|
||||
for (i = 1; i < len2; ++i)
|
||||
if (tolower (lpStr1[i]) != tolower(lpStr2[i]))
|
||||
break;
|
||||
if (i >= len2)
|
||||
return ((LPSTR)lpStr1);
|
||||
}
|
||||
++lpStr1; --len1;
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* StrToIntA [COMCTL32.357] Converts a string to a signed integer.
|
||||
*/
|
||||
|
||||
INT32 WINAPI
|
||||
COMCTL32_StrToIntA (LPSTR lpString)
|
||||
{
|
||||
return atoi(lpString);
|
||||
}
|
||||
|
|
@ -514,6 +514,7 @@ LRESULT WINAPI EditWndProc( HWND32 hwnd, UINT32 msg,
|
|||
case EM_REPLACESEL32:
|
||||
DPRINTF_EDIT_MSG32("EM_REPLACESEL");
|
||||
EDIT_EM_ReplaceSel(wnd, es, (BOOL32)wParam, (LPCSTR)lParam);
|
||||
result = 1;
|
||||
break;
|
||||
|
||||
/* message 0x00c3 missing from specs */
|
||||
|
|
|
@ -312,7 +312,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
|
|||
GetClientRect32( wnd->hwndSelf, &rect );
|
||||
descr->width = rect.right - rect.left;
|
||||
descr->height = rect.bottom - rect.top;
|
||||
if (!(descr->style & LBS_NOINTEGRALHEIGHT))
|
||||
if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !IS_OWNERDRAW(descr))
|
||||
{
|
||||
if ((descr->height > descr->item_height) &&
|
||||
(descr->height % descr->item_height))
|
||||
|
|
|
@ -1,244 +0,0 @@
|
|||
/*
|
||||
* Listview control
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*
|
||||
* NOTES
|
||||
* This is just a dummy control. An author is needed! Any volunteers?
|
||||
* I will only improve this control once in a while.
|
||||
* Eric <ekohl@abo.rhein-zeitung.de>
|
||||
*
|
||||
* TODO:
|
||||
* - All messages.
|
||||
* - All notifications.
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "listview.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#define LISTVIEW_GetInfoPtr(wndPtr) ((LISTVIEW_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
static VOID
|
||||
LISTVIEW_Refresh (WND *wndPtr, HDC32 hdc)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_SetBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
if (!(infoPtr)) return FALSE;
|
||||
|
||||
/* set background color */
|
||||
infoPtr->clrBk = (COLORREF)lParam;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
FIXME (listview, "(0x%08x 0x%08lx)\n", wParam, lParam);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
/* initialize info structure */
|
||||
infoPtr->clrBk = CLR_NONE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
if (infoPtr->clrBk == CLR_NONE) {
|
||||
return SendMessage32A (GetParent32 (wndPtr->hwndSelf),
|
||||
WM_ERASEBKGND, wParam, lParam);
|
||||
}
|
||||
else {
|
||||
RECT32 rect;
|
||||
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
FillRect32 ((HDC32)wParam, &rect, hBrush);
|
||||
DeleteObject32 (hBrush);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (LISTVIEW_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof(LISTVIEW_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
if (infoPtr == NULL) {
|
||||
ERR (listview, "could not allocate info memory!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((LISTVIEW_INFO*)wndPtr->wExtra[0] != infoPtr) {
|
||||
ERR (listview, "pointer assignment error!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_NCDestroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
|
||||
/* free list view info data */
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_Paint (WND *wndPtr, WPARAM32 wParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
PAINTSTRUCT32 ps;
|
||||
|
||||
hdc = wParam==0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
|
||||
LISTVIEW_Refresh (wndPtr, hdc);
|
||||
if (!wParam)
|
||||
EndPaint32 (wndPtr->hwndSelf, &ps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
ListviewWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
|
||||
case LVM_SETBKCOLOR:
|
||||
return LISTVIEW_SetBkColor (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
case LVM_SETIMAGELIST:
|
||||
return LISTVIEW_SetImageList (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
|
||||
|
||||
// case WM_CHAR:
|
||||
// case WM_COMMAND:
|
||||
|
||||
case WM_CREATE:
|
||||
return LISTVIEW_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return LISTVIEW_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return LISTVIEW_EraseBackground (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_GETDLGCODE:
|
||||
// case WM_GETFONT:
|
||||
// case WM_HSCROLL:
|
||||
|
||||
// case WM_MOUSEMOVE:
|
||||
// return LISTVIEW_MouseMove (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_NCCREATE:
|
||||
return LISTVIEW_NCCreate (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_NCDESTROY:
|
||||
return LISTVIEW_NCDestroy (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_NOTIFY:
|
||||
|
||||
case WM_PAINT:
|
||||
return LISTVIEW_Paint (wndPtr, wParam);
|
||||
|
||||
// case WM_RBUTTONDOWN:
|
||||
// case WM_SETFOCUS:
|
||||
// case WM_SETFONT:
|
||||
// case WM_SETREDRAW:
|
||||
// case WM_TIMER:
|
||||
// case WM_VSCROLL:
|
||||
// case WM_WINDOWPOSCHANGED:
|
||||
// case WM_WININICHANGE:
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (listview, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LISTVIEW_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (WC_LISTVIEW32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)ListviewWindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(LISTVIEW_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
|
||||
wndClass.lpszClassName = WC_LISTVIEW32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
||||
|
|
@ -760,7 +760,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect,
|
|||
|
||||
if ((lprect == NULL) || (lppop == NULL)) return;
|
||||
if (lppop->nItems == 0) return;
|
||||
TRACE(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n",
|
||||
TRACE(menu,"left=%d top=%d right=%d bottom=%d\n",
|
||||
lprect->left, lprect->top, lprect->right, lprect->bottom);
|
||||
lppop->Width = lprect->right - lprect->left;
|
||||
lppop->Height = 0;
|
||||
|
@ -1102,7 +1102,7 @@ static void MENU_DrawPopupMenu( HWND32 hwnd, HDC32 hdc, HMENU32 hmenu )
|
|||
SetROP232( hdc, ropPrev );
|
||||
}
|
||||
else
|
||||
TWEAK_DrawReliefRect95(hdc, &rect);
|
||||
DrawEdge32 (hdc, &rect, EDGE_RAISED, BF_RECT);
|
||||
|
||||
/* draw menu items */
|
||||
|
||||
|
@ -2968,6 +2968,7 @@ UINT32 WINAPI GetMenuItemID32( HMENU32 hMenu, INT32 nPos )
|
|||
|
||||
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return -1;
|
||||
if ((nPos < 0) || (nPos >= menu->nItems)) return -1;
|
||||
if (menu->items[nPos].fType & MF_POPUP) return -1;
|
||||
return menu->items[nPos].wID;
|
||||
}
|
||||
|
||||
|
@ -3814,8 +3815,21 @@ static BOOL32 SetMenuItemInfo32_common(MENUITEM * menu,
|
|||
if (lpmii->fMask & MIIM_ID)
|
||||
menu->wID = lpmii->wID;
|
||||
|
||||
if (lpmii->fMask & MIIM_SUBMENU)
|
||||
if (lpmii->fMask & MIIM_SUBMENU) {
|
||||
menu->hSubMenu = lpmii->hSubMenu;
|
||||
if (menu->hSubMenu) {
|
||||
POPUPMENU *subMenu = (POPUPMENU *)USER_HEAP_LIN_ADDR((UINT16)menu->hSubMenu);
|
||||
if (IS_A_MENU(subMenu)) {
|
||||
subMenu->wFlags |= MF_POPUP;
|
||||
menu->fType |= MF_POPUP;
|
||||
}
|
||||
else
|
||||
/* FIXME: Return an error ? */
|
||||
menu->fType &= ~MF_POPUP;
|
||||
}
|
||||
else
|
||||
menu->fType &= ~MF_POPUP;
|
||||
}
|
||||
|
||||
if (lpmii->fMask & MIIM_CHECKMARKS)
|
||||
{
|
||||
|
|
|
@ -271,7 +271,6 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
|
|||
case WM_GETDLGCODE:
|
||||
return DLGC_STATIC;
|
||||
|
||||
return infoPtr->hIcon;
|
||||
case STM_GETIMAGE:
|
||||
case STM_GETICON16:
|
||||
case STM_GETICON32:
|
||||
|
@ -283,6 +282,7 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
|
|||
InvalidateRect32( hWnd, NULL, FALSE );
|
||||
UpdateWindow32( hWnd );
|
||||
break;
|
||||
|
||||
case STM_SETICON16:
|
||||
case STM_SETICON32:
|
||||
lResult = STATIC_SetIcon( wndPtr, (HICON16)wParam );
|
||||
|
|
|
@ -1,437 +0,0 @@
|
|||
/*
|
||||
* Trackbar control
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*
|
||||
* NOTES
|
||||
* This is just a dummy control. An author is needed! Any volunteers?
|
||||
* I will only improve this control once in a while.
|
||||
* Eric <ekohl@abo.rhein-zeitung.de>
|
||||
*
|
||||
* TODO:
|
||||
* - All messages.
|
||||
* - All notifications.
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "trackbar.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#define TRACKBAR_GetInfoPtr(wndPtr) ((TRACKBAR_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
static VOID
|
||||
TRACKBAR_Refresh (WND *wndPtr, HDC32 hdc)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
RECT32 rect;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
|
||||
/* draw channel */
|
||||
DrawEdge32 (hdc, &infoPtr->rcChannel, EDGE_SUNKEN, BF_RECT);
|
||||
|
||||
/* draw thumb */
|
||||
if (!(wndPtr->dwStyle & TBS_NOTHUMB)) {
|
||||
|
||||
}
|
||||
|
||||
/* draw ticks */
|
||||
if (!(wndPtr->dwStyle & TBS_NOTICKS)) {
|
||||
|
||||
}
|
||||
|
||||
if (infoPtr->bFocus)
|
||||
DrawFocusRect32 (hdc, &rect);
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_ClearSel (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->nSelMin = 0;
|
||||
infoPtr->nSelMax = 0;
|
||||
|
||||
if ((BOOL32)wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// << TRACKBAR_ClearTics >>
|
||||
// << TRACKBAR_GetChannelRect >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetLineSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nLineSize;
|
||||
}
|
||||
|
||||
|
||||
// << TRACKBAR_GetNumTics >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetPageSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nPageSize;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nPos;
|
||||
}
|
||||
|
||||
|
||||
// << TRACKBAR_GetPTics >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetRangeMax (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nRangeMax;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetRangeMin (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nRangeMin;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetSelEnd (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nSelMax;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetSelStart (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nSelMin;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetThumbLength (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nThumbLen;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr;
|
||||
|
||||
infoPtr = (TRACKBAR_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof(TRACKBAR_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
|
||||
/* default values */
|
||||
infoPtr->nRangeMin = 0;
|
||||
infoPtr->nRangeMax = 100;
|
||||
infoPtr->nLineSize = 1;
|
||||
infoPtr->nPageSize = 20;
|
||||
infoPtr->nSelMin = 0;
|
||||
infoPtr->nSelMax = 0;
|
||||
infoPtr->nPos = 0;
|
||||
infoPtr->nThumbLen = 23; /* initial thumb length */
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_KillFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
HDC32 hdc;
|
||||
|
||||
infoPtr->bFocus = FALSE;
|
||||
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
SetFocus32 (wndPtr->hwndSelf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Paint (WND *wndPtr, WPARAM32 wParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
PAINTSTRUCT32 ps;
|
||||
|
||||
hdc = wParam==0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
if(!wParam)
|
||||
EndPaint32 (wndPtr->hwndSelf, &ps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
HDC32 hdc;
|
||||
|
||||
infoPtr->bFocus = TRUE;
|
||||
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
RECT32 rect;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
|
||||
/* calculate channel rect */
|
||||
if (wndPtr->dwStyle & TBS_VERT) {
|
||||
infoPtr->rcChannel.top = rect.top + 8;
|
||||
infoPtr->rcChannel.bottom = rect.bottom - 8;
|
||||
|
||||
/* FIXME */
|
||||
infoPtr->rcChannel.left = rect.left + 10;
|
||||
infoPtr->rcChannel.right = rect.left + 14;
|
||||
|
||||
}
|
||||
else {
|
||||
infoPtr->rcChannel.left = rect.left + 8;
|
||||
infoPtr->rcChannel.right = rect.right - 8;
|
||||
|
||||
/* FIXME */
|
||||
if (wndPtr->dwStyle & TBS_BOTH) {
|
||||
infoPtr->rcChannel.top = rect.bottom / 2 - 2;
|
||||
infoPtr->rcChannel.bottom = rect.bottom / 2 + 2;
|
||||
|
||||
}
|
||||
else if (wndPtr->dwStyle & TBS_TOP) {
|
||||
infoPtr->rcChannel.top = rect.top + 10;
|
||||
infoPtr->rcChannel.bottom = rect.top + 14;
|
||||
|
||||
}
|
||||
else {
|
||||
/* TBS_BOTTOM */
|
||||
infoPtr->rcChannel.top = rect.bottom - 14;
|
||||
infoPtr->rcChannel.bottom = rect.bottom - 10;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// << TRACKBAR_Timer >>
|
||||
// << TRACKBAR_WinIniChange >>
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
TrackbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case TBM_CLEARSEL:
|
||||
return TRACKBAR_ClearSel (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_CLEARTICS:
|
||||
// case TBM_GETBUDDY:
|
||||
// case TBM_GETCHANNELRECT:
|
||||
|
||||
case TBM_GETLINESIZE:
|
||||
return TRACKBAR_GetLineSize (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_GETNUMTICS:
|
||||
|
||||
case TBM_GETPAGESIZE:
|
||||
return TRACKBAR_GetPageSize (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETPOS:
|
||||
return TRACKBAR_GetPos (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_GETPTICS:
|
||||
|
||||
case TBM_GETRANGEMAX:
|
||||
return TRACKBAR_GetRangeMax (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETRANGEMIN:
|
||||
return TRACKBAR_GetRangeMin (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETSELEND:
|
||||
return TRACKBAR_GetSelEnd (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETSELSTART:
|
||||
return TRACKBAR_GetSelStart (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETTHUMBLENGTH:
|
||||
return TRACKBAR_GetThumbLength (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_GETTHUMBRECT:
|
||||
// case TBM_GETTIC:
|
||||
// case TBM_GETTICPOS:
|
||||
// case TBM_GETTOOLTIPS:
|
||||
// case TBM_GETUNICODEFORMAT:
|
||||
// case TBM_SETBUDDY:
|
||||
// case TBM_SETPAGESIZE:
|
||||
// case TBM_SETPOS:
|
||||
// case TBM_SETRANGE:
|
||||
// case TBM_SETRANGEMAX:
|
||||
// case TBM_SETRANGEMIN:
|
||||
// case TBM_SETSEL:
|
||||
// case TBM_SETSELEND:
|
||||
// case TBM_SETSELSTART:
|
||||
// case TBM_SETTHUMBLENGTH:
|
||||
// case TBM_SETTIC:
|
||||
// case TBM_SETTICFREQ:
|
||||
// case TBM_SETTIPSIDE:
|
||||
// case TBM_SETTOOLTIPS:
|
||||
// case TBM_SETUNICODEFORMAT:
|
||||
|
||||
|
||||
// case WM_CAPTURECHANGED:
|
||||
|
||||
case WM_CREATE:
|
||||
return TRACKBAR_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return TRACKBAR_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_ENABLE:
|
||||
|
||||
// case WM_ERASEBKGND:
|
||||
// return 0;
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return DLGC_WANTARROWS;
|
||||
|
||||
// case WM_KEYDOWN:
|
||||
|
||||
// case WM_KEYUP:
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
return TRACKBAR_KillFocus (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
return TRACKBAR_LButtonDown (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_LBUTTONUP:
|
||||
|
||||
// case WM_MOUSEMOVE:
|
||||
// return TRACKBAR_MouseMove (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_PAINT:
|
||||
return TRACKBAR_Paint (wndPtr, wParam);
|
||||
|
||||
case WM_SETFOCUS:
|
||||
return TRACKBAR_SetFocus (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_SIZE:
|
||||
return TRACKBAR_Size (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_TIMER:
|
||||
|
||||
// case WM_WININICHANGE:
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (trackbar, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TRACKBAR_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (TRACKBAR_CLASS32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)TrackbarWindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(TRACKBAR_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = (HBRUSH32)(COLOR_3DFACE + 1);
|
||||
wndClass.lpszClassName = TRACKBAR_CLASS32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
||||
|
|
@ -7,7 +7,6 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "win.h"
|
||||
#include "commctrl.h"
|
||||
#include "button.h"
|
||||
#include "static.h"
|
||||
#include "scroll.h"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
SUBDIRS = \
|
||||
comctl32 \
|
||||
shell32
|
||||
|
||||
all: $(SUBDIRS)
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
DEFS = @DLLFLAGS@ -D__WINE__
|
||||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = comctl32
|
||||
|
||||
C_SRCS = \
|
||||
animate.c \
|
||||
comboex.c \
|
||||
comctl32undoc.c \
|
||||
commctrl.c \
|
||||
header.c \
|
||||
hotkey.c \
|
||||
imagelist.c \
|
||||
listview.c \
|
||||
pager.c \
|
||||
progress.c \
|
||||
rebar.c \
|
||||
status.c \
|
||||
tab.c \
|
||||
toolbar.c \
|
||||
tooltips.c \
|
||||
trackbar.c \
|
||||
treeview.c \
|
||||
updown.c
|
||||
|
||||
all: $(MODULE).o
|
||||
|
||||
@MAKE_RULES@
|
||||
|
||||
### Dependencies:
|
|
@ -0,0 +1,225 @@
|
|||
/*
|
||||
* Animation control
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*
|
||||
* NOTES
|
||||
* This is just a dummy control. An author is needed! Any volunteers?
|
||||
* I will only improve this control once in a while.
|
||||
* Eric <ekohl@abo.rhein-zeitung.de>
|
||||
*
|
||||
* TODO:
|
||||
* - All messages.
|
||||
* - All notifications.
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "animate.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#define ANIMATE_GetInfoPtr(wndPtr) ((ANIMATE_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
static LRESULT
|
||||
ANIMATE_Open32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
|
||||
|
||||
if (!lParam) {
|
||||
|
||||
FIXME (animate, "close avi: empty stub!\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (HIWORD(lParam)) {
|
||||
|
||||
FIXME (animate, "(\"%s\") empty stub!\n", (LPSTR)lParam);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
FIXME (animate, "(%u) empty stub!\n", (WORD)LOWORD(lParam));
|
||||
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
ANIMATE_Play (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
|
||||
INT32 nFrom = (INT32)LOWORD(lParam);
|
||||
INT32 nTo = (INT32)HIWORD(lParam);
|
||||
INT32 nRepeat = (INT32)wParam;
|
||||
|
||||
#if 0
|
||||
/* nothing opened */
|
||||
if (...)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
if (nRepeat == -1) {
|
||||
|
||||
FIXME (animate, "(loop from=%d to=%d) empty stub!\n",
|
||||
nFrom, nTo);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
FIXME (animate, "(repeat=%d from=%d to=%d) empty stub!\n",
|
||||
nRepeat, nFrom, nTo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
ANIMATE_Stop (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
|
||||
|
||||
#if 0
|
||||
/* nothing opened */
|
||||
if (...)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
ANIMATE_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
ANIMATE_INFO *infoPtr;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (ANIMATE_INFO *)COMCTL32_Alloc (sizeof(ANIMATE_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
if (infoPtr == NULL) {
|
||||
ERR (animate, "could not allocate info memory!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((ANIMATE_INFO*)wndPtr->wExtra[0] != infoPtr) {
|
||||
ERR (animate, "pointer assignment error!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* set default settings */
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
ANIMATE_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
|
||||
/* free animate info data */
|
||||
COMCTL32_Free (infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static LRESULT
|
||||
ANIMATE_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
|
||||
/*
|
||||
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
|
||||
RECT32 rect;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
FillRect32 ((HDC32)wParam, &rect, hBrush);
|
||||
DeleteObject32 (hBrush);
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
ANIMATE_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case ACM_OPEN32A:
|
||||
return ANIMATE_Open32A (wndPtr, wParam, lParam);
|
||||
|
||||
// case ACM_OPEN32W:
|
||||
// return ANIMATE_Open32W (wndPtr, wParam, lParam);
|
||||
|
||||
case ACM_PLAY:
|
||||
return ANIMATE_Play (wndPtr, wParam, lParam);
|
||||
|
||||
case ACM_STOP:
|
||||
return ANIMATE_Stop (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
case WM_CREATE:
|
||||
return ANIMATE_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return ANIMATE_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_ERASEBKGND:
|
||||
// return ANIMATE_EraseBackground (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_NCCREATE:
|
||||
// case WM_NCHITTEST:
|
||||
// case WM_PAINT:
|
||||
// case WM_SIZE:
|
||||
// case WM_STYLECHANGED:
|
||||
// case WM_TIMER:
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (animate, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ANIMATE_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (ANIMATE_CLASS32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)ANIMATE_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(ANIMATE_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = (HBRUSH32)(COLOR_BTNFACE + 1);
|
||||
wndClass.lpszClassName = ANIMATE_CLASS32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
|
@ -0,0 +1,283 @@
|
|||
/*
|
||||
* ComboBoxEx control
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*
|
||||
* NOTES
|
||||
* This is just a dummy control. An author is needed! Any volunteers?
|
||||
* I will only improve this control once in a while.
|
||||
* Eric <ekohl@abo.rhein-zeitung.de>
|
||||
*
|
||||
* TODO:
|
||||
* - All messages.
|
||||
* - All notifications.
|
||||
*
|
||||
* FIXME:
|
||||
* - should include "combo.h"
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "comboex.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define ID_CB_EDIT 1001
|
||||
|
||||
#define COMBOEX_GetInfoPtr(wndPtr) ((COMBOEX_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
// << COMBOEX_DeleteItem >>
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
COMBOEX_GetComboControl (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
|
||||
TRACE (comboex, "\n");
|
||||
|
||||
return (LRESULT)infoPtr->hwndCombo;
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
COMBOEX_GetEditControl (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
|
||||
if ((wndPtr->dwStyle & CBS_DROPDOWNLIST) != CBS_DROPDOWN)
|
||||
return 0;
|
||||
|
||||
FIXME (comboex, "-- 0x%x\n", GetDlgItem32 (infoPtr->hwndCombo, ID_CB_EDIT));
|
||||
|
||||
return (LRESULT)GetDlgItem32 (infoPtr->hwndCombo, ID_CB_EDIT);
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
COMBOEX_GetExtendedStyle (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
|
||||
return (LRESULT)infoPtr->dwExtStyle;
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
COMBOEX_GetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
|
||||
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
|
||||
|
||||
return (LRESULT)infoPtr->himl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
COMBOEX_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
|
||||
FIXME (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
COMBOEX_SetExtendedStyle (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
DWORD dwTemp;
|
||||
|
||||
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
|
||||
|
||||
dwTemp = infoPtr->dwExtStyle;
|
||||
|
||||
if ((DWORD)wParam) {
|
||||
infoPtr->dwExtStyle = (infoPtr->dwExtStyle & ~(DWORD)wParam) | (DWORD)lParam;
|
||||
}
|
||||
else
|
||||
infoPtr->dwExtStyle = (DWORD)lParam;
|
||||
|
||||
/* FIXME: repaint?? */
|
||||
|
||||
return (LRESULT)dwTemp;
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
COMBOEX_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
HIMAGELIST himlTemp;
|
||||
|
||||
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
|
||||
|
||||
himlTemp = infoPtr->himl;
|
||||
infoPtr->himl = (HIMAGELIST)lParam;
|
||||
|
||||
return (LRESULT)himlTemp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
COMBOEX_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr;
|
||||
DWORD dwComboStyle;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (COMBOEX_INFO *)COMCTL32_Alloc (sizeof(COMBOEX_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
if (infoPtr == NULL) {
|
||||
ERR (listview, "could not allocate info memory!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((COMBOEX_INFO*)wndPtr->wExtra[0] != infoPtr) {
|
||||
ERR (listview, "pointer assignment error!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* initialize info structure */
|
||||
|
||||
|
||||
/* create combo box */
|
||||
dwComboStyle =
|
||||
wndPtr->dwStyle & (CBS_SIMPLE|CBS_DROPDOWN|CBS_DROPDOWNLIST|WS_CHILD);
|
||||
|
||||
infoPtr->hwndCombo =
|
||||
CreateWindow32A ("ComboBox", "",
|
||||
WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED | dwComboStyle,
|
||||
0, 0, 0, 0, wndPtr->hwndSelf, (HMENU32)1,
|
||||
wndPtr->hInstance, NULL);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
COMBOEX_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
if (infoPtr->hwndCombo)
|
||||
DestroyWindow32 (infoPtr->hwndCombo);
|
||||
|
||||
|
||||
|
||||
|
||||
/* free comboex info data */
|
||||
COMCTL32_Free (infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
COMBOEX_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
|
||||
RECT32 rect;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
|
||||
MoveWindow32 (infoPtr->hwndCombo, 0, 0, rect.right -rect.left,
|
||||
rect.bottom - rect.top, TRUE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
COMBOEX_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
// case CBEM_DELETEITEM:
|
||||
|
||||
case CBEM_GETCOMBOCONTROL:
|
||||
return COMBOEX_GetComboControl (wndPtr, wParam, lParam);
|
||||
|
||||
case CBEM_GETEDITCONTROL:
|
||||
return COMBOEX_GetEditControl (wndPtr, wParam, lParam);
|
||||
|
||||
case CBEM_GETEXTENDEDSTYLE:
|
||||
return COMBOEX_GetExtendedStyle (wndPtr, wParam, lParam);
|
||||
|
||||
case CBEM_GETIMAGELIST:
|
||||
return COMBOEX_GetImageList (wndPtr, wParam, lParam);
|
||||
|
||||
// case CBEM_GETITEM32A:
|
||||
// case CBEM_GETITEM32W:
|
||||
// case CBEM_GETUNICODEFORMAT:
|
||||
// case CBEM_HASEDITCHANGED:
|
||||
|
||||
case CBEM_INSERTITEM32A:
|
||||
return COMBOEX_InsertItem32A (wndPtr, wParam, lParam);
|
||||
|
||||
// case CBEM_INSERTITEM32W:
|
||||
|
||||
case CBEM_SETEXTENDEDSTYLE:
|
||||
return COMBOEX_SetExtendedStyle (wndPtr, wParam, lParam);
|
||||
|
||||
case CBEM_SETIMAGELIST:
|
||||
return COMBOEX_SetImageList (wndPtr, wParam, lParam);
|
||||
|
||||
// case CBEM_SETITEM32A:
|
||||
// case CBEM_SETITEM32W:
|
||||
// case CBEM_SETUNICODEFORMAT:
|
||||
|
||||
|
||||
case WM_CREATE:
|
||||
return COMBOEX_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return COMBOEX_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_SIZE:
|
||||
return COMBOEX_Size (wndPtr, wParam, lParam);
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (comboex, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
COMBOEX_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (WC_COMBOBOXEX32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)COMBOEX_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(COMBOEX_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
|
||||
wndClass.lpszClassName = WC_COMBOBOXEX32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -9,18 +9,23 @@
|
|||
#include "win.h"
|
||||
#include "heap.h"
|
||||
#include "commctrl.h"
|
||||
#include "animate.h"
|
||||
#include "comboex.h"
|
||||
#include "header.h"
|
||||
#include "hotkey.h"
|
||||
#include "listview.h"
|
||||
#include "pager.h"
|
||||
#include "progress.h"
|
||||
#include "rebar.h"
|
||||
#include "status.h"
|
||||
#include "tab.h"
|
||||
#include "toolbar.h"
|
||||
#include "tooltips.h"
|
||||
#include "trackbar.h"
|
||||
#include "treeview.h"
|
||||
#include "updown.h"
|
||||
#include "debug.h"
|
||||
#include "winerror.h"
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -40,13 +45,13 @@ ComCtl32LibMain (HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
TRACE (commctrl, "No animation class implemented!\n");
|
||||
ANIMATE_Register ();
|
||||
HEADER_Register ();
|
||||
TRACE (commctrl, "No hotkey class implemented!\n");
|
||||
HOTKEY_Register ();
|
||||
LISTVIEW_Register ();
|
||||
PROGRESS_Register ();
|
||||
STATUS_Register ();
|
||||
TRACE (commctrl, "No tab class implemented!\n");
|
||||
TAB_Register ();
|
||||
TOOLBAR_Register ();
|
||||
TOOLTIPS_Register ();
|
||||
TRACKBAR_Register ();
|
||||
|
@ -59,6 +64,176 @@ ComCtl32LibMain (HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MenuHelp [COMCTL32.2]
|
||||
*
|
||||
* PARAMS
|
||||
* uMsg
|
||||
* wParam
|
||||
* lParam
|
||||
* hMainMenu
|
||||
* hInst
|
||||
* hwndStatus
|
||||
* lpwIDs
|
||||
*
|
||||
* RETURNS
|
||||
* None
|
||||
*
|
||||
* NOTES
|
||||
* Some features are still missing because of incomplete WM_MENUSELECT
|
||||
* messages (16->32 bit conversion).
|
||||
*/
|
||||
|
||||
VOID WINAPI
|
||||
MenuHelp (UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, HMENU32 hMainMenu,
|
||||
HINSTANCE32 hInst, HWND32 hwndStatus, LPUINT32 lpwIDs)
|
||||
{
|
||||
char szStatusText[128];
|
||||
|
||||
if (!IsWindow32 (hwndStatus)) return;
|
||||
|
||||
switch (uMsg) {
|
||||
case WM_MENUSELECT:
|
||||
TRACE (commctrl, "WM_MENUSELECT wParam=0x%X lParam=0x%lX\n",
|
||||
wParam, lParam);
|
||||
|
||||
if ((HIWORD(wParam) == 0xFFFF) && (lParam == 0)) {
|
||||
/* menu was closed */
|
||||
SendMessage32A (hwndStatus, SB_SIMPLE, FALSE, 0);
|
||||
}
|
||||
else {
|
||||
if (HIWORD(wParam) & MF_POPUP) {
|
||||
FIXME (commctrl, "popup 0x%08x 0x%08lx\n", wParam, lParam);
|
||||
|
||||
szStatusText[0] = 0;
|
||||
}
|
||||
else {
|
||||
TRACE (commctrl, "menu item selected!\n");
|
||||
if (!LoadString32A (hInst, LOWORD(wParam), szStatusText, 128))
|
||||
szStatusText[0] = 0;
|
||||
}
|
||||
SendMessage32A (hwndStatus, SB_SETTEXT32A, 255 | SBT_NOBORDERS,
|
||||
(LPARAM)szStatusText);
|
||||
SendMessage32A (hwndStatus, SB_SIMPLE, TRUE, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
WARN (commctrl, "Invalid Message!\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ShowHideMenuCtl [COMCTL32.3]
|
||||
*
|
||||
* Shows or hides controls and updates the corresponding menu item.
|
||||
*
|
||||
* PARAMS
|
||||
* hwnd [I] handle to the client window.
|
||||
* uFlags [I] menu command id.
|
||||
* lpInfo [I] pointer to an array of integers. (See NOTES.)
|
||||
*
|
||||
* RETURNS
|
||||
* Success: TRUE
|
||||
* Failure: FALSE
|
||||
*
|
||||
* NOTES
|
||||
* The official documentation is incomplete! This has been fixed.
|
||||
*
|
||||
* lpInfo
|
||||
* The array of integers contains pairs of values. BOTH values of
|
||||
* the first pair must be the handles to application's main menu.
|
||||
* Each subsequent pair consists of a menu id and control id.
|
||||
*/
|
||||
|
||||
BOOL32 WINAPI
|
||||
ShowHideMenuCtl (HWND32 hwnd, UINT32 uFlags, LPINT32 lpInfo)
|
||||
{
|
||||
LPINT32 lpMenuId;
|
||||
|
||||
TRACE (commctrl, "%x, %x, %p\n", hwnd, uFlags, lpInfo);
|
||||
|
||||
if (lpInfo == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!(lpInfo[0]) || !(lpInfo[1]))
|
||||
return FALSE;
|
||||
|
||||
/* search for control */
|
||||
lpMenuId = &lpInfo[2];
|
||||
while (*lpMenuId != uFlags)
|
||||
lpMenuId += 2;
|
||||
|
||||
if (GetMenuState32 (lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) {
|
||||
/* uncheck menu item */
|
||||
CheckMenuItem32 (lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
|
||||
/* hide control */
|
||||
lpMenuId++;
|
||||
SetWindowPos32 (GetDlgItem32 (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
|
||||
SWP_HIDEWINDOW);
|
||||
}
|
||||
else {
|
||||
/* check menu item */
|
||||
CheckMenuItem32 (lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED);
|
||||
|
||||
/* show control */
|
||||
lpMenuId++;
|
||||
SetWindowPos32 (GetDlgItem32 (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
|
||||
SWP_SHOWWINDOW);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* 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
|
||||
*
|
||||
* RETURNS
|
||||
* None.
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
*/
|
||||
|
||||
VOID WINAPI
|
||||
GetEffectiveClientRect (HWND32 hwnd, LPRECT32 lpRect, LPINT32 lpInfo)
|
||||
{
|
||||
RECT32 rcCtrl;
|
||||
INT32 *lpRun;
|
||||
HWND32 hwndCtrl;
|
||||
|
||||
TRACE (commctrl, "(0x%08lx 0x%08lx 0x%08lx)\n",
|
||||
(DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo);
|
||||
|
||||
GetClientRect32 (hwnd, lpRect);
|
||||
lpRun = lpInfo;
|
||||
|
||||
do {
|
||||
lpRun += 2;
|
||||
if (*lpRun == 0)
|
||||
return;
|
||||
lpRun++;
|
||||
hwndCtrl = GetDlgItem32 (hwnd, *lpRun);
|
||||
if (GetWindowLong32A (hwndCtrl, GWL_STYLE) & WS_VISIBLE) {
|
||||
TRACE (commctrl, "control id 0x%x\n", *lpRun);
|
||||
GetWindowRect32 (hwndCtrl, &rcCtrl);
|
||||
MapWindowPoints32 ((HWND32)0, hwnd, (LPPOINT32)&rcCtrl, 2);
|
||||
SubtractRect32 (lpRect, lpRect, &rcCtrl);
|
||||
}
|
||||
lpRun++;
|
||||
} while (*lpRun);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* DrawStatusText32A [COMCTL32.5][COMCTL32.27]
|
||||
*
|
||||
|
@ -111,17 +286,17 @@ DrawStatusText32A (HDC32 hdc, LPRECT32 lprc, LPCSTR text, UINT32 style)
|
|||
VOID WINAPI
|
||||
DrawStatusText32W (HDC32 hdc, LPRECT32 lprc, LPCWSTR text, UINT32 style)
|
||||
{
|
||||
LPSTR p = HEAP_strdupWtoA( GetProcessHeap(), 0, text );
|
||||
DrawStatusText32A(hdc, lprc, p, style);
|
||||
HeapFree( GetProcessHeap(), 0, p );
|
||||
LPSTR p = HEAP_strdupWtoA (GetProcessHeap (), 0, text);
|
||||
DrawStatusText32A (hdc, lprc, p, style);
|
||||
HeapFree (GetProcessHeap (), 0, p );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CreateStatusWindow32A [COMCTL32.6][COMCTL32.21]
|
||||
*/
|
||||
HWND32 WINAPI CreateStatusWindow32A( INT32 style, LPCSTR text, HWND32 parent,
|
||||
UINT32 wid )
|
||||
HWND32 WINAPI
|
||||
CreateStatusWindow32A (INT32 style, LPCSTR text, HWND32 parent, UINT32 wid)
|
||||
{
|
||||
return CreateWindow32A(STATUSCLASSNAME32A, text, style,
|
||||
CW_USEDEFAULT32, CW_USEDEFAULT32,
|
||||
|
@ -145,20 +320,21 @@ HWND32 WINAPI CreateStatusWindow32W( INT32 style, LPCWSTR text, HWND32 parent,
|
|||
/***********************************************************************
|
||||
* CreateUpDownControl (COMCTL32.16)
|
||||
*/
|
||||
HWND32 WINAPI CreateUpDownControl( DWORD style, INT32 x, INT32 y,
|
||||
INT32 cx, INT32 cy, HWND32 parent,
|
||||
INT32 id, HINSTANCE32 inst, HWND32 buddy,
|
||||
INT32 maxVal, INT32 minVal, INT32 curVal )
|
||||
HWND32 WINAPI
|
||||
CreateUpDownControl (DWORD style, INT32 x, INT32 y, INT32 cx, INT32 cy,
|
||||
HWND32 parent, INT32 id, HINSTANCE32 inst,
|
||||
HWND32 buddy, INT32 maxVal, INT32 minVal, INT32 curVal)
|
||||
{
|
||||
HWND32 hUD = CreateWindow32A(UPDOWN_CLASS32A, 0, style, x, y, cx, cy,
|
||||
parent, id, inst, 0);
|
||||
if(hUD){
|
||||
SendMessage32A(hUD, UDM_SETBUDDY, buddy, 0);
|
||||
SendMessage32A(hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal));
|
||||
SendMessage32A(hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0));
|
||||
}
|
||||
HWND32 hUD =
|
||||
CreateWindow32A (UPDOWN_CLASS32A, 0, style, x, y, cx, cy,
|
||||
parent, id, inst, 0);
|
||||
if (hUD) {
|
||||
SendMessage32A (hUD, UDM_SETBUDDY, buddy, 0);
|
||||
SendMessage32A (hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal));
|
||||
SendMessage32A (hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0));
|
||||
}
|
||||
|
||||
return hUD;
|
||||
return hUD;
|
||||
}
|
||||
|
||||
|
||||
|
@ -198,30 +374,30 @@ InitCommonControls (VOID)
|
|||
BOOL32 WINAPI
|
||||
InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
|
||||
{
|
||||
INT32 cCount;
|
||||
DWORD dwMask;
|
||||
INT32 cCount;
|
||||
DWORD dwMask;
|
||||
|
||||
TRACE(commctrl,"\n");
|
||||
TRACE(commctrl,"\n");
|
||||
|
||||
if (lpInitCtrls == NULL) return FALSE;
|
||||
if (lpInitCtrls->dwSize < sizeof(INITCOMMONCONTROLSEX)) return FALSE;
|
||||
if (lpInitCtrls == NULL) return FALSE;
|
||||
if (lpInitCtrls->dwSize < sizeof(INITCOMMONCONTROLSEX)) return FALSE;
|
||||
|
||||
for (cCount = 0; cCount < 32; cCount++) {
|
||||
dwMask = 1 << cCount;
|
||||
if (!(lpInitCtrls->dwICC & dwMask))
|
||||
continue;
|
||||
for (cCount = 0; cCount < 32; cCount++) {
|
||||
dwMask = 1 << cCount;
|
||||
if (!(lpInitCtrls->dwICC & dwMask))
|
||||
continue;
|
||||
|
||||
switch (lpInitCtrls->dwICC & dwMask) {
|
||||
/* dummy initialization */
|
||||
case ICC_ANIMATE_CLASS:
|
||||
case ICC_BAR_CLASSES:
|
||||
case ICC_LISTVIEW_CLASSES:
|
||||
case ICC_TREEVIEW_CLASSES:
|
||||
case ICC_TAB_CLASSES:
|
||||
case ICC_UPDOWN_CLASS:
|
||||
case ICC_PROGRESS_CLASS:
|
||||
case ICC_HOTKEY_CLASS:
|
||||
break;
|
||||
switch (lpInitCtrls->dwICC & dwMask) {
|
||||
/* dummy initialization */
|
||||
case ICC_ANIMATE_CLASS:
|
||||
case ICC_BAR_CLASSES:
|
||||
case ICC_LISTVIEW_CLASSES:
|
||||
case ICC_TREEVIEW_CLASSES:
|
||||
case ICC_TAB_CLASSES:
|
||||
case ICC_UPDOWN_CLASS:
|
||||
case ICC_PROGRESS_CLASS:
|
||||
case ICC_HOTKEY_CLASS:
|
||||
break;
|
||||
|
||||
/* advanced classes - not included in Win95 */
|
||||
case ICC_DATE_CLASSES:
|
||||
|
@ -232,7 +408,7 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
|
|||
break;
|
||||
|
||||
case ICC_USEREX_CLASSES:
|
||||
TRACE (commctrl, "No comboex class implemented!\n");
|
||||
COMBOEX_Register ();
|
||||
break;
|
||||
|
||||
case ICC_COOL_CLASSES:
|
||||
|
@ -254,68 +430,10 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
|
|||
default:
|
||||
WARN (commctrl, "Unknown class! dwICC=0x%lX\n", dwMask);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MenuHelp [COMCTL32.2]
|
||||
*
|
||||
* PARAMS
|
||||
* uMsg
|
||||
* wParam
|
||||
* lParam
|
||||
* hMainMenu
|
||||
* hInst
|
||||
* hwndStatus
|
||||
* lpwIDs
|
||||
*
|
||||
* NOTES
|
||||
* Some features are still missing because of incomplete WM_MENUSELECT
|
||||
* messages (16->32 bit conversion).
|
||||
*/
|
||||
|
||||
VOID WINAPI
|
||||
MenuHelp (UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, HMENU32 hMainMenu,
|
||||
HINSTANCE32 hInst, HWND32 hwndStatus, LPUINT32 lpwIDs)
|
||||
{
|
||||
char szStatusText[128];
|
||||
|
||||
if (!IsWindow32 (hwndStatus)) return;
|
||||
|
||||
switch (uMsg) {
|
||||
case WM_MENUSELECT:
|
||||
TRACE (commctrl, "WM_MENUSELECT wParam=0x%X lParam=0x%lX\n",
|
||||
wParam, lParam);
|
||||
|
||||
if ((HIWORD(wParam) == 0xFFFF) && (lParam == 0)) {
|
||||
/* menu was closed */
|
||||
SendMessage32A (hwndStatus, SB_SIMPLE, FALSE, 0);
|
||||
}
|
||||
else {
|
||||
if (HIWORD(wParam) & MF_POPUP) {
|
||||
FIXME (commctrl, "popup 0x%08x 0x%08lx\n", wParam, lParam);
|
||||
|
||||
szStatusText[0] = 0;
|
||||
}
|
||||
else {
|
||||
TRACE (commctrl, "menu item selected!\n");
|
||||
if (!LoadString32A (hInst, LOWORD(wParam), szStatusText, 128))
|
||||
szStatusText[0] = 0;
|
||||
}
|
||||
SendMessage32A (hwndStatus, SB_SETTEXT32A, 255 | SBT_NOBORDERS,
|
||||
(LPARAM)szStatusText);
|
||||
SendMessage32A (hwndStatus, SB_SIMPLE, TRUE, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
WARN (commctrl, "Invalid Message!\n");
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -387,6 +505,10 @@ CreateToolbarEx (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
|
|||
* wFlags
|
||||
* lpColorMap
|
||||
* iNumMaps
|
||||
*
|
||||
* RETURNS
|
||||
* Success: bitmap handle
|
||||
* Failure: 0
|
||||
*/
|
||||
|
||||
HBITMAP32 WINAPI
|
||||
|
@ -496,101 +618,34 @@ CreateToolbar (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* GetEffectiveClientRect [COMCTL32.4]
|
||||
* DllGetVersion [COMCTL32.25]
|
||||
*
|
||||
* Retrieves version information of the 'COMCTL32.DLL'
|
||||
*
|
||||
* 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
|
||||
* pdvi [O] pointer to version information structure.
|
||||
*
|
||||
* NOTES
|
||||
* REURNS
|
||||
* Success: S_OK
|
||||
* Failure: E_INVALIDARG
|
||||
*/
|
||||
|
||||
VOID WINAPI
|
||||
GetEffectiveClientRect (HWND32 hwnd, LPRECT32 lpRect, LPINT32 lpInfo)
|
||||
HRESULT WINAPI
|
||||
COMCTL32_DllGetVersion (DLLVERSIONINFO *pdvi)
|
||||
{
|
||||
RECT32 rcCtrl;
|
||||
INT32 *lpRun;
|
||||
HWND32 hwndCtrl;
|
||||
|
||||
TRACE (commctrl, "(0x%08lx 0x%08lx 0x%08lx)\n",
|
||||
(DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo);
|
||||
|
||||
GetClientRect32 (hwnd, lpRect);
|
||||
lpRun = lpInfo;
|
||||
|
||||
do {
|
||||
lpRun += 2;
|
||||
if (*lpRun == 0)
|
||||
return;
|
||||
lpRun++;
|
||||
hwndCtrl = GetDlgItem32 (hwnd, *lpRun);
|
||||
if (GetWindowLong32A (hwndCtrl, GWL_STYLE) & WS_VISIBLE) {
|
||||
TRACE (commctrl, "control id 0x%x\n", *lpRun);
|
||||
GetWindowRect32 (hwndCtrl, &rcCtrl);
|
||||
MapWindowPoints32 ((HWND32)0, hwnd, (LPPOINT32)&rcCtrl, 2);
|
||||
SubtractRect32 (lpRect, lpRect, &rcCtrl);
|
||||
}
|
||||
lpRun++;
|
||||
} while (*lpRun);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* ShowHideMenuCtl [COMCTL32.3]
|
||||
*
|
||||
* Shows or hides controls and updates the corresponding menu item.
|
||||
*
|
||||
* PARAMS
|
||||
* hwnd [I] handle to the client window.
|
||||
* uFlags [I] menu command id.
|
||||
* lpInfo [I] pointer to an array of integers. (See NOTES.)
|
||||
*
|
||||
* NOTES
|
||||
* The official documentation is incomplete! This has been fixed.
|
||||
*
|
||||
* lpInfo
|
||||
* The array of integers contains pairs of values. BOTH values of
|
||||
* the first pair must be the handles to application's main menu.
|
||||
* Each subsequent pair consists of a menu id and control id.
|
||||
*/
|
||||
|
||||
BOOL32 WINAPI
|
||||
ShowHideMenuCtl (HWND32 hwnd, UINT32 uFlags, LPINT32 lpInfo)
|
||||
{
|
||||
LPINT32 lpMenuId;
|
||||
FIXME (commctrl, "(0x%08x 0x%08x %p): empty stub!\n",
|
||||
hwnd, uFlags, lpInfo);
|
||||
|
||||
if (lpInfo == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!(lpInfo[0]) || !(lpInfo[1]))
|
||||
return FALSE;
|
||||
|
||||
/* search for control */
|
||||
lpMenuId = &lpInfo[2];
|
||||
while (*lpMenuId != uFlags)
|
||||
lpMenuId += 2;
|
||||
|
||||
if (GetMenuState32 (lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) {
|
||||
/* uncheck menu item */
|
||||
CheckMenuItem32 (lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
|
||||
/* hide control */
|
||||
lpMenuId++;
|
||||
SetWindowPos32 (GetDlgItem32 (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
|
||||
SWP_HIDEWINDOW);
|
||||
}
|
||||
else {
|
||||
/* check menu item */
|
||||
CheckMenuItem32 (lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED);
|
||||
|
||||
/* show control */
|
||||
lpMenuId++;
|
||||
SetWindowPos32 (GetDlgItem32 (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
|
||||
SWP_SHOWWINDOW);
|
||||
if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) {
|
||||
WARN(ver, "wrong DLLVERSIONINFO size from app");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
pdvi->dwMajorVersion = 4;
|
||||
pdvi->dwMinorVersion = 72;
|
||||
pdvi->dwBuildNumber = 2106;
|
||||
pdvi->dwPlatformID = 1;
|
||||
|
||||
TRACE (commctrl, "%lu.%lu.%lu.%lu\n",
|
||||
pdvi->dwMajorVersion, pdvi->dwMinorVersion,
|
||||
pdvi->dwBuildNumber, pdvi->dwPlatformID);
|
||||
|
||||
return S_OK;
|
||||
}
|
|
@ -447,7 +447,7 @@ HEADER_SendHeaderNotify (WND *wndPtr, UINT32 code, INT32 iItem)
|
|||
{
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
|
||||
NMHEADERA nmhdr;
|
||||
HD_ITEMA nmitem;
|
||||
HDITEM32A nmitem;
|
||||
|
||||
nmhdr.hdr.hwndFrom = wndPtr->hwndSelf;
|
||||
nmhdr.hdr.idFrom = wndPtr->wIDmenu;
|
||||
|
@ -565,13 +565,15 @@ static LRESULT
|
|||
HEADER_GetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
|
||||
HD_ITEMA *phdi;
|
||||
INT32 iItem;
|
||||
UINT32 uMask;
|
||||
HDITEM32A *phdi;
|
||||
INT32 iItem;
|
||||
UINT32 uMask;
|
||||
|
||||
phdi = (HD_ITEMA*)lParam;
|
||||
phdi = (HDITEM32A*)lParam;
|
||||
iItem = (INT32)wParam;
|
||||
|
||||
if (phdi == NULL)
|
||||
return FALSE;
|
||||
if ((iItem < 0) || (iItem > infoPtr->uNumItem - 1))
|
||||
return FALSE;
|
||||
|
||||
|
@ -668,13 +670,12 @@ static LRESULT
|
|||
HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
|
||||
HD_ITEMA *phdi;
|
||||
HDC32 hdc;
|
||||
INT32 iItem, len;
|
||||
HDITEM32A *phdi = (HDITEM32A*)lParam;
|
||||
INT32 iItem = (INT32)wParam;
|
||||
HDC32 hdc;
|
||||
INT32 len;
|
||||
|
||||
phdi = (HD_ITEMA*)lParam;
|
||||
iItem = (INT32)wParam;
|
||||
|
||||
if (phdi == NULL) return -1;
|
||||
if (iItem < 0) return -1;
|
||||
if (iItem > infoPtr->uNumItem)
|
||||
iItem = infoPtr->uNumItem;
|
||||
|
@ -796,13 +797,12 @@ static LRESULT
|
|||
HEADER_SetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
|
||||
HD_ITEMA *phdi;
|
||||
INT32 iItem;
|
||||
HDC32 hdc;
|
||||
|
||||
phdi = (HD_ITEMA*)lParam;
|
||||
iItem = (INT32)wParam;
|
||||
HDITEM32A *phdi = (HDITEM32A*)lParam;
|
||||
INT32 iItem = (INT32)wParam;
|
||||
HDC32 hdc;
|
||||
|
||||
if (phdi == NULL)
|
||||
return FALSE;
|
||||
if ((iItem < 0) || (iItem > infoPtr->uNumItem - 1))
|
||||
return FALSE;
|
||||
|
||||
|
@ -1221,7 +1221,7 @@ HEADER_SetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
|
||||
LRESULT WINAPI
|
||||
HeaderWindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
||||
HEADER_WindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
|
@ -1317,7 +1317,7 @@ void HEADER_Register( void )
|
|||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)HeaderWindowProc;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)HEADER_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(HEADER_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
|
@ -0,0 +1,360 @@
|
|||
/*
|
||||
* Hotkey control
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*
|
||||
* NOTES
|
||||
* Development in progress. An author is needed! Any volunteers?
|
||||
* I will only improve this control once in a while.
|
||||
* Eric <ekohl@abo.rhein-zeitung.de>
|
||||
*
|
||||
* TODO:
|
||||
* - Some messages.
|
||||
* - Display code.
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "hotkey.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#define HOTKEY_GetInfoPtr(wndPtr) ((HOTKEY_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
// << HOTHEY_GetHotKey >>
|
||||
// << HOTHEY_SetHotKey >>
|
||||
// << HOTHEY_SetRules >>
|
||||
|
||||
|
||||
|
||||
// << HOTKEY_Char >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr;
|
||||
TEXTMETRIC32A tm;
|
||||
HDC32 hdc;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (HOTKEY_INFO *)COMCTL32_Alloc (sizeof(HOTKEY_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
if (infoPtr == NULL) {
|
||||
ERR (listview, "could not allocate info memory!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((HOTKEY_INFO*)wndPtr->wExtra[0] != infoPtr) {
|
||||
ERR (listview, "pointer assignment error!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* initialize info structure */
|
||||
|
||||
/* get default font height */
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
GetTextMetrics32A (hdc, &tm);
|
||||
infoPtr->nHeight = tm.tmHeight;
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
/* free hotkey info data */
|
||||
COMCTL32_Free (infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
HBRUSH32 hBrush;
|
||||
RECT32 rc;
|
||||
|
||||
hBrush =
|
||||
(HBRUSH32)SendMessage32A (wndPtr->parent->hwndSelf, WM_CTLCOLOREDIT,
|
||||
wParam, (LPARAM)wndPtr->hwndSelf);
|
||||
if (hBrush)
|
||||
hBrush = (HBRUSH32)GetStockObject32 (WHITE_BRUSH);
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rc);
|
||||
|
||||
FillRect32 ((HDC32)wParam, &rc, hBrush);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
HOTKEY_GetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->hFont;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_KeyDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
switch (wParam) {
|
||||
case VK_RETURN:
|
||||
case VK_TAB:
|
||||
case VK_SPACE:
|
||||
case VK_DELETE:
|
||||
case VK_ESCAPE:
|
||||
case VK_BACK:
|
||||
return DefWindowProc32A (wndPtr->hwndSelf, WM_KEYDOWN, wParam, lParam);
|
||||
|
||||
case VK_SHIFT:
|
||||
case VK_CONTROL:
|
||||
case VK_MENU:
|
||||
FIXME (hotkey, "modifier key pressed!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME (hotkey, " %d\n", wParam);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_KeyUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
FIXME (hotkey, " %d\n", wParam);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_KillFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->bFocus = FALSE;
|
||||
DestroyCaret32 ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
// HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
SetFocus32 (wndPtr->hwndSelf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
HOTKEY_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
wndPtr->dwExStyle |= WS_EX_CLIENTEDGE;
|
||||
|
||||
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_SetFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->bFocus = TRUE;
|
||||
|
||||
|
||||
CreateCaret32 (wndPtr->hwndSelf, (HBITMAP32)0, 1, infoPtr->nHeight);
|
||||
|
||||
SetCaretPos32 (1, 1);
|
||||
|
||||
ShowCaret32 (wndPtr->hwndSelf);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
HOTKEY_SetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
TEXTMETRIC32A tm;
|
||||
HDC32 hdc;
|
||||
HFONT32 hOldFont = 0;
|
||||
|
||||
infoPtr->hFont = (HFONT32)wParam;
|
||||
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
if (infoPtr->hFont)
|
||||
hOldFont = SelectObject32 (hdc, infoPtr->hFont);
|
||||
|
||||
GetTextMetrics32A (hdc, &tm);
|
||||
infoPtr->nHeight = tm.tmHeight;
|
||||
|
||||
if (infoPtr->hFont)
|
||||
SelectObject32 (hdc, hOldFont);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
if (LOWORD(lParam)) {
|
||||
|
||||
FIXME (hotkey, "force redraw!\n");
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_SysKeyDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
switch (wParam) {
|
||||
case VK_RETURN:
|
||||
case VK_TAB:
|
||||
case VK_SPACE:
|
||||
case VK_DELETE:
|
||||
case VK_ESCAPE:
|
||||
case VK_BACK:
|
||||
return DefWindowProc32A (wndPtr->hwndSelf, WM_SYSKEYDOWN, wParam, lParam);
|
||||
|
||||
case VK_SHIFT:
|
||||
case VK_CONTROL:
|
||||
case VK_MENU:
|
||||
FIXME (hotkey, "modifier key pressed!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME (hotkey, " %d\n", wParam);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
HOTKEY_SysKeyUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
|
||||
|
||||
FIXME (hotkey, " %d\n", wParam);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
HOTKEY_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
// case HKM_GETHOTKEY:
|
||||
// case HKM_SETHOTKEY:
|
||||
// case HKM_SETRULES:
|
||||
|
||||
// case WM_CHAR:
|
||||
|
||||
case WM_CREATE:
|
||||
return HOTKEY_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return HOTKEY_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return HOTKEY_EraseBackground (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return DLGC_WANTCHARS | DLGC_WANTARROWS;
|
||||
|
||||
case WM_GETFONT:
|
||||
return HOTKEY_GetFont (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
return HOTKEY_KeyDown (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
return HOTKEY_KeyUp (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
return HOTKEY_KillFocus (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
return HOTKEY_LButtonDown (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_NCCREATE:
|
||||
return HOTKEY_NCCreate (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_PAINT:
|
||||
|
||||
case WM_SETFOCUS:
|
||||
return HOTKEY_SetFocus (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_SETFONT:
|
||||
return HOTKEY_SetFont (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_SYSCHAR:
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (hotkey, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
HOTKEY_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (HOTKEY_CLASS32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)HOTKEY_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(HOTKEY_INFO *);
|
||||
wndClass.hCursor = 0;
|
||||
wndClass.hbrBackground = 0;
|
||||
wndClass.lpszClassName = HOTKEY_CLASS32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
|
@ -1921,8 +1921,10 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT32 i, HICON32 hIcon)
|
|||
if (hdcImage)
|
||||
DeleteDC32 (hdcImage);
|
||||
|
||||
// FIXME (imagelist, "deleting hbmColor!\n");
|
||||
if (ii.hbmColor)
|
||||
DeleteObject32 (ii.hbmColor);
|
||||
// FIXME (imagelist, "deleted hbmColor!\n");
|
||||
if (ii.hbmMask)
|
||||
DeleteObject32 (ii.hbmMask);
|
||||
|
|
@ -0,0 +1,600 @@
|
|||
/*
|
||||
* Listview control
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*
|
||||
* NOTES
|
||||
* This is just a dummy control. An author is needed! Any volunteers?
|
||||
* I will only improve this control once in a while.
|
||||
* Eric <ekohl@abo.rhein-zeitung.de>
|
||||
*
|
||||
* TODO:
|
||||
* - All messages.
|
||||
* - All notifications.
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "listview.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#define LISTVIEW_GetInfoPtr(wndPtr) ((LISTVIEW_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
static VOID
|
||||
LISTVIEW_Refresh (WND *wndPtr, HDC32 hdc)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// << LISTVIEW_FindItem >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_GetBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->clrBk;
|
||||
}
|
||||
|
||||
|
||||
// << LISTVIEW_GetBkImage >>
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
LISTVIEW_GetColumnWidth (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
HDITEM32A hdi;
|
||||
|
||||
hdi.mask = HDI_WIDTH;
|
||||
if (SendMessage32A (infoPtr->hwndHeader, HDM_GETITEM32A,
|
||||
wParam, (LPARAM)&hdi))
|
||||
return hdi.cxy;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
LISTVIEW_GetHeader (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->hwndHeader;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_GetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
TRACE (listview, "(0x%08x)\n", wParam);
|
||||
|
||||
switch (wParam) {
|
||||
case LVSIL_NORMAL:
|
||||
return (LRESULT)infoPtr->himlNormal;
|
||||
|
||||
case LVSIL_SMALL:
|
||||
return (LRESULT)infoPtr->himlSmall;
|
||||
|
||||
case LVSIL_STATE:
|
||||
return (LRESULT)infoPtr->himlState;
|
||||
}
|
||||
|
||||
return (LRESULT)NULL;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_GetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
FIXME (listview, "(0x%08x) empty stub!\n", wParam);
|
||||
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
LISTVIEW_GetItemCount (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
return infoPtr->nItemCount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_GetStringWidth32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
LPSTR lpsz = (LPSTR)lParam;
|
||||
HFONT32 hFont, hOldFont;
|
||||
HDC32 hdc;
|
||||
SIZE32 size;
|
||||
|
||||
if (!lpsz)
|
||||
return 0;
|
||||
|
||||
TRACE (listview, "(%s) empty stub!\n", lpsz);
|
||||
|
||||
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject32 (SYSTEM_FONT);
|
||||
hdc = GetDC32 (0);
|
||||
hOldFont = SelectObject32 (hdc, hFont);
|
||||
GetTextExtentPoint32A (hdc, lpsz, lstrlen32A(lpsz), &size);
|
||||
SelectObject32 (hdc, hOldFont);
|
||||
ReleaseDC32 (0, hdc);
|
||||
|
||||
TRACE (listview, "-- ret=%d\n", size.cx);
|
||||
|
||||
return (LRESULT)size.cx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_InsertColumn32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
LPLVCOLUMN32A lpcol = (LPLVCOLUMN32A)lParam;
|
||||
HDITEM32A hdi;
|
||||
|
||||
if (!lpcol)
|
||||
return -1;
|
||||
|
||||
TRACE (listview, "(%d %p) empty stub!\n", (INT32)wParam, lpcol);
|
||||
|
||||
ZeroMemory (&hdi, sizeof(HDITEM32A));
|
||||
|
||||
if (lpcol->mask & LVCF_FMT) {
|
||||
if (wParam == 0)
|
||||
hdi.fmt |= HDF_LEFT;
|
||||
else if (lpcol->fmt & LVCFMT_LEFT)
|
||||
hdi.fmt |= HDF_LEFT;
|
||||
else if (lpcol->fmt & LVCFMT_RIGHT)
|
||||
hdi.fmt |= HDF_RIGHT;
|
||||
else if (lpcol->fmt & LVCFMT_CENTER)
|
||||
hdi.fmt |= HDF_CENTER;
|
||||
|
||||
if (lpcol->fmt & LVCFMT_COL_HAS_IMAGES)
|
||||
hdi.fmt |= HDF_IMAGE;
|
||||
|
||||
hdi.mask |= HDI_FORMAT;
|
||||
}
|
||||
|
||||
if (lpcol->mask & LVCF_WIDTH) {
|
||||
hdi.mask |= HDI_WIDTH;
|
||||
hdi.cxy = lpcol->cx;
|
||||
}
|
||||
|
||||
if (lpcol->mask & LVCF_TEXT) {
|
||||
hdi.mask |= (HDI_TEXT | HDI_FORMAT);
|
||||
hdi.pszText = lpcol->pszText;
|
||||
hdi.fmt |= HDF_STRING;
|
||||
}
|
||||
|
||||
if (lpcol->mask & LVCF_IMAGE) {
|
||||
hdi.mask |= HDI_IMAGE;
|
||||
hdi.iImage = lpcol->iImage;
|
||||
}
|
||||
|
||||
if (lpcol->mask & LVCF_ORDER) {
|
||||
hdi.mask |= HDI_ORDER;
|
||||
hdi.iOrder = lpcol->iOrder;
|
||||
}
|
||||
|
||||
return (LRESULT)SendMessage32A (infoPtr->hwndHeader, HDM_INSERTITEM32A,
|
||||
wParam, (LPARAM)&hdi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_SetBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
if (!(infoPtr)) return FALSE;
|
||||
|
||||
/* set background color */
|
||||
TRACE (listview, "0x%06x\n", (COLORREF)lParam);
|
||||
infoPtr->clrBk = (COLORREF)lParam;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
HIMAGELIST himlTemp = 0;
|
||||
|
||||
TRACE (listview, "(0x%08x 0x%08lx)\n", wParam, lParam);
|
||||
|
||||
switch (wParam) {
|
||||
case LVSIL_NORMAL:
|
||||
himlTemp = infoPtr->himlNormal;
|
||||
infoPtr->himlNormal = (HIMAGELIST)lParam;
|
||||
return (LRESULT)himlTemp;
|
||||
|
||||
case LVSIL_SMALL:
|
||||
himlTemp = infoPtr->himlSmall;
|
||||
infoPtr->himlSmall = (HIMAGELIST)lParam;
|
||||
return (LRESULT)himlTemp;
|
||||
|
||||
case LVSIL_STATE:
|
||||
himlTemp = infoPtr->himlState;
|
||||
infoPtr->himlState = (HIMAGELIST)lParam;
|
||||
return (LRESULT)himlTemp;
|
||||
}
|
||||
|
||||
return (LRESULT)NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
/* info structure is created at NCCreate */
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
LOGFONT32A logFont;
|
||||
DWORD dwStyle = WS_CHILD | WS_VISIBLE;
|
||||
|
||||
|
||||
/* initialize info structure */
|
||||
infoPtr->clrBk = CLR_NONE;
|
||||
|
||||
if (!(wndPtr->dwStyle & LVS_REPORT) ||
|
||||
(wndPtr->dwStyle & LVS_NOCOLUMNHEADER))
|
||||
dwStyle |= HDS_HIDDEN;
|
||||
if (!(wndPtr->dwStyle & LVS_NOSORTHEADER))
|
||||
dwStyle |= HDS_BUTTONS;
|
||||
|
||||
/* create header */
|
||||
infoPtr->hwndHeader =
|
||||
CreateWindow32A (WC_HEADER32A, "", dwStyle,
|
||||
0, 0, 0, 0, wndPtr->hwndSelf,
|
||||
(HMENU32)0, wndPtr->hInstance, NULL);
|
||||
|
||||
/* get default font (icon title) */
|
||||
SystemParametersInfo32A (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
|
||||
infoPtr->hDefaultFont = CreateFontIndirect32A (&logFont);
|
||||
infoPtr->hFont = infoPtr->hDefaultFont;
|
||||
|
||||
/* set header font */
|
||||
SendMessage32A (infoPtr->hwndHeader, WM_SETFONT,
|
||||
(WPARAM32)infoPtr->hFont, (LPARAM)TRUE);
|
||||
|
||||
|
||||
infoPtr->hdsaItems = DSA_Create (sizeof(LISTVIEW_ITEM), 10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
DSA_Destroy (infoPtr->hdsaItems);
|
||||
|
||||
/* destroy header */
|
||||
if (infoPtr->hwndHeader)
|
||||
DestroyWindow32 (infoPtr->hwndHeader);
|
||||
|
||||
/* destroy font */
|
||||
infoPtr->hFont = (HFONT32)0;
|
||||
if (infoPtr->hDefaultFont)
|
||||
DeleteObject32 (infoPtr->hDefaultFont);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
if (infoPtr->clrBk == CLR_NONE) {
|
||||
return SendMessage32A (GetParent32 (wndPtr->hwndSelf),
|
||||
WM_ERASEBKGND, wParam, lParam);
|
||||
}
|
||||
else {
|
||||
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
|
||||
FillRect32 ((HDC32)wParam, &infoPtr->rcList, hBrush);
|
||||
DeleteObject32 (hBrush);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
__inline__ static LRESULT
|
||||
LISTVIEW_GetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->hFont;
|
||||
}
|
||||
|
||||
|
||||
// << LISTVIEW_HScroll >>
|
||||
// << LISTVIEW_KeyDown >>
|
||||
// << LISTVIEW_KillFocus >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (LISTVIEW_INFO *)COMCTL32_Alloc (sizeof(LISTVIEW_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
if (infoPtr == NULL) {
|
||||
ERR (listview, "could not allocate info memory!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((LISTVIEW_INFO*)wndPtr->wExtra[0] != infoPtr) {
|
||||
ERR (listview, "pointer assignment error!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_NCDestroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
|
||||
/* free list view info data */
|
||||
COMCTL32_Free (infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_Paint (WND *wndPtr, WPARAM32 wParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
PAINTSTRUCT32 ps;
|
||||
|
||||
hdc = wParam==0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
|
||||
LISTVIEW_Refresh (wndPtr, hdc);
|
||||
if (!wParam)
|
||||
EndPaint32 (wndPtr->hwndSelf, &ps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_SetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
HFONT32 hFont = (HFONT32)wParam;
|
||||
|
||||
infoPtr->hFont = hFont ? hFont : infoPtr->hDefaultFont;
|
||||
|
||||
/* set header font */
|
||||
SendMessage32A (infoPtr->hwndHeader, WM_SETFONT, wParam, lParam);
|
||||
|
||||
/* reinitialize the listview */
|
||||
|
||||
|
||||
|
||||
if (lParam) {
|
||||
/* force redraw */
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
LISTVIEW_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(wndPtr);
|
||||
HDLAYOUT hl;
|
||||
WINDOWPOS32 wp;
|
||||
RECT32 rc;
|
||||
|
||||
rc.top = 0;
|
||||
rc.left = 0;
|
||||
rc.right = LOWORD(lParam);
|
||||
rc.bottom = HIWORD(lParam);
|
||||
|
||||
hl.prc = &rc;
|
||||
hl.pwpos = ℘
|
||||
SendMessage32A (infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl);
|
||||
|
||||
SetWindowPos32 (infoPtr->hwndHeader, wndPtr->hwndSelf,
|
||||
wp.x, wp.y, wp.cx, wp.cy, wp.flags);
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &infoPtr->rcList);
|
||||
infoPtr->rcList.top += wp.cy;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
LISTVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
// case LVM_DELETEALLITEMS:
|
||||
|
||||
case LVM_GETBKCOLOR:
|
||||
return LISTVIEW_GetBkColor (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
case LVM_GETCOLUMNWIDTH:
|
||||
return LISTVIEW_GetColumnWidth (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
case LVM_GETHEADER:
|
||||
return LISTVIEW_GetHeader (wndPtr, wParam, lParam);
|
||||
|
||||
// case LVM_GETISEARCHSTRING:
|
||||
|
||||
case LVM_GETIMAGELIST:
|
||||
return LISTVIEW_GetImageList (wndPtr, wParam, lParam);
|
||||
|
||||
case LVM_GETITEM32A:
|
||||
return LISTVIEW_GetItem32A (wndPtr, wParam, lParam);
|
||||
|
||||
// case LVM_GETITEM32W:
|
||||
|
||||
case LVM_GETITEMCOUNT:
|
||||
return LISTVIEW_GetItemCount (wndPtr, wParam, lParam);
|
||||
|
||||
// case LVM_GETSELECTEDCOUNT:
|
||||
|
||||
case LVM_GETSTRINGWIDTH32A:
|
||||
return LISTVIEW_GetStringWidth32A (wndPtr, wParam, lParam);
|
||||
|
||||
// case LVM_GETSTRINGWIDTH32W:
|
||||
// case LVM_GETSUBITEMRECT:
|
||||
|
||||
case LVM_INSERTCOLUMN32A:
|
||||
return LISTVIEW_InsertColumn32A (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
// case LVM_INSERTCOLUMN32W:
|
||||
|
||||
// case LVM_INSERTITEM32A:
|
||||
// case LVM_INSERTITEM32W:
|
||||
|
||||
|
||||
case LVM_SETBKCOLOR:
|
||||
return LISTVIEW_SetBkColor (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
case LVM_SETIMAGELIST:
|
||||
return LISTVIEW_SetImageList (wndPtr, wParam, lParam);
|
||||
|
||||
// case LVM_SETITEMPOSITION:
|
||||
|
||||
// case LVM_SORTITEMS:
|
||||
|
||||
|
||||
// case WM_CHAR:
|
||||
// case WM_COMMAND:
|
||||
|
||||
case WM_CREATE:
|
||||
return LISTVIEW_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return LISTVIEW_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return LISTVIEW_EraseBackground (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return DLGC_WANTTAB | DLGC_WANTARROWS;
|
||||
|
||||
case WM_GETFONT:
|
||||
return LISTVIEW_GetFont (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_HSCROLL:
|
||||
|
||||
// case WM_MOUSEMOVE:
|
||||
// return LISTVIEW_MouseMove (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_NCCREATE:
|
||||
return LISTVIEW_NCCreate (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_NCDESTROY:
|
||||
return LISTVIEW_NCDestroy (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_NOTIFY:
|
||||
|
||||
case WM_PAINT:
|
||||
return LISTVIEW_Paint (wndPtr, wParam);
|
||||
|
||||
// case WM_RBUTTONDOWN:
|
||||
// case WM_SETFOCUS:
|
||||
|
||||
case WM_SETFONT:
|
||||
return LISTVIEW_SetFont (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_SETREDRAW:
|
||||
|
||||
case WM_SIZE:
|
||||
return LISTVIEW_Size (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_TIMER:
|
||||
// case WM_VSCROLL:
|
||||
// case WM_WINDOWPOSCHANGED:
|
||||
// case WM_WININICHANGE:
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (listview, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LISTVIEW_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (WC_LISTVIEW32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)LISTVIEW_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(LISTVIEW_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = (HBRUSH32)(COLOR_WINDOW + 1);
|
||||
wndClass.lpszClassName = WC_LISTVIEW32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "pager.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
@ -49,7 +48,7 @@ PAGER_GetBorder (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
|
||||
return (LRESULT)infoPtr->iBorder;
|
||||
return (LRESULT)infoPtr->nBorder;
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,11 +57,21 @@ PAGER_GetButtonSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
|
||||
return (LRESULT)infoPtr->iButtonSize;
|
||||
return (LRESULT)infoPtr->nButtonSize;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
PAGER_GetButtonState (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
|
||||
FIXME (pager, "empty stub!\n");
|
||||
|
||||
return PGF_INVISIBLE;
|
||||
}
|
||||
|
||||
|
||||
// << PAGER_GetButtonState >>
|
||||
// << PAGER_GetDropTarget >>
|
||||
|
||||
|
||||
|
@ -71,16 +80,33 @@ PAGER_GetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->iPos;
|
||||
return infoPtr->nPos;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
PAGER_RecalcSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
// PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
NMPGCALCSIZE nmpgcs;
|
||||
|
||||
FIXME (pager, "empty stub!\n");
|
||||
if (infoPtr->hwndChild) {
|
||||
nmpgcs.hdr.hwndFrom = wndPtr->hwndSelf;
|
||||
nmpgcs.hdr.idFrom = wndPtr->wIDmenu;
|
||||
nmpgcs.hdr.code = PGN_CALCSIZE;
|
||||
nmpgcs.dwFlag =
|
||||
(wndPtr->dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
|
||||
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
|
||||
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&nmpgcs);
|
||||
|
||||
infoPtr->nChildSize =
|
||||
(wndPtr->dwStyle & PGS_HORZ) ? nmpgcs.iWidth : nmpgcs.iHeight;
|
||||
|
||||
|
||||
FIXME (pager, "Child size %d\n", infoPtr->nChildSize);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -104,9 +130,9 @@ static __inline__ LRESULT
|
|||
PAGER_SetBorder (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
INT32 nTemp = infoPtr->iBorder;
|
||||
INT32 nTemp = infoPtr->nBorder;
|
||||
|
||||
infoPtr->iBorder = (INT32)lParam;
|
||||
infoPtr->nBorder = (INT32)lParam;
|
||||
|
||||
/* FIXME: redraw */
|
||||
|
||||
|
@ -118,9 +144,11 @@ static __inline__ LRESULT
|
|||
PAGER_SetButtonSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
INT32 nTemp = infoPtr->iButtonSize;
|
||||
INT32 nTemp = infoPtr->nButtonSize;
|
||||
|
||||
infoPtr->iButtonSize = (INT32)lParam;
|
||||
infoPtr->nButtonSize = (INT32)lParam;
|
||||
|
||||
FIXME (pager, "size=%d\n", infoPtr->nButtonSize);
|
||||
|
||||
/* FIXME: redraw */
|
||||
|
||||
|
@ -133,9 +161,15 @@ PAGER_SetChild (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->hwndChild = (HWND32)lParam;
|
||||
infoPtr->hwndChild = IsWindow32 ((HWND32)lParam) ? (HWND32)lParam : 0;
|
||||
|
||||
FIXME (pager, "hwnd=%x\n", infoPtr->hwndChild);
|
||||
|
||||
/* FIXME: redraw */
|
||||
SetParent32 (infoPtr->hwndChild, wndPtr->hwndSelf);
|
||||
SetWindowPos32 (infoPtr->hwndChild, wndPtr->hwndSelf,
|
||||
0, 0, 40, 40, SWP_SHOWWINDOW);
|
||||
RedrawWindow32 (wndPtr->hwndSelf, NULL, 0, RDW_INVALIDATE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -146,9 +180,13 @@ PAGER_SetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->iPos = (INT32)lParam;
|
||||
infoPtr->nPos = (INT32)lParam;
|
||||
|
||||
FIXME (pager, "pos=%d\n", infoPtr->nPos);
|
||||
|
||||
/* FIXME: redraw */
|
||||
SetWindowPos32 (infoPtr->hwndChild, wndPtr->hwndSelf,
|
||||
0, 0, 0, 0, SWP_NOSIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -160,8 +198,7 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
PAGER_INFO *infoPtr;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (PAGER_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof(PAGER_INFO));
|
||||
infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
if (infoPtr == NULL) {
|
||||
|
@ -177,9 +214,9 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
/* set default settings */
|
||||
infoPtr->hwndChild = 0;
|
||||
infoPtr->clrBk = GetSysColor32 (COLOR_BTNFACE);
|
||||
infoPtr->iBorder = 0;
|
||||
infoPtr->iButtonSize = 0;
|
||||
infoPtr->iPos = 0;
|
||||
infoPtr->nBorder = 0;
|
||||
infoPtr->nButtonSize = 0;
|
||||
infoPtr->nPos = 0;
|
||||
|
||||
|
||||
return 0;
|
||||
|
@ -195,7 +232,7 @@ PAGER_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
|
||||
/* free pager info data */
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr);
|
||||
COMCTL32_Free (infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -208,9 +245,9 @@ PAGER_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
|
||||
RECT32 rect;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
FillRect32 ((HDC32)wParam, &rect, hBrush);
|
||||
DeleteObject32 (hBrush);
|
||||
// GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
// FillRect32 ((HDC32)wParam, &rect, hBrush);
|
||||
// DeleteObject32 (hBrush);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -238,7 +275,9 @@ PAGER_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
case PGM_GETBUTTONSIZE:
|
||||
return PAGER_GetButtonSize (wndPtr, wParam, lParam);
|
||||
|
||||
// case PGM_GETBUTTONSTATE:
|
||||
case PGM_GETBUTTONSTATE:
|
||||
return PAGER_GetButtonState (wndPtr, wParam, lParam);
|
||||
|
||||
// case PGM_GETDROPTARGET:
|
||||
|
||||
case PGM_GETPOS:
|
|
@ -24,6 +24,26 @@
|
|||
#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
|
||||
|
||||
static VOID
|
||||
REBAR_Refresh (WND *wndPtr, HDC32 hdc)
|
||||
{
|
||||
RECT32 rect;
|
||||
HBRUSH32 hbrBk;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
|
||||
hbrBk = CreateSolidBrush32 (RGB (192, 192, 192));
|
||||
FillRect32 (hdc, &rect, hbrBk);
|
||||
DeleteObject32 (hbrBk);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// << REBAR_BeginDrag >>
|
||||
// << REBAR_DeleteBand >>
|
||||
// << REBAR_DragMove >>
|
||||
|
@ -51,7 +71,7 @@ REBAR_GetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
if (lprbbi == NULL)
|
||||
return FALSE;
|
||||
if (lprbbi->cbSize < sizeof (LPREBARBANDINFO32A))
|
||||
if (lprbbi->cbSize < REBARBANDINFO_V3_SIZE32A)
|
||||
return FALSE;
|
||||
if ((UINT32)wParam >= infoPtr->uNumBands)
|
||||
return FALSE;
|
||||
|
@ -97,16 +117,17 @@ REBAR_GetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lprbbi->fMask & RBBIM_ID)
|
||||
lprbbi->wID = lpBand->wID;
|
||||
|
||||
/* FIXME: check for size of band info structure */
|
||||
/* check for additional data */
|
||||
if (lprbbi->cbSize >= sizeof (REBARBANDINFO32A)) {
|
||||
if (lprbbi->fMask & RBBIM_IDEALSIZE)
|
||||
lprbbi->cxIdeal = lpBand->cxIdeal;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_IDEALSIZE)
|
||||
lprbbi->cxIdeal = lpBand->cxIdeal;
|
||||
if (lprbbi->fMask & RBBIM_LPARAM)
|
||||
lprbbi->lParam = lpBand->lParam;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_LPARAM)
|
||||
lprbbi->lParam = lpBand->lParam;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_HEADERSIZE)
|
||||
lprbbi->cxHeader = lpBand->cxHeader;
|
||||
if (lprbbi->fMask & RBBIM_HEADERSIZE)
|
||||
lprbbi->cxHeader = lpBand->cxHeader;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -114,7 +135,16 @@ REBAR_GetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
// << REBAR_GetBandInfo32W >>
|
||||
|
||||
// << REBAR_GetBarHeight >>
|
||||
|
||||
static LRESULT
|
||||
REBAR_GetBarHeight (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
|
||||
|
||||
FIXME (rebar, "returns fixed height of 40 pixels!\n");
|
||||
|
||||
return 40;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
|
@ -187,10 +217,13 @@ REBAR_IdToIndex (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
TRACE (rebar, "id %u\n", (UINT32)wParam);
|
||||
|
||||
for (i = 0; i < infoPtr->uNumBands; i++) {
|
||||
if (infoPtr->bands[i].wID == (UINT32)wParam)
|
||||
if (infoPtr->bands[i].wID == (UINT32)wParam) {
|
||||
TRACE (rebar, "band %u found!\n", i);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE (rebar, "no band found!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -207,9 +240,11 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
return FALSE;
|
||||
if (lprbbi == NULL)
|
||||
return FALSE;
|
||||
if (lprbbi->cbSize < sizeof (REBARBANDINFO32A))
|
||||
if (lprbbi->cbSize < REBARBANDINFO_V3_SIZE32A)
|
||||
return FALSE;
|
||||
|
||||
TRACE (rebar, "insert band at %u!\n", uIndex);
|
||||
|
||||
if (infoPtr->uNumBands == 0) {
|
||||
infoPtr->bands =
|
||||
(REBAR_BAND *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
|
@ -221,12 +256,20 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
infoPtr->bands =
|
||||
(REBAR_BAND *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
(infoPtr->uNumBands+1)*sizeof(REBAR_BAND));
|
||||
if ((INT32)uIndex == -1)
|
||||
if (((INT32)uIndex == -1) || (uIndex > infoPtr->uNumBands))
|
||||
uIndex = infoPtr->uNumBands;
|
||||
|
||||
/* pre copy */
|
||||
/* pre insert copy */
|
||||
if (uIndex > 0) {
|
||||
memcpy (&infoPtr->bands[0], &oldBands[0],
|
||||
uIndex * sizeof(REBAR_BAND));
|
||||
}
|
||||
|
||||
/* post copy */
|
||||
if (uIndex < infoPtr->uNumBands - 1) {
|
||||
memcpy (&infoPtr->bands[uIndex+1], &oldBands[uIndex],
|
||||
(infoPtr->uNumBands - uIndex - 1) * sizeof(REBAR_BAND));
|
||||
}
|
||||
|
||||
HeapFree (GetProcessHeap (), 0, &oldBands);
|
||||
}
|
||||
|
@ -258,8 +301,11 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lprbbi->fMask & RBBIM_IMAGE)
|
||||
lpBand->iImage = lprbbi->iImage;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_CHILD)
|
||||
if (lprbbi->fMask & RBBIM_CHILD) {
|
||||
lpBand->hwndChild = lprbbi->hwndChild;
|
||||
lpBand->hwndPrevParent =
|
||||
SetParent32 (lpBand->hwndChild, wndPtr->hwndSelf);
|
||||
}
|
||||
|
||||
if (lprbbi->fMask & RBBIM_CHILDSIZE) {
|
||||
lpBand->cxMinChild = lprbbi->cxMinChild;
|
||||
|
@ -278,16 +324,17 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lprbbi->fMask & RBBIM_ID)
|
||||
lpBand->wID = lprbbi->wID;
|
||||
|
||||
/* FIXME: check for size of band info structure */
|
||||
/* check for additional data */
|
||||
if (lprbbi->cbSize >= sizeof (REBARBANDINFO32A)) {
|
||||
if (lprbbi->fMask & RBBIM_IDEALSIZE)
|
||||
lpBand->cxIdeal = lprbbi->cxIdeal;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_IDEALSIZE)
|
||||
lpBand->cxIdeal = lprbbi->cxIdeal;
|
||||
if (lprbbi->fMask & RBBIM_LPARAM)
|
||||
lpBand->lParam = lprbbi->lParam;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_LPARAM)
|
||||
lpBand->lParam = lprbbi->lParam;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_HEADERSIZE)
|
||||
lpBand->cxHeader = lprbbi->cxHeader;
|
||||
if (lprbbi->fMask & RBBIM_HEADERSIZE)
|
||||
lpBand->cxHeader = lprbbi->cxHeader;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -308,7 +355,7 @@ REBAR_SetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
if (lprbbi == NULL)
|
||||
return FALSE;
|
||||
if (lprbbi->cbSize < sizeof (LPREBARBANDINFO32A))
|
||||
if (lprbbi->cbSize < REBARBANDINFO_V3_SIZE32A)
|
||||
return FALSE;
|
||||
if ((UINT32)wParam >= infoPtr->uNumBands)
|
||||
return FALSE;
|
||||
|
@ -340,8 +387,11 @@ REBAR_SetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lprbbi->fMask & RBBIM_IMAGE)
|
||||
lpBand->iImage = lprbbi->iImage;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_CHILD)
|
||||
if (lprbbi->fMask & RBBIM_CHILD) {
|
||||
lpBand->hwndChild = lprbbi->hwndChild;
|
||||
lpBand->hwndPrevParent =
|
||||
SetParent32 (lpBand->hwndChild, wndPtr->hwndSelf);
|
||||
}
|
||||
|
||||
if (lprbbi->fMask & RBBIM_CHILDSIZE) {
|
||||
lpBand->cxMinChild = lprbbi->cxMinChild;
|
||||
|
@ -360,16 +410,17 @@ REBAR_SetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lprbbi->fMask & RBBIM_ID)
|
||||
lpBand->wID = lprbbi->wID;
|
||||
|
||||
/* FIXME: check for size of band info structure */
|
||||
/* check for additional data */
|
||||
if (lprbbi->cbSize >= sizeof (REBARBANDINFO32A)) {
|
||||
if (lprbbi->fMask & RBBIM_IDEALSIZE)
|
||||
lpBand->cxIdeal = lprbbi->cxIdeal;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_IDEALSIZE)
|
||||
lpBand->cxIdeal = lprbbi->cxIdeal;
|
||||
if (lprbbi->fMask & RBBIM_LPARAM)
|
||||
lpBand->lParam = lprbbi->lParam;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_LPARAM)
|
||||
lpBand->lParam = lprbbi->lParam;
|
||||
|
||||
if (lprbbi->fMask & RBBIM_HEADERSIZE)
|
||||
lpBand->cxHeader = lprbbi->cxHeader;
|
||||
if (lprbbi->fMask & RBBIM_HEADERSIZE)
|
||||
lpBand->cxHeader = lprbbi->cxHeader;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -436,8 +487,38 @@ REBAR_SetTextColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
// << REBAR_SetTooltips >>
|
||||
// << REBAR_SetUnicodeFormat >>
|
||||
// << REBAR_ShowBand >>
|
||||
// << REBAR_SizeToRect >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
REBAR_ShowBand (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
|
||||
|
||||
if (((INT32)wParam < 0) || ((INT32)wParam > infoPtr->uNumBands))
|
||||
return FALSE;
|
||||
|
||||
if ((BOOL32)lParam)
|
||||
FIXME (rebar, "show band %d\n", (INT32)wParam);
|
||||
else
|
||||
FIXME (rebar, "hide band %d\n", (INT32)wParam);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
REBAR_SizeToRect (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
|
||||
LPRECT32 lpRect = (LPRECT32)lParam;
|
||||
|
||||
if (lpRect == NULL)
|
||||
return FALSE;
|
||||
|
||||
FIXME (rebar, "layout change not implemented!\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -447,8 +528,7 @@ REBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
REBAR_INFO *infoPtr;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (REBAR_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof(REBAR_INFO));
|
||||
infoPtr = (REBAR_INFO *)COMCTL32_Alloc (sizeof(REBAR_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
if (infoPtr == NULL) {
|
||||
|
@ -461,7 +541,7 @@ REBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* initialize info structure */
|
||||
infoPtr->clrText = CLR_NONE;
|
||||
infoPtr->clrText = RGB(0, 0, 0);
|
||||
|
||||
|
@ -497,7 +577,7 @@ REBAR_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
/* free rebar info data */
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr);
|
||||
COMCTL32_Free (infoPtr);
|
||||
|
||||
TRACE (rebar, "destroyed!\n");
|
||||
return 0;
|
||||
|
@ -505,6 +585,20 @@ REBAR_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
|
||||
|
||||
static LRESULT
|
||||
REBAR_Paint (WND *wndPtr, WPARAM32 wParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
PAINTSTRUCT32 ps;
|
||||
|
||||
hdc = wParam==0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
|
||||
REBAR_Refresh (wndPtr, hdc);
|
||||
if (!wParam)
|
||||
EndPaint32 (wndPtr->hwndSelf, &ps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
|
@ -529,7 +623,9 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
|
||||
// case RB_GETBANDINFO32W:
|
||||
// case RB_GETBARHEIGHT:
|
||||
|
||||
case RB_GETBARHEIGHT:
|
||||
return REBAR_GetBarHeight (wndPtr, wParam, lParam);
|
||||
|
||||
case RB_GETBARINFO:
|
||||
return REBAR_GetBarInfo (wndPtr, wParam, lParam);
|
||||
|
@ -582,8 +678,12 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
// case RB_SETTOOLTIPS:
|
||||
// case RB_SETUNICODEFORMAT:
|
||||
// case RB_SHOWBAND:
|
||||
// case RB_SIZETORECT:
|
||||
|
||||
case RB_SHOWBAND:
|
||||
return REBAR_ShowBand (wndPtr, wParam, lParam);
|
||||
|
||||
case RB_SIZETORECT:
|
||||
return REBAR_SizeToRect (wndPtr, wParam, lParam);
|
||||
|
||||
|
||||
case WM_CREATE:
|
||||
|
@ -597,8 +697,8 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
// case WM_MOUSEMOVE:
|
||||
// return REBAR_MouseMove (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_PAINT:
|
||||
// return REBAR_Paint (wndPtr, wParam);
|
||||
case WM_PAINT:
|
||||
return REBAR_Paint (wndPtr, wParam);
|
||||
|
||||
// case WM_SETFONT:
|
||||
|
||||
|
@ -624,12 +724,12 @@ REBAR_Register (void)
|
|||
if (GlobalFindAtom32A (REBARCLASSNAME32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS;
|
||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)REBAR_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(REBAR_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = 0;
|
||||
wndClass.hCursor = 0;
|
||||
wndClass.hbrBackground = (HBRUSH32) COLOR_BTNFACE + 1;
|
||||
wndClass.lpszClassName = REBARCLASSNAME32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
|
@ -0,0 +1,392 @@
|
|||
/*
|
||||
* Tab control
|
||||
*
|
||||
* Copyright 1998 Anders Carlsson
|
||||
*
|
||||
* TODO:
|
||||
* Image list support
|
||||
* Multiline support
|
||||
* Unicode support
|
||||
* Updown control support
|
||||
* Look and feel
|
||||
* Messages to be added in commctrl.h
|
||||
* ...
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "tab.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#define TAB_GetInfoPtr(wndPtr) ((TAB_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
static BOOL32
|
||||
TAB_SendSimpleNotify (WND *wndPtr, UINT32 code)
|
||||
{
|
||||
NMHDR nmhdr;
|
||||
|
||||
nmhdr.hwndFrom = wndPtr->hwndSelf;
|
||||
nmhdr.idFrom = wndPtr->wIDmenu;
|
||||
nmhdr.code = code;
|
||||
|
||||
return (BOOL32) SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
|
||||
(WPARAM32) nmhdr.idFrom, (LPARAM) &nmhdr);
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TAB_GetCurSel (WND *wndPtr)
|
||||
{
|
||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->iSelected;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TAB_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
|
||||
POINT32 pt;
|
||||
RECT32 rect;
|
||||
INT32 iCount;
|
||||
|
||||
pt.x = (INT32)LOWORD(lParam);
|
||||
pt.y = (INT32)HIWORD(lParam);
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
|
||||
if (PtInRect32 (&rect, pt))
|
||||
{
|
||||
for (iCount = 0; iCount < infoPtr->uNumItem; iCount++) {
|
||||
rect = infoPtr->items[iCount].rect;
|
||||
if (PtInRect32 (&rect, pt)) {
|
||||
TRACE(tab, "On Tab, item %d\n", iCount);
|
||||
|
||||
if (infoPtr->iSelected != iCount) {
|
||||
infoPtr->iSelected = iCount;
|
||||
|
||||
TAB_SendSimpleNotify(wndPtr, TCN_SELCHANGE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
TAB_SetItemBounds (WND *wndPtr)
|
||||
{
|
||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
|
||||
RECT32 rect;
|
||||
HFONT32 hFont, hOldFont;
|
||||
INT32 i, left;
|
||||
SIZE32 size;
|
||||
HDC32 hdc;
|
||||
|
||||
/* FIXME: Is this needed? */
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
|
||||
hdc = GetDC32(wndPtr->hwndSelf);
|
||||
|
||||
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject32 (SYSTEM_FONT);
|
||||
hOldFont = SelectObject32 (hdc, hFont);
|
||||
|
||||
left = rect.left;
|
||||
|
||||
for (i = 0; i < infoPtr->uNumItem; i++)
|
||||
{
|
||||
infoPtr->items[i].rect.left = left;
|
||||
infoPtr->items[i].rect.top = infoPtr->rect.top;
|
||||
|
||||
GetTextExtentPoint32A(hdc,
|
||||
infoPtr->items[i].pszText,
|
||||
lstrlen32A(infoPtr->items[i].pszText), &size);
|
||||
infoPtr->items[i].rect.right = left + size.cx+2*5;
|
||||
infoPtr->items[i].rect.bottom = infoPtr->rect.top + 20;
|
||||
TRACE(tab, "TextSize: %i - ", size.cx);
|
||||
TRACE(tab, "Rect: T %i, L %i, B %i, R %i\n",
|
||||
infoPtr->items[i].rect.top,
|
||||
infoPtr->items[i].rect.left,
|
||||
infoPtr->items[i].rect.bottom,
|
||||
infoPtr->items[i].rect.right);
|
||||
left += (size.cx + 11);
|
||||
}
|
||||
|
||||
SelectObject32 (hdc, hOldFont);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
static void
|
||||
TAB_DrawItem (WND *wndPtr, HDC32 hdc, INT32 iItem)
|
||||
{
|
||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
|
||||
TAB_ITEM *pti = &infoPtr->items[iItem];
|
||||
RECT32 r;
|
||||
INT32 oldBkMode;
|
||||
|
||||
HPEN32 hwPen = CreatePen32 (PS_SOLID, 1, RGB (255, 255, 255 ));
|
||||
HPEN32 hbPen = CreatePen32 (PS_SOLID, 1, GetSysColor32 (COLOR_BTNSHADOW));
|
||||
HPEN32 hsdPen = CreatePen32(PS_SOLID, 1, GetSysColor32 (COLOR_BTNTEXT));
|
||||
HPEN32 htmpPen = (HPEN32)NULL;
|
||||
|
||||
CopyRect32(&r, &pti->rect);
|
||||
|
||||
htmpPen = hwPen;
|
||||
htmpPen = SelectObject32 (hdc, htmpPen);
|
||||
MoveToEx32 (hdc, r.left, r.bottom, NULL);
|
||||
LineTo32 (hdc, r.left, r.top + 2);
|
||||
LineTo32 (hdc, r.left +2, r.top);
|
||||
|
||||
LineTo32 (hdc, r.right -1, r.top);
|
||||
htmpPen = SelectObject32 (hdc, htmpPen);
|
||||
|
||||
htmpPen = SelectObject32 (hdc, hbPen);
|
||||
MoveToEx32 (hdc, r.right-1, r.top, NULL);
|
||||
LineTo32 (hdc,r.right-1, r.bottom-1);
|
||||
hbPen = SelectObject32 (hdc, hsdPen);
|
||||
MoveToEx32 (hdc, r.right, r.top+1, NULL);
|
||||
LineTo32(hdc, r.right,r.bottom);
|
||||
hsdPen = SelectObject32(hdc,htmpPen);
|
||||
DeleteObject32(hwPen);
|
||||
DeleteObject32(hbPen);
|
||||
DeleteObject32(hsdPen);
|
||||
|
||||
oldBkMode = SetBkMode32(hdc, TRANSPARENT);
|
||||
r.left += 3;
|
||||
r.right -= 3;
|
||||
SetTextColor32 (hdc, COLOR_BTNTEXT);
|
||||
DrawText32A(hdc, pti->pszText, lstrlen32A(pti->pszText),
|
||||
&r, DT_LEFT|DT_SINGLELINE|DT_VCENTER);
|
||||
if (oldBkMode != TRANSPARENT)
|
||||
SetBkMode32(hdc, oldBkMode);
|
||||
}
|
||||
|
||||
static void
|
||||
TAB_DrawBorder (WND *wndPtr, HDC32 hdc)
|
||||
{
|
||||
HPEN32 htmPen;
|
||||
HPEN32 hwPen = GetStockObject32(WHITE_PEN);
|
||||
HPEN32 hbPen = GetStockObject32(BLACK_PEN);
|
||||
HPEN32 hShade = CreatePen32 ( PS_SOLID, 1, GetSysColor32 (COLOR_BTNSHADOW));
|
||||
RECT32 rect;
|
||||
|
||||
htmPen = SelectObject32 (hdc, hwPen);
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
|
||||
MoveToEx32 (hdc, rect.left, rect.bottom, NULL);
|
||||
LineTo32 (hdc, rect.left, rect.top+20);
|
||||
|
||||
LineTo32 (hdc, rect.right, rect.top+20);
|
||||
|
||||
hwPen = SelectObject32 (hdc, htmPen);
|
||||
LineTo32 (hdc, rect.right, rect.bottom );
|
||||
LineTo32 (hdc, rect.left, rect.bottom);
|
||||
hbPen = SelectObject32 (hdc, hShade );
|
||||
MoveToEx32 (hdc, rect.right-1, rect.top+20, NULL);
|
||||
LineTo32 (hdc, rect.right-1, rect.bottom-1);
|
||||
LineTo32 (hdc, rect.left, rect.bottom-1);
|
||||
hShade = SelectObject32(hdc, hShade);
|
||||
DeleteObject32 (hShade);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
TAB_Refresh (WND *wndPtr, HDC32 hdc)
|
||||
{
|
||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
|
||||
HFONT32 hFont, hOldFont;
|
||||
RECT32 rect;
|
||||
HBRUSH32 hbrBk;
|
||||
INT32 i;
|
||||
|
||||
TAB_DrawBorder (wndPtr, hdc);
|
||||
|
||||
for (i = 0; i < infoPtr->uNumItem; i++) {
|
||||
TAB_DrawItem (wndPtr, hdc, i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TAB_Paint (WND *wndPtr, WPARAM32 wParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
PAINTSTRUCT32 ps;
|
||||
|
||||
hdc = wParam== 0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
|
||||
TAB_Refresh (wndPtr, hdc);
|
||||
|
||||
if(!wParam)
|
||||
EndPaint32 (wndPtr->hwndSelf, &ps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TAB_InsertItem (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
|
||||
TCITEM *pti;
|
||||
HDC32 hdc;
|
||||
INT32 iItem, len;
|
||||
|
||||
pti = (TCITEM*)lParam;
|
||||
iItem = (INT32)wParam;
|
||||
|
||||
if (iItem < 0) return -1;
|
||||
if (iItem > infoPtr->uNumItem)
|
||||
iItem = infoPtr->uNumItem;
|
||||
|
||||
if (infoPtr->uNumItem == 0) {
|
||||
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof (TAB_ITEM));
|
||||
infoPtr->uNumItem++;
|
||||
}
|
||||
else {
|
||||
TAB_ITEM *oldItems = infoPtr->items;
|
||||
|
||||
infoPtr->uNumItem++;
|
||||
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof (TAB_ITEM) * infoPtr->uNumItem);
|
||||
|
||||
/* pre insert copy */
|
||||
if (iItem > 0) {
|
||||
memcpy (&infoPtr->items[0], &oldItems[0],
|
||||
iItem * sizeof(TAB_ITEM));
|
||||
}
|
||||
|
||||
/* post insert copy */
|
||||
if (iItem < infoPtr->uNumItem - 1) {
|
||||
memcpy (&infoPtr->items[iItem+1], &oldItems[iItem],
|
||||
(infoPtr->uNumItem - iItem) * sizeof(TAB_ITEM));
|
||||
|
||||
}
|
||||
|
||||
HeapFree (GetProcessHeap (), 0, oldItems);
|
||||
}
|
||||
|
||||
infoPtr->items[iItem].mask = pti->mask;
|
||||
if (pti->mask & TCIF_TEXT) {
|
||||
len = lstrlen32A (pti->pszText);
|
||||
infoPtr->items[iItem].pszText =
|
||||
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
|
||||
lstrcpy32A (infoPtr->items[iItem].pszText, pti->pszText);
|
||||
infoPtr->items[iItem].cchTextMax = pti->cchTextMax;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (pti->mask & TCIF_IMAGE)
|
||||
infoPtr->items[iItem].iImage = pti->iImage;
|
||||
|
||||
if (pti->mask & TCIF_PARAM)
|
||||
infoPtr->items[iItem].lParam = pti->lParam;
|
||||
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TAB_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
TRACE(tab, "[%04x]: added item %d '%s'\n",
|
||||
wndPtr->hwndSelf, iItem, infoPtr->items[iItem].pszText);
|
||||
|
||||
TAB_SetItemBounds(wndPtr);
|
||||
return iItem;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TAB_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TAB_INFO *infoPtr;
|
||||
|
||||
infoPtr = (TAB_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof(TAB_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
infoPtr->uNumItem = 0;
|
||||
infoPtr->hFont = 0;
|
||||
infoPtr->items = 0;
|
||||
infoPtr->hcurArrow = LoadCursor32A (0, IDC_ARROW32A);
|
||||
infoPtr->iSelected = -1;
|
||||
|
||||
TRACE(tab, "Created tab control, hwnd [%04x]\n", wndPtr->hwndSelf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
TAB_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(wndPtr);
|
||||
INT32 iItem;
|
||||
|
||||
if (infoPtr->items) {
|
||||
for (iItem = 0; iItem < infoPtr->uNumItem; iItem++) {
|
||||
if (infoPtr->items[iItem].pszText)
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
|
||||
}
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr->items);
|
||||
}
|
||||
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT WINAPI
|
||||
TAB_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
|
||||
case TCM_GETCURSEL:
|
||||
return TAB_GetCurSel (wndPtr);
|
||||
|
||||
case TCM_INSERTITEM:
|
||||
return TAB_InsertItem (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_CREATE:
|
||||
return TAB_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return TAB_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
return TAB_LButtonUp (wndPtr, wParam, lParam);
|
||||
case WM_PAINT:
|
||||
return TAB_Paint (wndPtr, wParam);
|
||||
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (tab, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TAB_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (WC_TABCONTROL32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)TAB_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(TAB_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = 0;
|
||||
wndClass.lpszClassName = WC_TABCONTROL32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
* - Tooltip support (almost complete).
|
||||
* - Unicode suppport.
|
||||
* - Internal COMMCTL32 bitmaps.
|
||||
* - Fix TOOLBAR_SetButtonInfo32A.
|
||||
* - Fix TOOLBAR_Customize. (Customize dialog.)
|
||||
*
|
||||
* Testing:
|
||||
|
@ -26,6 +27,7 @@
|
|||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "sysmetrics.h"
|
||||
#include "commctrl.h"
|
||||
#include "cache.h"
|
||||
#include "toolbar.h"
|
||||
|
@ -151,8 +153,12 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
|
|||
if ((btnPtr->fsStyle & TBSTYLE_CHECK) &&
|
||||
(btnPtr->fsState & TBSTATE_CHECKED)) {
|
||||
HBRUSH32 hbr;
|
||||
DrawEdge32 (hdc, &rc, EDGE_SUNKEN,
|
||||
BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||
if (bFlat)
|
||||
DrawEdge32 (hdc, &rc, BDR_SUNKENOUTER,
|
||||
BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||
else
|
||||
DrawEdge32 (hdc, &rc, EDGE_SUNKEN,
|
||||
BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||
|
||||
hbr = SelectObject32 (hdc, CACHE_GetPattern55AABrush ());
|
||||
PatBlt32 (hdc, rc.left, rc.top, rc.right - rc.left,
|
||||
|
@ -248,7 +254,6 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
|
|||
INT32 x, y, cx, cy;
|
||||
BOOL32 bVertical;
|
||||
SIZE32 sizeString;
|
||||
RECT32 rect = {0, 0, 0, 0};
|
||||
|
||||
TOOLBAR_CalcStrings (wndPtr, &sizeString);
|
||||
|
||||
|
@ -267,10 +272,11 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
|
|||
cx = infoPtr->nButtonWidth;
|
||||
cy = infoPtr->nButtonHeight;
|
||||
nRows = 1;
|
||||
rect.top = y;
|
||||
rect.left = x;
|
||||
rect.bottom = y + cy;
|
||||
rect.right = x;
|
||||
|
||||
infoPtr->rcBound.top = y;
|
||||
infoPtr->rcBound.left = x;
|
||||
infoPtr->rcBound.bottom = y + cy;
|
||||
infoPtr->rcBound.right = x;
|
||||
|
||||
btnPtr = infoPtr->buttons;
|
||||
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) {
|
||||
|
@ -300,7 +306,6 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
|
|||
else {
|
||||
/* this must be a button */
|
||||
cx = infoPtr->nButtonWidth;
|
||||
|
||||
}
|
||||
|
||||
btnPtr->rect.left = x;
|
||||
|
@ -308,12 +313,12 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
|
|||
btnPtr->rect.right = x + cx;
|
||||
btnPtr->rect.bottom = y + cy;
|
||||
|
||||
if (rect.left > x)
|
||||
rect.left = x;
|
||||
if (rect.right < x + cx)
|
||||
rect.right = x + cx;
|
||||
if (rect.bottom < y + cy)
|
||||
rect.bottom = y + cy;
|
||||
if (infoPtr->rcBound.left > x)
|
||||
infoPtr->rcBound.left = x;
|
||||
if (infoPtr->rcBound.right < x + cx)
|
||||
infoPtr->rcBound.right = x + cx;
|
||||
if (infoPtr->rcBound.bottom < y + cy)
|
||||
infoPtr->rcBound.bottom = y + cy;
|
||||
|
||||
if (infoPtr->hwndToolTip) {
|
||||
TTTOOLINFO32A ti;
|
||||
|
@ -338,8 +343,6 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
|
|||
}
|
||||
|
||||
infoPtr->nHeight = y + cy + BOTTOM_BORDER;
|
||||
infoPtr->maxSize.cx = rect.right - rect.left;
|
||||
infoPtr->maxSize.cy = rect.bottom - rect.top;
|
||||
TRACE (toolbar, "toolbar height %d\n", infoPtr->nHeight);
|
||||
}
|
||||
|
||||
|
@ -550,22 +553,23 @@ TOOLBAR_AddButtons32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
infoPtr->nNumButtons = nNewButtons;
|
||||
|
||||
/* insert new button data (bad implementation)*/
|
||||
/* insert new button data */
|
||||
for (nCount = 0; nCount < nAddButtons; nCount++) {
|
||||
infoPtr->buttons[nOldButtons+nCount].iBitmap = lpTbb[nCount].iBitmap;
|
||||
infoPtr->buttons[nOldButtons+nCount].idCommand = lpTbb[nCount].idCommand;
|
||||
infoPtr->buttons[nOldButtons+nCount].fsState = lpTbb[nCount].fsState;
|
||||
infoPtr->buttons[nOldButtons+nCount].fsStyle = lpTbb[nCount].fsStyle;
|
||||
infoPtr->buttons[nOldButtons+nCount].dwData = lpTbb[nCount].dwData;
|
||||
infoPtr->buttons[nOldButtons+nCount].iString = lpTbb[nCount].iString;
|
||||
TBUTTON_INFO *btnPtr = &infoPtr->buttons[nOldButtons+nCount];
|
||||
btnPtr->iBitmap = lpTbb[nCount].iBitmap;
|
||||
btnPtr->idCommand = lpTbb[nCount].idCommand;
|
||||
btnPtr->fsState = lpTbb[nCount].fsState;
|
||||
btnPtr->fsStyle = lpTbb[nCount].fsStyle;
|
||||
btnPtr->dwData = lpTbb[nCount].dwData;
|
||||
btnPtr->iString = lpTbb[nCount].iString;
|
||||
|
||||
if ((infoPtr->hwndToolTip) && !(lpTbb[nCount].fsStyle & TBSTYLE_SEP)) {
|
||||
if ((infoPtr->hwndToolTip) && !(btnPtr->fsStyle & TBSTYLE_SEP)) {
|
||||
TTTOOLINFO32A ti;
|
||||
|
||||
ZeroMemory (&ti, sizeof(TTTOOLINFO32A));
|
||||
ti.cbSize = sizeof (TTTOOLINFO32A);
|
||||
ti.hwnd = wndPtr->hwndSelf;
|
||||
ti.uId = lpTbb[nCount].idCommand;
|
||||
ti.uId = btnPtr->idCommand;
|
||||
ti.hinst = 0;
|
||||
ti.lpszText = LPSTR_TEXTCALLBACK32A;
|
||||
|
||||
|
@ -672,7 +676,7 @@ TOOLBAR_AutoSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
INT32 x, y, cx, cy;
|
||||
UINT32 uPosFlags = 0;
|
||||
|
||||
TRACE (toolbar, "resizing!\n");
|
||||
TRACE (toolbar, "resize forced!\n");
|
||||
|
||||
parent = GetParent32 (wndPtr->hwndSelf);
|
||||
GetClientRect32(parent, &parent_rect);
|
||||
|
@ -693,7 +697,7 @@ TOOLBAR_AutoSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
uPosFlags |= SWP_NOMOVE;
|
||||
|
||||
if (!(wndPtr->dwStyle & CCS_NODIVIDER))
|
||||
cy += 2;
|
||||
cy += sysMetrics[SM_CYEDGE];
|
||||
|
||||
infoPtr->bAutoSize = TRUE;
|
||||
SetWindowPos32 (wndPtr->hwndSelf, HWND_TOP, parent_rect.left, parent_rect.top,
|
||||
|
@ -960,7 +964,6 @@ TOOLBAR_GetButtonInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lpTbInfo->cbSize < sizeof(LPTBBUTTONINFO32A)) return -1;
|
||||
|
||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT32)wParam);
|
||||
|
||||
if (nIndex == -1)
|
||||
return -1;
|
||||
|
||||
|
@ -968,22 +971,16 @@ TOOLBAR_GetButtonInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
if (lpTbInfo->dwMask & TBIF_COMMAND)
|
||||
lpTbInfo->idCommand = btnPtr->idCommand;
|
||||
|
||||
if (lpTbInfo->dwMask & TBIF_IMAGE)
|
||||
lpTbInfo->iImage = btnPtr->iBitmap;
|
||||
|
||||
if (lpTbInfo->dwMask & TBIF_LPARAM)
|
||||
lpTbInfo->lParam = btnPtr->dwData;
|
||||
|
||||
if (lpTbInfo->dwMask & TBIF_SIZE)
|
||||
lpTbInfo->cx = (WORD)(btnPtr->rect.right - btnPtr->rect.left);
|
||||
|
||||
if (lpTbInfo->dwMask & TBIF_STATE)
|
||||
lpTbInfo->fsState = btnPtr->fsState;
|
||||
|
||||
if (lpTbInfo->dwMask & TBIF_STYLE)
|
||||
lpTbInfo->fsStyle = btnPtr->fsStyle;
|
||||
|
||||
if (lpTbInfo->dwMask & TBIF_TEXT) {
|
||||
if ((btnPtr->iString >= 0) || (btnPtr->iString < infoPtr->nNumStrings))
|
||||
lstrcpyn32A (lpTbInfo->pszText,
|
||||
|
@ -1124,11 +1121,12 @@ TOOLBAR_GetMaxSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lpSize == NULL)
|
||||
return FALSE;
|
||||
|
||||
lpSize->cx = infoPtr->maxSize.cx;
|
||||
lpSize->cx = infoPtr->maxSize.cy;
|
||||
lpSize->cx = infoPtr->rcBound.right - infoPtr->rcBound.left;
|
||||
lpSize->cy = infoPtr->rcBound.bottom - infoPtr->rcBound.top;
|
||||
|
||||
TRACE (toolbar, "maximum size %d x %d\n",
|
||||
infoPtr->maxSize.cx, infoPtr->maxSize.cy);
|
||||
infoPtr->rcBound.right - infoPtr->rcBound.left,
|
||||
infoPtr->rcBound.bottom - infoPtr->rcBound.top);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1532,7 +1530,56 @@ TOOLBAR_SetBitmapSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
// << TOOLBAR_SetButtonInfo >>
|
||||
static LRESULT
|
||||
TOOLBAR_SetButtonInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
|
||||
LPTBBUTTONINFO32A lptbbi = (LPTBBUTTONINFO32A)lParam;
|
||||
TBUTTON_INFO *btnPtr;
|
||||
INT32 nIndex;
|
||||
|
||||
if (lptbbi == NULL)
|
||||
return FALSE;
|
||||
if (lptbbi->cbSize < sizeof(LPTBBUTTONINFO32A))
|
||||
return FALSE;
|
||||
|
||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT32)wParam);
|
||||
if (nIndex == -1)
|
||||
return FALSE;
|
||||
|
||||
btnPtr = &infoPtr->buttons[nIndex];
|
||||
if (lptbbi->dwMask & TBIF_COMMAND)
|
||||
btnPtr->idCommand = lptbbi->idCommand;
|
||||
if (lptbbi->dwMask & TBIF_IMAGE)
|
||||
btnPtr->iBitmap = lptbbi->iImage;
|
||||
if (lptbbi->dwMask & TBIF_LPARAM)
|
||||
btnPtr->dwData = lptbbi->lParam;
|
||||
// if (lptbbi->dwMask & TBIF_SIZE)
|
||||
// btnPtr->cx = lptbbi->cx;
|
||||
if (lptbbi->dwMask & TBIF_STATE)
|
||||
btnPtr->fsState = lptbbi->fsState;
|
||||
if (lptbbi->dwMask & TBIF_STYLE)
|
||||
btnPtr->fsStyle = lptbbi->fsStyle;
|
||||
|
||||
if (lptbbi->dwMask & TBIF_TEXT) {
|
||||
if ((btnPtr->iString >= 0) ||
|
||||
(btnPtr->iString < infoPtr->nNumStrings)) {
|
||||
#if 0
|
||||
CHAR *lpString = infoPtr->strings[btnPtr->iString];
|
||||
INT32 len = lstrlen32A (lptbbi->pszText);
|
||||
|
||||
lpString = HeapReAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(char)*(len+1));
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// << TOOLBAR_SetButtonInfo32W >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
|
@ -1729,8 +1776,30 @@ static LRESULT
|
|||
TOOLBAR_SetRows (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
|
||||
LPRECT32 lprc = (LPRECT32)lParam;
|
||||
HDC32 hdc;
|
||||
|
||||
FIXME (toolbar, "support multiple rows!\n");
|
||||
if (LOWORD(wParam) > 1) {
|
||||
|
||||
FIXME (toolbar, "multiple rows not supported!\n");
|
||||
|
||||
}
|
||||
|
||||
/* recalculate toolbar */
|
||||
TOOLBAR_CalcToolbar (wndPtr);
|
||||
|
||||
/* return bounding rectangle */
|
||||
if (lprc) {
|
||||
lprc->left = infoPtr->rcBound.left;
|
||||
lprc->right = infoPtr->rcBound.right;
|
||||
lprc->top = infoPtr->rcBound.top;
|
||||
lprc->bottom = infoPtr->rcBound.bottom;
|
||||
}
|
||||
|
||||
/* repaint toolbar */
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TOOLBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1788,7 +1857,7 @@ TOOLBAR_SetStyle (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLBAR_SetToolTips (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
|
||||
|
@ -1997,7 +2066,6 @@ TOOLBAR_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2113,13 +2181,11 @@ TOOLBAR_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
// << TOOLBAR_NCActivate >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLBAR_NCCalcSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
if (!(wndPtr->dwStyle & CCS_NODIVIDER)) {
|
||||
LPRECT32 winRect = (LPRECT32)lParam;
|
||||
winRect->top += 2;
|
||||
}
|
||||
if (!(wndPtr->dwStyle & CCS_NODIVIDER))
|
||||
((LPRECT32)lParam)->top += sysMetrics[SM_CYEDGE];
|
||||
|
||||
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCALCSIZE, wParam, lParam);
|
||||
}
|
||||
|
@ -2159,9 +2225,8 @@ TOOLBAR_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
static LRESULT
|
||||
TOOLBAR_NCPaint (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
RECT32 rect;
|
||||
HWND32 hwnd = wndPtr->hwndSelf;
|
||||
HDC32 hdc;
|
||||
|
||||
if ( wndPtr->dwStyle & WS_MINIMIZE ||
|
||||
!WIN_IsWindowDrawable( wndPtr, 0 )) return 0; /* Nothing to do */
|
||||
|
@ -2179,22 +2244,8 @@ TOOLBAR_NCPaint (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!(wndPtr->flags & WIN_MANAGED)) {
|
||||
if (!(wndPtr->dwStyle & CCS_NODIVIDER)) {
|
||||
rect.left = wndPtr->rectClient.left;
|
||||
rect.top = wndPtr->rectClient.top - 2;
|
||||
rect.right = wndPtr->rectClient.right;
|
||||
|
||||
SelectObject32 ( hdc, GetSysColorPen32 (COLOR_3DSHADOW));
|
||||
MoveToEx32 (hdc, rect.left, rect.top, NULL);
|
||||
LineTo32 (hdc, rect.right, rect.top);
|
||||
rect.top++;
|
||||
SelectObject32 ( hdc, GetSysColorPen32 (COLOR_3DHILIGHT));
|
||||
MoveToEx32 (hdc, rect.left, rect.top, NULL);
|
||||
LineTo32 (hdc, rect.right, rect.top);
|
||||
}
|
||||
|
||||
}
|
||||
if (!(wndPtr->flags & WIN_MANAGED) && !(wndPtr->dwStyle & CCS_NODIVIDER))
|
||||
DrawEdge32 (hdc, &wndPtr->rectWindow, EDGE_ETCHED, BF_TOP);
|
||||
|
||||
ReleaseDC32( hwnd, hdc );
|
||||
|
||||
|
@ -2301,7 +2352,7 @@ TOOLBAR_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
if (!(wndPtr->dwStyle & CCS_NODIVIDER))
|
||||
cy += 2;
|
||||
cy += sysMetrics[SM_CYEDGE];
|
||||
|
||||
SetWindowPos32 (wndPtr->hwndSelf, 0, parent_rect.left, parent_rect.top,
|
||||
cx, cy, uPosFlags | SWP_NOZORDER);
|
||||
|
@ -2310,8 +2361,19 @@ TOOLBAR_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TOOLBAR_StyleChanged (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
|
||||
TOOLBAR_AutoSize (wndPtr, wParam, lParam);
|
||||
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TOOLBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -2487,7 +2549,9 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
case TB_SETBITMAPSIZE:
|
||||
return TOOLBAR_SetBitmapSize (wndPtr, wParam, lParam);
|
||||
|
||||
// case TB_SETBUTTONINFO32A: /* 4.71 */
|
||||
case TB_SETBUTTONINFO32A:
|
||||
return TOOLBAR_SetButtonInfo32A (wndPtr, wParam, lParam);
|
||||
|
||||
// case TB_SETBUTTONINFO32W: /* 4.71 */
|
||||
|
||||
case TB_SETBUTTONSIZE:
|
||||
|
@ -2554,8 +2618,6 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
case WM_CREATE:
|
||||
return TOOLBAR_Create (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_COMMAND:
|
||||
|
||||
case WM_DESTROY:
|
||||
return TOOLBAR_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
|
@ -2601,6 +2663,9 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
case WM_SIZE:
|
||||
return TOOLBAR_Size (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_STYLECHANGED:
|
||||
return TOOLBAR_StyleChanged (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_SYSCOLORCHANGE:
|
||||
|
||||
// case WM_WININICHANGE:
|
|
@ -29,7 +29,9 @@
|
|||
#define ID_TIMER1 1 /* show delay timer */
|
||||
#define ID_TIMER2 2 /* auto pop timer */
|
||||
#define ID_TIMER3 3 /* tool leave timer */
|
||||
#define TT_SUBCLASS_PROP "CC32SubclassInfo" /* property name of tooltip window handle */
|
||||
|
||||
/* property name of tooltip window handle */
|
||||
#define TT_SUBCLASS_PROP "CC32SubclassInfo"
|
||||
|
||||
#define TOOLTIPS_GetInfoPtr(wndPtr) ((TOOLTIPS_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
@ -160,6 +162,7 @@ TOOLTIPS_CalcTipSize (WND *wndPtr, TOOLTIPS_INFO *infoPtr, LPSIZE32 lpSize)
|
|||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
hOldFont = SelectObject32 (hdc, infoPtr->hFont);
|
||||
DrawText32A (hdc, infoPtr->szTipText, -1, &rc, uFlags);
|
||||
GetTextExtentPoint32A (hdc, infoPtr->szTipText, lstrlen32A(infoPtr->szTipText), lpSize);
|
||||
SelectObject32 (hdc, hOldFont);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
|
@ -337,8 +340,8 @@ TOOLTIPS_GetToolFromMessage (TOOLTIPS_INFO *infoPtr, HWND32 hwndTool)
|
|||
}
|
||||
|
||||
|
||||
static BOOL32
|
||||
TOOLTIPS_CheckTool (WND *wndPtr)
|
||||
static INT32
|
||||
TOOLTIPS_CheckTool (WND *wndPtr, BOOL32 bShowTest)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
POINT32 pt;
|
||||
|
@ -349,13 +352,23 @@ TOOLTIPS_CheckTool (WND *wndPtr)
|
|||
hwndTool =
|
||||
SendMessage32A (wndPtr->hwndSelf, TTM_WINDOWFROMPOINT, 0, (LPARAM)&pt);
|
||||
if (hwndTool == 0)
|
||||
return FALSE;
|
||||
return -1;
|
||||
|
||||
ScreenToClient32 (hwndTool, &pt);
|
||||
nTool = TOOLTIPS_GetToolFromPoint (infoPtr, hwndTool, &pt);
|
||||
if (nTool == -1)
|
||||
return -1;
|
||||
|
||||
#if 0
|
||||
if (!(wndPtr->dwStyle & TTS_ALWAYSTIP) && bShowTest) {
|
||||
if (!IsWindowEnabled32 (infoPtr->tools[infoPtr->nTool].hwnd))
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE (tooltips, "tool %d\n", nTool);
|
||||
|
||||
return (nTool != -1);
|
||||
return nTool;
|
||||
}
|
||||
|
||||
|
||||
|
@ -383,7 +396,10 @@ TOOLTIPS_AddTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
|
||||
TTTOOL_INFO *toolPtr;
|
||||
|
||||
if (lpToolInfo == NULL) return FALSE;
|
||||
if (lpToolInfo == NULL)
|
||||
return FALSE;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return FALSE;
|
||||
|
||||
TRACE (tooltips, "add tool (%x) %x %d%s!\n",
|
||||
wndPtr->hwndSelf, lpToolInfo->hwnd, lpToolInfo->uId,
|
||||
|
@ -436,7 +452,7 @@ TOOLTIPS_AddTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFO32A))
|
||||
toolPtr->lParam = lpToolInfo->lParam;
|
||||
|
||||
/* install subclassing */
|
||||
/* install subclassing hook */
|
||||
if (toolPtr->uFlags & TTF_SUBCLASS) {
|
||||
if (toolPtr->uFlags & TTF_IDISHWND) {
|
||||
LPTT_SUBCLASS_INFO lpttsi =
|
||||
|
@ -453,7 +469,7 @@ TOOLTIPS_AddTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
(HANDLE32)lpttsi);
|
||||
}
|
||||
else
|
||||
ERR (tooltips, "A window tool must only be listed once!\n");
|
||||
WARN (tooltips, "A window tool must only be listed once!\n");
|
||||
}
|
||||
else {
|
||||
LPTT_SUBCLASS_INFO lpttsi =
|
||||
|
@ -489,8 +505,12 @@ TOOLTIPS_DelTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
TTTOOL_INFO *toolPtr;
|
||||
INT32 nTool;
|
||||
|
||||
if (lpToolInfo == NULL) return 0;
|
||||
if (infoPtr->uNumTools == 0) return 0;
|
||||
if (lpToolInfo == NULL)
|
||||
return 0;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return 0;
|
||||
if (infoPtr->uNumTools == 0)
|
||||
return 0;
|
||||
|
||||
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
|
||||
if (nTool == -1) return 0;
|
||||
|
@ -575,8 +595,12 @@ TOOLTIPS_EnumTools32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
|
||||
TTTOOL_INFO *toolPtr;
|
||||
|
||||
if (uIndex >= infoPtr->uNumTools) return FALSE;
|
||||
if (lpToolInfo == NULL) return FALSE;
|
||||
if (lpToolInfo == NULL)
|
||||
return FALSE;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return FALSE;
|
||||
if (uIndex >= infoPtr->uNumTools)
|
||||
return FALSE;
|
||||
|
||||
TRACE (tooltips, "index=%u\n", uIndex);
|
||||
|
||||
|
@ -604,21 +628,26 @@ static LRESULT
|
|||
TOOLTIPS_GetCurrentTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
LPTTTOOLINFO32A lpti = (LPTTTOOLINFO32A)lParam;
|
||||
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
|
||||
TTTOOL_INFO *toolPtr;
|
||||
|
||||
if (lpti) {
|
||||
if (lpToolInfo == NULL)
|
||||
return FALSE;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return FALSE;
|
||||
|
||||
if (lpToolInfo) {
|
||||
if (infoPtr->nCurrentTool > -1) {
|
||||
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
|
||||
|
||||
/* copy tool data */
|
||||
lpti->uFlags = toolPtr->uFlags;
|
||||
lpti->rect = toolPtr->rect;
|
||||
lpti->hinst = toolPtr->hinst;
|
||||
lpti->lpszText = toolPtr->lpszText;
|
||||
lpToolInfo->uFlags = toolPtr->uFlags;
|
||||
lpToolInfo->rect = toolPtr->rect;
|
||||
lpToolInfo->hinst = toolPtr->hinst;
|
||||
lpToolInfo->lpszText = toolPtr->lpszText;
|
||||
|
||||
if (lpti->cbSize >= sizeof(TTTOOLINFO32A))
|
||||
lpti->lParam = toolPtr->lParam;
|
||||
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFO32A))
|
||||
lpToolInfo->lParam = toolPtr->lParam;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -673,7 +702,7 @@ TOOLTIPS_GetMargin (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_GetMaxTipWidth (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -686,16 +715,18 @@ static LRESULT
|
|||
TOOLTIPS_GetText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
LPTTTOOLINFO32A lpti = (LPTTTOOLINFO32A)lParam;
|
||||
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
|
||||
INT32 nTool;
|
||||
|
||||
if (!(lpti)) return 0;
|
||||
if (lpti->cbSize < sizeof(TTTOOLINFO32A)) return 0;
|
||||
if (lpToolInfo == NULL)
|
||||
return 0;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return 0;
|
||||
|
||||
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpti);
|
||||
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
|
||||
if (nTool == -1) return 0;
|
||||
|
||||
lstrcpy32A (lpti->lpszText, infoPtr->tools[nTool].lpszText);
|
||||
lstrcpy32A (lpToolInfo->lpszText, infoPtr->tools[nTool].lpszText);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -704,7 +735,7 @@ TOOLTIPS_GetText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
// << TOOLTIPS_GetText32W >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_GetTipBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -712,7 +743,7 @@ TOOLTIPS_GetTipBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_GetTipTextColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -720,7 +751,7 @@ TOOLTIPS_GetTipTextColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_GetToolCount (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -736,8 +767,12 @@ TOOLTIPS_GetToolInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
TTTOOL_INFO *toolPtr;
|
||||
INT32 nTool;
|
||||
|
||||
if (lpToolInfo == NULL) return FALSE;
|
||||
if (infoPtr->uNumTools == 0) return FALSE;
|
||||
if (lpToolInfo == NULL)
|
||||
return FALSE;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return FALSE;
|
||||
if (infoPtr->uNumTools == 0)
|
||||
return FALSE;
|
||||
|
||||
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
|
||||
if (nTool == -1) return FALSE;
|
||||
|
@ -804,10 +839,10 @@ TOOLTIPS_NewToolRect32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
LPTTTOOLINFO32A lpti = (LPTTTOOLINFO32A)lParam;
|
||||
INT32 nTool;
|
||||
|
||||
if (!(lpti)) return 0;
|
||||
#if 0
|
||||
if (lpti->cbSize < sizeof(TTTOOLINFO32A)) return 0;
|
||||
#endif
|
||||
if (lpti == NULL)
|
||||
return 0;
|
||||
if (lpti->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return FALSE;
|
||||
|
||||
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpti);
|
||||
if (nTool == -1) return 0;
|
||||
|
@ -821,7 +856,7 @@ TOOLTIPS_NewToolRect32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
// << TOOLTIPS_NewToolRect32W >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_Pop (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -839,7 +874,7 @@ TOOLTIPS_RelayEvent (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
LPMSG32 lpMsg = (LPMSG32)lParam;
|
||||
POINT32 pt;
|
||||
|
||||
if (lParam == NULL) {
|
||||
if (lParam == 0) {
|
||||
ERR (tooltips, "lpMsg == NULL!\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -947,7 +982,7 @@ TOOLTIPS_SetMargin (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_SetMaxTipWidth (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -959,7 +994,7 @@ TOOLTIPS_SetMaxTipWidth (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_SetTipBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -970,7 +1005,7 @@ TOOLTIPS_SetTipBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
__inline__ static LRESULT
|
||||
TOOLTIPS_SetTipTextColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
|
@ -989,7 +1024,10 @@ TOOLTIPS_SetToolInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
TTTOOL_INFO *toolPtr;
|
||||
INT32 nTool;
|
||||
|
||||
if (lpToolInfo == NULL) return 0;
|
||||
if (lpToolInfo == NULL)
|
||||
return 0;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return 0;
|
||||
|
||||
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
|
||||
if (nTool == -1) return 0;
|
||||
|
@ -1036,18 +1074,23 @@ TOOLTIPS_TrackActivate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
|
||||
|
||||
if (lpToolInfo == NULL)
|
||||
return 0;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return FALSE;
|
||||
|
||||
if ((BOOL32)wParam) {
|
||||
/* activate */
|
||||
infoPtr->nTrackTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
|
||||
if (infoPtr->nTrackTool != -1) {
|
||||
infoPtr->bTrackActive = TRUE;
|
||||
|
||||
/* FIXME : show tool tip */
|
||||
/* FIXME : show tool tip ??? */
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* deactivate */
|
||||
/* FIXME : hide tool tip */
|
||||
/* FIXME : hide tool tip ??? */
|
||||
|
||||
infoPtr->bTrackActive = FALSE;
|
||||
infoPtr->nTrackTool = -1;
|
||||
|
@ -1094,7 +1137,10 @@ TOOLTIPS_UpdateTipText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
TTTOOL_INFO *toolPtr;
|
||||
INT32 nTool;
|
||||
|
||||
if (lpToolInfo == NULL) return 0;
|
||||
if (lpToolInfo == NULL)
|
||||
return 0;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFO_V1_SIZE32A)
|
||||
return FALSE;
|
||||
|
||||
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
|
||||
if (nTool == -1) return 0;
|
||||
|
@ -1140,7 +1186,7 @@ static LRESULT
|
|||
TOOLTIPS_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr;
|
||||
LOGFONT32A logFont;
|
||||
NONCLIENTMETRICS32A nclm;
|
||||
|
||||
/* allocate memory for info structure */
|
||||
infoPtr = (TOOLTIPS_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
|
@ -1158,8 +1204,9 @@ TOOLTIPS_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
infoPtr->clrBk = GetSysColor32 (COLOR_INFOBK);
|
||||
infoPtr->clrText = GetSysColor32 (COLOR_INFOTEXT);
|
||||
|
||||
SystemParametersInfo32A( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
|
||||
infoPtr->hFont = CreateFontIndirect32A( &logFont );
|
||||
nclm.cbSize = sizeof(NONCLIENTMETRICS32A);
|
||||
SystemParametersInfo32A (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
|
||||
infoPtr->hFont = CreateFontIndirect32A (&nclm.lfStatusFont);
|
||||
|
||||
infoPtr->nMaxTipWidth = -1;
|
||||
infoPtr->nTool = -1;
|
||||
|
@ -1253,8 +1300,24 @@ static LRESULT
|
|||
TOOLTIPS_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
TTTOOL_INFO *toolPtr = &infoPtr->tools[infoPtr->nTool];
|
||||
|
||||
TOOLTIPS_Hide (wndPtr, infoPtr);
|
||||
if (toolPtr->uFlags & TTF_TRANSPARENT) {
|
||||
#if 0
|
||||
POINT32 pt;
|
||||
RECT32 rc;
|
||||
|
||||
pt.x = (INT32)LOWORD(lParam);
|
||||
pt.y = (INT32)HIWORD(lParam);
|
||||
|
||||
GetClientRect32 (toolPtr->hwnd, &rc);
|
||||
ScreenToClient32 (toolPtr->hwnd, &pt);
|
||||
if (PtInRect32 (&rc, pt))
|
||||
SendMessage32A (toolPtr->hwnd, WM_MOUSEMOVE, wParam, lParam);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
TOOLTIPS_Hide (wndPtr, infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1310,7 +1373,8 @@ TOOLTIPS_Timer (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
{
|
||||
case ID_TIMER1:
|
||||
KillTimer32 (wndPtr->hwndSelf, ID_TIMER1);
|
||||
TOOLTIPS_Show (wndPtr, infoPtr);
|
||||
if (TOOLTIPS_CheckTool (wndPtr, TRUE) == infoPtr->nTool)
|
||||
TOOLTIPS_Show (wndPtr, infoPtr);
|
||||
break;
|
||||
|
||||
case ID_TIMER2:
|
||||
|
@ -1319,7 +1383,7 @@ TOOLTIPS_Timer (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
case ID_TIMER3:
|
||||
KillTimer32 (wndPtr->hwndSelf, ID_TIMER3);
|
||||
if (TOOLTIPS_CheckTool (wndPtr) == FALSE) {
|
||||
if (TOOLTIPS_CheckTool (wndPtr, FALSE) == -1) {
|
||||
infoPtr->nTool = -1;
|
||||
infoPtr->nOldTool = -1;
|
||||
TOOLTIPS_Hide (wndPtr, infoPtr);
|
||||
|
@ -1334,14 +1398,15 @@ static LRESULT
|
|||
TOOLTIPS_WinIniChange (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
|
||||
LOGFONT32A logFont;
|
||||
NONCLIENTMETRICS32A nclm;
|
||||
|
||||
infoPtr->clrBk = GetSysColor32 (COLOR_INFOBK);
|
||||
infoPtr->clrText = GetSysColor32 (COLOR_INFOTEXT);
|
||||
|
||||
DeleteObject32 (infoPtr->hFont);
|
||||
SystemParametersInfo32A( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
|
||||
infoPtr->hFont = CreateFontIndirect32A( &logFont );
|
||||
nclm.cbSize = sizeof(NONCLIENTMETRICS32A);
|
||||
SystemParametersInfo32A (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
|
||||
infoPtr->hFont = CreateFontIndirect32A (&nclm.lfStatusFont);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,901 @@
|
|||
/*
|
||||
* Trackbar control
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*
|
||||
* NOTES
|
||||
* Development in progress. Author needed! Any volunteers?
|
||||
* I will only improve this control once in a while.
|
||||
* Eric <ekohl@abo.rhein-zeitung.de>
|
||||
*
|
||||
* TODO:
|
||||
* - Some messages.
|
||||
* - display code.
|
||||
* - user interaction.
|
||||
* - tic handling.
|
||||
* - All notifications.
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "commctrl.h"
|
||||
#include "trackbar.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#define TRACKBAR_GetInfoPtr(wndPtr) ((TRACKBAR_INFO *)wndPtr->wExtra[0])
|
||||
|
||||
|
||||
static VOID
|
||||
TRACKBAR_Refresh (WND *wndPtr, HDC32 hdc)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
RECT32 rcClient, rcChannel;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rcClient);
|
||||
|
||||
/* draw channel */
|
||||
rcChannel = infoPtr->rcChannel;
|
||||
DrawEdge32 (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||
if (wndPtr->dwStyle & TBS_ENABLESELRANGE) {
|
||||
/* fill the channel */
|
||||
HBRUSH32 hbr = CreateSolidBrush32 (RGB(255,255,255));
|
||||
FillRect32 (hdc, &rcChannel, hbr);
|
||||
DeleteObject32 (hbr);
|
||||
}
|
||||
|
||||
/* draw ticks */
|
||||
if (!(wndPtr->dwStyle & TBS_NOTICKS)) {
|
||||
|
||||
}
|
||||
|
||||
/* draw thumb */
|
||||
if (!(wndPtr->dwStyle & TBS_NOTHUMB)) {
|
||||
|
||||
}
|
||||
|
||||
if (infoPtr->bFocus)
|
||||
DrawFocusRect32 (hdc, &rcClient);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
TRACKBAR_Calc (WND *wndPtr, TRACKBAR_INFO *infoPtr, LPRECT32 lpRect)
|
||||
{
|
||||
INT32 cyChannel;
|
||||
|
||||
if (wndPtr->dwStyle & TBS_ENABLESELRANGE)
|
||||
cyChannel = MAX(infoPtr->uThumbLen - 8, 4);
|
||||
else
|
||||
cyChannel = 4;
|
||||
|
||||
/* calculate channel rect */
|
||||
if (wndPtr->dwStyle & TBS_VERT) {
|
||||
infoPtr->rcChannel.top = lpRect->top + 8;
|
||||
infoPtr->rcChannel.bottom = lpRect->bottom - 8;
|
||||
|
||||
if (wndPtr->dwStyle & TBS_BOTH) {
|
||||
infoPtr->rcChannel.left = (lpRect->bottom - cyChannel ) / 2;
|
||||
infoPtr->rcChannel.right = (lpRect->bottom + cyChannel) / 2;
|
||||
}
|
||||
else if (wndPtr->dwStyle & TBS_LEFT) {
|
||||
infoPtr->rcChannel.left = lpRect->left + 10;
|
||||
infoPtr->rcChannel.right = infoPtr->rcChannel.left + cyChannel;
|
||||
}
|
||||
else {
|
||||
/* TBS_RIGHT */
|
||||
infoPtr->rcChannel.right = lpRect->right - 10;
|
||||
infoPtr->rcChannel.left = infoPtr->rcChannel.right - cyChannel;
|
||||
}
|
||||
}
|
||||
else {
|
||||
infoPtr->rcChannel.left = lpRect->left + 8;
|
||||
infoPtr->rcChannel.right = lpRect->right - 8;
|
||||
|
||||
if (wndPtr->dwStyle & TBS_BOTH) {
|
||||
infoPtr->rcChannel.top = (lpRect->bottom - cyChannel ) / 2;
|
||||
infoPtr->rcChannel.bottom = (lpRect->bottom + cyChannel) / 2;
|
||||
}
|
||||
else if (wndPtr->dwStyle & TBS_TOP) {
|
||||
infoPtr->rcChannel.top = lpRect->top + 10;
|
||||
infoPtr->rcChannel.bottom = infoPtr->rcChannel.top + cyChannel;
|
||||
}
|
||||
else {
|
||||
/* TBS_BOTTOM */
|
||||
infoPtr->rcChannel.bottom = lpRect->bottom - 10;
|
||||
infoPtr->rcChannel.top = infoPtr->rcChannel.bottom - cyChannel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
TRACKBAR_AlignBuddies (WND *wndPtr, TRACKBAR_INFO *infoPtr)
|
||||
{
|
||||
HWND32 hwndParent = GetParent32 (wndPtr->hwndSelf);
|
||||
RECT32 rcSelf, rcBuddy;
|
||||
INT32 x, y;
|
||||
|
||||
GetWindowRect32 (wndPtr->hwndSelf, &rcSelf);
|
||||
MapWindowPoints32 (HWND_DESKTOP, hwndParent, (LPPOINT32)&rcSelf, 2);
|
||||
|
||||
/* align buddy left or above */
|
||||
if (infoPtr->hwndBuddyLA) {
|
||||
GetWindowRect32 (infoPtr->hwndBuddyLA, &rcBuddy);
|
||||
MapWindowPoints32 (HWND_DESKTOP, hwndParent, (LPPOINT32)&rcBuddy, 2);
|
||||
|
||||
if (wndPtr->dwStyle & TBS_VERT) {
|
||||
x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
|
||||
(rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
|
||||
y = rcSelf.top - (rcBuddy.bottom - rcBuddy.top);
|
||||
}
|
||||
else {
|
||||
x = rcSelf.left - (rcBuddy.right - rcBuddy.left);
|
||||
y = (infoPtr->rcChannel.bottom + infoPtr->rcChannel.top) / 2 -
|
||||
(rcBuddy.bottom - rcBuddy.top) / 2 + rcSelf.top;
|
||||
}
|
||||
|
||||
SetWindowPos32 (infoPtr->hwndBuddyLA, 0, x, y, 0, 0,
|
||||
SWP_NOZORDER | SWP_NOSIZE);
|
||||
}
|
||||
|
||||
|
||||
/* align buddy right or below */
|
||||
if (infoPtr->hwndBuddyRB) {
|
||||
GetWindowRect32 (infoPtr->hwndBuddyRB, &rcBuddy);
|
||||
MapWindowPoints32 (HWND_DESKTOP, hwndParent, (LPPOINT32)&rcBuddy, 2);
|
||||
|
||||
if (wndPtr->dwStyle & TBS_VERT) {
|
||||
x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
|
||||
(rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
|
||||
y = rcSelf.bottom;
|
||||
}
|
||||
else {
|
||||
x = rcSelf.right;
|
||||
y = (infoPtr->rcChannel.bottom + infoPtr->rcChannel.top) / 2 -
|
||||
(rcBuddy.bottom - rcBuddy.top) / 2 + rcSelf.top;
|
||||
}
|
||||
SetWindowPos32 (infoPtr->hwndBuddyRB, 0, x, y, 0, 0,
|
||||
SWP_NOZORDER | SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_ClearSel (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->nSelMin = 0;
|
||||
infoPtr->nSelMax = 0;
|
||||
|
||||
if ((BOOL32)wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_ClearTics (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (infoPtr->tics) {
|
||||
FIXME (trackbar, "is this correct??\n");
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr->tics);
|
||||
infoPtr->tics = NULL;
|
||||
infoPtr->uNumTics = 2;
|
||||
}
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetBuddy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (wParam)
|
||||
/* buddy is left or above */
|
||||
return (LRESULT)infoPtr->hwndBuddyLA;
|
||||
|
||||
/* buddy is right or below */
|
||||
return (LRESULT) infoPtr->hwndBuddyRB;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetChannelRect (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
LPRECT32 lprc = (LPRECT32)lParam;
|
||||
|
||||
if (lprc == NULL)
|
||||
return 0;
|
||||
|
||||
lprc->left = infoPtr->rcChannel.left;
|
||||
lprc->right = infoPtr->rcChannel.right;
|
||||
lprc->bottom = infoPtr->rcChannel.bottom;
|
||||
lprc->top = infoPtr->rcChannel.top;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetLineSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nLineSize;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetNumTics (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (wndPtr->dwStyle & TBS_NOTICKS)
|
||||
return 0;
|
||||
|
||||
return infoPtr->uNumTics;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetPageSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nPageSize;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nPos;
|
||||
}
|
||||
|
||||
|
||||
// << TRACKBAR_GetPTics >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetRangeMax (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nRangeMax;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetRangeMin (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nRangeMin;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetSelEnd (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nSelMax;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetSelStart (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->nSelMin;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetThumbLength (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
return infoPtr->uThumbLen;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// << TRACKBAR_GetThumbRect >>
|
||||
// case TBM_GETTIC:
|
||||
// case TBM_GETTICPOS:
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_GetToolTips (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (wndPtr->dwStyle & TBS_TOOLTIPS)
|
||||
return (LRESULT)infoPtr->hwndToolTip;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// case TBM_GETUNICODEFORMAT:
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetBuddy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
HWND32 hwndTemp;
|
||||
|
||||
if (wParam) {
|
||||
/* buddy is left or above */
|
||||
hwndTemp = infoPtr->hwndBuddyLA;
|
||||
infoPtr->hwndBuddyLA = (HWND32)lParam;
|
||||
|
||||
FIXME (trackbar, "move buddy!\n");
|
||||
}
|
||||
else {
|
||||
/* buddy is right or below */
|
||||
hwndTemp = infoPtr->hwndBuddyRB;
|
||||
infoPtr->hwndBuddyRB = (HWND32)lParam;
|
||||
|
||||
FIXME (trackbar, "move buddy!\n");
|
||||
}
|
||||
|
||||
TRACKBAR_AlignBuddies (wndPtr, infoPtr);
|
||||
|
||||
return (LRESULT)hwndTemp;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetLineSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
INT32 nTemp = infoPtr->nLineSize;
|
||||
|
||||
infoPtr->nLineSize = (INT32)lParam;
|
||||
|
||||
return nTemp;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetPageSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
INT32 nTemp = infoPtr->nPageSize;
|
||||
|
||||
infoPtr->nPageSize = (INT32)lParam;
|
||||
|
||||
return nTemp;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->nPos = (INT32)HIWORD(lParam);
|
||||
|
||||
if (infoPtr->nPos < infoPtr->nRangeMin)
|
||||
infoPtr->nPos = infoPtr->nRangeMin;
|
||||
|
||||
if (infoPtr->nPos > infoPtr->nRangeMax)
|
||||
infoPtr->nPos = infoPtr->nRangeMax;
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetRange (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->nRangeMin = (INT32)LOWORD(lParam);
|
||||
infoPtr->nRangeMax = (INT32)HIWORD(lParam);
|
||||
|
||||
if (infoPtr->nPos < infoPtr->nRangeMin)
|
||||
infoPtr->nPos = infoPtr->nRangeMin;
|
||||
|
||||
if (infoPtr->nPos > infoPtr->nRangeMax)
|
||||
infoPtr->nPos = infoPtr->nRangeMax;
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetRangeMax (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->nRangeMax = (INT32)lParam;
|
||||
if (infoPtr->nPos > infoPtr->nRangeMax)
|
||||
infoPtr->nPos = infoPtr->nRangeMax;
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetRangeMin (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->nRangeMin = (INT32)lParam;
|
||||
if (infoPtr->nPos < infoPtr->nRangeMin)
|
||||
infoPtr->nPos = infoPtr->nRangeMin;
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetSel (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (!wndPtr->dwStyle & TBS_ENABLESELRANGE)
|
||||
return 0;
|
||||
|
||||
infoPtr->nSelMin = (INT32)LOWORD(lParam);
|
||||
infoPtr->nSelMax = (INT32)HIWORD(lParam);
|
||||
|
||||
if (infoPtr->nSelMin < infoPtr->nRangeMin)
|
||||
infoPtr->nSelMin = infoPtr->nRangeMin;
|
||||
if (infoPtr->nSelMax > infoPtr->nRangeMax)
|
||||
infoPtr->nSelMax = infoPtr->nRangeMax;
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetSelEnd (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (!wndPtr->dwStyle & TBS_ENABLESELRANGE)
|
||||
return 0;
|
||||
|
||||
infoPtr->nSelMax = (INT32)lParam;
|
||||
if (infoPtr->nSelMax > infoPtr->nRangeMax)
|
||||
infoPtr->nSelMax = infoPtr->nRangeMax;
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetSelStart (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (!wndPtr->dwStyle & TBS_ENABLESELRANGE)
|
||||
return 0;
|
||||
|
||||
infoPtr->nSelMin = (INT32)lParam;
|
||||
if (infoPtr->nSelMin < infoPtr->nRangeMin)
|
||||
infoPtr->nSelMin = infoPtr->nRangeMin;
|
||||
|
||||
if (wParam) {
|
||||
HDC32 hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetThumbLength (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
if (wndPtr->dwStyle & TBS_FIXEDLENGTH)
|
||||
infoPtr->uThumbLen = (UINT32)wParam;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetTic (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
INT32 nPos = (INT32)lParam;
|
||||
|
||||
if (nPos < infoPtr->nRangeMin)
|
||||
return FALSE;
|
||||
if (nPos > infoPtr->nRangeMax)
|
||||
return FALSE;
|
||||
|
||||
FIXME (trackbar, "%d - empty stub!\n", nPos);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// case TBM_SETTICFREQ:
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetTipSide (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
INT32 fTemp = infoPtr->fLocation;
|
||||
|
||||
infoPtr->fLocation = (INT32)wParam;
|
||||
|
||||
return fTemp;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetToolTips (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
infoPtr->hwndToolTip = (HWND32)wParam;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// case TBM_SETUNICODEFORMAT:
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr;
|
||||
|
||||
infoPtr = (TRACKBAR_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
|
||||
sizeof(TRACKBAR_INFO));
|
||||
wndPtr->wExtra[0] = (DWORD)infoPtr;
|
||||
|
||||
|
||||
/* default values */
|
||||
infoPtr->nRangeMin = 0;
|
||||
infoPtr->nRangeMax = 100;
|
||||
infoPtr->nLineSize = 1;
|
||||
infoPtr->nPageSize = 20;
|
||||
infoPtr->nSelMin = 0;
|
||||
infoPtr->nSelMax = 0;
|
||||
infoPtr->nPos = 0;
|
||||
infoPtr->uThumbLen = 23; /* initial thumb length */
|
||||
infoPtr->uNumTics = 2; /* default start and end tic */
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
|
||||
|
||||
|
||||
HeapFree (GetProcessHeap (), 0, infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_KillFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
HDC32 hdc;
|
||||
|
||||
infoPtr->bFocus = FALSE;
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
InvalidateRect32 (wndPtr->hwndSelf, NULL, TRUE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
|
||||
SetFocus32 (wndPtr->hwndSelf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Paint (WND *wndPtr, WPARAM32 wParam)
|
||||
{
|
||||
HDC32 hdc;
|
||||
PAINTSTRUCT32 ps;
|
||||
|
||||
hdc = wParam==0 ? BeginPaint32 (wndPtr->hwndSelf, &ps) : (HDC32)wParam;
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
if(!wParam)
|
||||
EndPaint32 (wndPtr->hwndSelf, &ps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_SetFocus (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
HDC32 hdc;
|
||||
|
||||
infoPtr->bFocus = TRUE;
|
||||
|
||||
hdc = GetDC32 (wndPtr->hwndSelf);
|
||||
TRACKBAR_Refresh (wndPtr, hdc);
|
||||
ReleaseDC32 (wndPtr->hwndSelf, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT
|
||||
TRACKBAR_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
|
||||
RECT32 rcClient;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rcClient);
|
||||
|
||||
TRACKBAR_Calc (wndPtr, infoPtr, &rcClient);
|
||||
TRACKBAR_AlignBuddies (wndPtr, infoPtr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// << TRACKBAR_Timer >>
|
||||
// << TRACKBAR_WinIniChange >>
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
TRACKBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case TBM_CLEARSEL:
|
||||
return TRACKBAR_ClearSel (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_CLEARTICS:
|
||||
return TRACKBAR_ClearTics (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETBUDDY:
|
||||
return TRACKBAR_GetBuddy (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETCHANNELRECT:
|
||||
return TRACKBAR_GetChannelRect (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETLINESIZE:
|
||||
return TRACKBAR_GetLineSize (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETNUMTICS:
|
||||
return TRACKBAR_GetNumTics (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETPAGESIZE:
|
||||
return TRACKBAR_GetPageSize (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETPOS:
|
||||
return TRACKBAR_GetPos (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_GETPTICS:
|
||||
|
||||
case TBM_GETRANGEMAX:
|
||||
return TRACKBAR_GetRangeMax (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETRANGEMIN:
|
||||
return TRACKBAR_GetRangeMin (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETSELEND:
|
||||
return TRACKBAR_GetSelEnd (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETSELSTART:
|
||||
return TRACKBAR_GetSelStart (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_GETTHUMBLENGTH:
|
||||
return TRACKBAR_GetThumbLength (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_GETTHUMBRECT:
|
||||
// case TBM_GETTIC:
|
||||
// case TBM_GETTICPOS:
|
||||
|
||||
case TBM_GETTOOLTIPS:
|
||||
return TRACKBAR_GetToolTips (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_GETUNICODEFORMAT:
|
||||
|
||||
case TBM_SETBUDDY:
|
||||
return TRACKBAR_SetBuddy (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETLINESIZE:
|
||||
return TRACKBAR_SetLineSize (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETPAGESIZE:
|
||||
return TRACKBAR_SetPageSize (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETPOS:
|
||||
return TRACKBAR_SetPos (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETRANGE:
|
||||
return TRACKBAR_SetRange (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETRANGEMAX:
|
||||
return TRACKBAR_SetRangeMax (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETRANGEMIN:
|
||||
return TRACKBAR_SetRangeMin (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETSEL:
|
||||
return TRACKBAR_SetSel (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETSELEND:
|
||||
return TRACKBAR_SetSelEnd (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETSELSTART:
|
||||
return TRACKBAR_SetSelStart (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETTHUMBLENGTH:
|
||||
return TRACKBAR_SetThumbLength (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETTIC:
|
||||
return TRACKBAR_SetTic (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_SETTICFREQ:
|
||||
|
||||
case TBM_SETTIPSIDE:
|
||||
return TRACKBAR_SetTipSide (wndPtr, wParam, lParam);
|
||||
|
||||
case TBM_SETTOOLTIPS:
|
||||
return TRACKBAR_SetToolTips (wndPtr, wParam, lParam);
|
||||
|
||||
// case TBM_SETUNICODEFORMAT:
|
||||
|
||||
|
||||
// case WM_CAPTURECHANGED:
|
||||
|
||||
case WM_CREATE:
|
||||
return TRACKBAR_Create (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_DESTROY:
|
||||
return TRACKBAR_Destroy (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_ENABLE:
|
||||
|
||||
// case WM_ERASEBKGND:
|
||||
// return 0;
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return DLGC_WANTARROWS;
|
||||
|
||||
// case WM_KEYDOWN:
|
||||
|
||||
// case WM_KEYUP:
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
return TRACKBAR_KillFocus (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
return TRACKBAR_LButtonDown (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_LBUTTONUP:
|
||||
|
||||
// case WM_MOUSEMOVE:
|
||||
// return TRACKBAR_MouseMove (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_PAINT:
|
||||
return TRACKBAR_Paint (wndPtr, wParam);
|
||||
|
||||
case WM_SETFOCUS:
|
||||
return TRACKBAR_SetFocus (wndPtr, wParam, lParam);
|
||||
|
||||
case WM_SIZE:
|
||||
return TRACKBAR_Size (wndPtr, wParam, lParam);
|
||||
|
||||
// case WM_TIMER:
|
||||
|
||||
// case WM_WININICHANGE:
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
ERR (trackbar, "unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TRACKBAR_Register (void)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
if (GlobalFindAtom32A (TRACKBAR_CLASS32A)) return;
|
||||
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
|
||||
wndClass.style = CS_GLOBALCLASS;
|
||||
wndClass.lpfnWndProc = (WNDPROC32)TRACKBAR_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(TRACKBAR_INFO *);
|
||||
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
|
||||
wndClass.hbrBackground = (HBRUSH32)(COLOR_3DFACE + 1);
|
||||
wndClass.lpszClassName = TRACKBAR_CLASS32A;
|
||||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
|
@ -25,24 +25,44 @@
|
|||
|
||||
|
||||
|
||||
static LRESULT
|
||||
TREEVIEW_GetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr);
|
||||
|
||||
switch ((INT32)wParam) {
|
||||
case TVSIL_NORMAL:
|
||||
return (LRESULT)infoPtr->himlNormal;
|
||||
|
||||
case TVSIL_STATE:
|
||||
return (LRESULT)infoPtr->himlState;
|
||||
}
|
||||
|
||||
return (LRESULT)NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static LRESULT
|
||||
TREEVIEW_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr);
|
||||
HIMAGELIST himlTemp;
|
||||
|
||||
if ((INT32)wParam == TVSIL_NORMAL) {
|
||||
himlTemp = infoPtr->himlNormal;
|
||||
infoPtr->himlNormal = (HIMAGELIST)lParam;
|
||||
}
|
||||
else if ((INT32)wParam == TVSIL_STATE) {
|
||||
himlTemp = infoPtr->himlState;
|
||||
infoPtr->himlState = (HIMAGELIST)lParam;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
switch ((INT32)wParam) {
|
||||
case TVSIL_NORMAL:
|
||||
himlTemp = infoPtr->himlNormal;
|
||||
infoPtr->himlNormal = (HIMAGELIST)lParam;
|
||||
return (LRESULT)himlTemp;
|
||||
|
||||
return (LRESULT)himlTemp;
|
||||
case TVSIL_STATE:
|
||||
himlTemp = infoPtr->himlState;
|
||||
infoPtr->himlState = (HIMAGELIST)lParam;
|
||||
return (LRESULT)himlTemp;
|
||||
}
|
||||
|
||||
return (LRESULT)NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -116,12 +136,12 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
switch (uMsg)
|
||||
{
|
||||
|
||||
case TVM_INSERTITEMA:
|
||||
FIXME (treeview, "Unimplemented msg TVM_INSERTITEMA\n");
|
||||
case TVM_INSERTITEM32A:
|
||||
FIXME (treeview, "Unimplemented msg TVM_INSERTITEM32A\n");
|
||||
return 0;
|
||||
|
||||
case TVM_INSERTITEMW:
|
||||
FIXME (treeview, "Unimplemented msg TVM_INSERTITEMW\n");
|
||||
case TVM_INSERTITEM32W:
|
||||
FIXME (treeview, "Unimplemented msg TVM_INSERTITEM32W\n");
|
||||
return 0;
|
||||
|
||||
case TVM_DELETEITEM:
|
||||
|
@ -148,10 +168,8 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
FIXME (treeview, "Unimplemented msg TVM_SETINDENT\n");
|
||||
return 0;
|
||||
|
||||
case TVM_GETIMAGELIST:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETIMAGELIST\n");
|
||||
return 0;
|
||||
//return TREEVIEW_GetImageList (wndPtr, wParam, lParam);
|
||||
case TVM_GETIMAGELIST:
|
||||
return TREEVIEW_GetImageList (wndPtr, wParam, lParam);
|
||||
|
||||
case TVM_SETIMAGELIST:
|
||||
return TREEVIEW_SetImageList (wndPtr, wParam, lParam);
|
||||
|
@ -164,28 +182,28 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
FIXME (treeview, "Unimplemented msg TVM_SELECTITEM \n");
|
||||
return 0;
|
||||
|
||||
case TVM_GETITEMA:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETITEMA\n");
|
||||
case TVM_GETITEM32A:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETITEM32A\n");
|
||||
return 0;
|
||||
|
||||
case TVM_GETITEMW:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETITEMW\n");
|
||||
case TVM_GETITEM32W:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETITEM32W\n");
|
||||
return 0;
|
||||
|
||||
case TVM_SETITEMA:
|
||||
FIXME (treeview, "Unimplemented msg TVM_SETITEMA\n");
|
||||
case TVM_SETITEM32A:
|
||||
FIXME (treeview, "Unimplemented msg TVM_SETITEM32A\n");
|
||||
return 0;
|
||||
|
||||
case TVM_SETITEMW:
|
||||
FIXME (treeview, "Unimplemented msg TVM_SETITEMW\n");
|
||||
case TVM_SETITEM32W:
|
||||
FIXME (treeview, "Unimplemented msg TVM_SETITEM32W\n");
|
||||
return 0;
|
||||
|
||||
case TVM_EDITLABELA:
|
||||
FIXME (treeview, "Unimplemented msg TVM_EDITLABELA \n");
|
||||
case TVM_EDITLABEL32A:
|
||||
FIXME (treeview, "Unimplemented msg TVM_EDITLABEL32A\n");
|
||||
return 0;
|
||||
|
||||
case TVM_EDITLABELW:
|
||||
FIXME (treeview, "Unimplemented msg TVM_EDITLABELW \n");
|
||||
case TVM_EDITLABEL32W:
|
||||
FIXME (treeview, "Unimplemented msg TVM_EDITLABEL32W\n");
|
||||
return 0;
|
||||
|
||||
case TVM_GETEDITCONTROL:
|
||||
|
@ -220,12 +238,12 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
FIXME (treeview, "Unimplemented msg TVM_ENDEDITLABELNOW\n");
|
||||
return 0;
|
||||
|
||||
case TVM_GETISEARCHSTRINGA:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRINGA\n");
|
||||
case TVM_GETISEARCHSTRING32A:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRING32A\n");
|
||||
return 0;
|
||||
|
||||
case TVM_GETISEARCHSTRINGW:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRINGW\n");
|
||||
case TVM_GETISEARCHSTRING32W:
|
||||
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRING32W\n");
|
||||
return 0;
|
||||
|
||||
case TVM_SETTOOLTIPS:
|
||||
|
@ -261,8 +279,8 @@ TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
FIXME (treeview, "Unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
FIXME (treeview, "Unknown msg %04x wp=%08x lp=%08lx\n",
|
||||
uMsg, wParam, lParam);
|
||||
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
return 0;
|
|
@ -17,8 +17,8 @@ C_SRCS = \
|
|||
shlfolder.c \
|
||||
shlview.c
|
||||
|
||||
RC_SRCS = \
|
||||
shres.rc
|
||||
# RC_SRCS = \
|
||||
# shres.rc
|
||||
|
||||
all: check_wrc $(MODULE).o
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "windows.h"
|
||||
#include "winerror.h"
|
||||
#include "debug.h"
|
||||
#include "pidl.h"
|
||||
#include "shlobj.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
|
@ -22,8 +23,9 @@ static HRESULT WINAPI IContextMenu_QueryInterface(LPCONTEXTMENU ,REFIID , LPVOID
|
|||
static ULONG WINAPI IContextMenu_AddRef(LPCONTEXTMENU);
|
||||
static ULONG WINAPI IContextMenu_Release(LPCONTEXTMENU);
|
||||
static HRESULT WINAPI IContextMenu_QueryContextMenu(LPCONTEXTMENU , HMENU32 ,UINT32 ,UINT32 ,UINT32 ,UINT32);
|
||||
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU, LPCMINVOKECOMMANDINFO);
|
||||
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU, LPCMINVOKECOMMANDINFO32);
|
||||
static HRESULT WINAPI IContextMenu_GetCommandString(LPCONTEXTMENU , UINT32 ,UINT32 ,LPUINT32 ,LPSTR ,UINT32);
|
||||
static HRESULT WINAPI IContextMenu_HandleMenuMsg(LPCONTEXTMENU, UINT32, WPARAM32, LPARAM);
|
||||
|
||||
BOOL32 IContextMenu_AllocPidlTable(LPCONTEXTMENU, DWORD);
|
||||
void IContextMenu_FreePidlTable(LPCONTEXTMENU);
|
||||
|
@ -33,10 +35,12 @@ BOOL32 IContextMenu_FillPidlTable(LPCONTEXTMENU, LPCITEMIDLIST *, UINT32);
|
|||
static struct IContextMenu_VTable cmvt =
|
||||
{ IContextMenu_QueryInterface,
|
||||
IContextMenu_AddRef,
|
||||
IContextMenu_Release,
|
||||
IContextMenu_Release,
|
||||
IContextMenu_QueryContextMenu,
|
||||
IContextMenu_InvokeCommand,
|
||||
IContextMenu_GetCommandString
|
||||
IContextMenu_GetCommandString,
|
||||
IContextMenu_HandleMenuMsg,
|
||||
(void *) 0xdeadbabe /* just paranoia */
|
||||
};
|
||||
/**************************************************************************
|
||||
* IContextMenu_QueryInterface
|
||||
|
@ -56,10 +60,11 @@ static HRESULT WINAPI IContextMenu_QueryInterface(LPCONTEXTMENU this,REFIID riid
|
|||
}
|
||||
else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/
|
||||
{ *ppvObj = (LPSHELLEXTINIT)this;
|
||||
WARN(shell,"-- LPSHELLEXTINIT pointer requested\n");
|
||||
}
|
||||
|
||||
if(*ppvObj)
|
||||
{ (*(LPCONTEXTMENU*)ppvObj)->lpvtbl->fnAddRef(this);
|
||||
{ (*(LPCONTEXTMENU *)ppvObj)->lpvtbl->fnAddRef(this);
|
||||
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -78,25 +83,23 @@ static ULONG WINAPI IContextMenu_AddRef(LPCONTEXTMENU this)
|
|||
* IContextMenu_Release
|
||||
*/
|
||||
static ULONG WINAPI IContextMenu_Release(LPCONTEXTMENU this)
|
||||
{ TRACE(shell,"(%p)->()\n",this);
|
||||
if (!--(this->ref))
|
||||
{ TRACE(shell," destroying IContextMenu(%p)\n",this);
|
||||
{ TRACE(shell,"(%p)->()\n",this);
|
||||
if (!--(this->ref))
|
||||
{ TRACE(shell," destroying IContextMenu(%p)\n",this);
|
||||
|
||||
if(this->pSFParent)
|
||||
if(this->pSFParent)
|
||||
this->pSFParent->lpvtbl->fnRelease(this->pSFParent);
|
||||
|
||||
/*make sure the pidl is freed*/
|
||||
if(this->aPidls)
|
||||
{ IContextMenu_FreePidlTable(this);
|
||||
/*make sure the pidl is freed*/
|
||||
if(this->aPidls)
|
||||
{ IContextMenu_FreePidlTable(this);
|
||||
}
|
||||
|
||||
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(this->pPidlMgr)
|
||||
PidlMgr_Destructor(this->pPidlMgr);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
return 0;
|
||||
}
|
||||
return this->ref;
|
||||
return this->ref;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -115,7 +118,6 @@ LPCONTEXTMENU IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST *a
|
|||
cm->pSFParent->lpvtbl->fnAddRef(cm->pSFParent);
|
||||
|
||||
cm->aPidls = NULL;
|
||||
cm->pPidlMgr = PidlMgr_Constructor();
|
||||
|
||||
IContextMenu_AllocPidlTable(cm, uItemCount);
|
||||
|
||||
|
@ -125,10 +127,10 @@ LPCONTEXTMENU IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST *a
|
|||
|
||||
cm->bAllValues = 1;
|
||||
for(u = 0; u < uItemCount; u++)
|
||||
{ cm->bAllValues &= (cm->pPidlMgr->lpvtbl->fnIsValue(cm->pPidlMgr, aPidls[u]) ? 1 : 0);
|
||||
{ cm->bAllValues &= (_ILIsValue(aPidls[u]) ? 1 : 0);
|
||||
}
|
||||
TRACE(shell,"(%p)->()\n",cm);
|
||||
return cm;
|
||||
TRACE(shell,"(%p)->()\n",cm);
|
||||
return cm;
|
||||
}
|
||||
|
||||
|
||||
|
@ -210,12 +212,12 @@ static HRESULT WINAPI IContextMenu_QueryContextMenu( LPCONTEXTMENU this, HMENU3
|
|||
/**************************************************************************
|
||||
* IContextMenu_InvokeCommand()
|
||||
*/
|
||||
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU this, LPCMINVOKECOMMANDINFO lpcmi)
|
||||
static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU this, LPCMINVOKECOMMANDINFO32 lpcmi)
|
||||
{ LPITEMIDLIST pidlTemp,pidlFQ;
|
||||
SHELLEXECUTEINFO sei;
|
||||
SHELLEXECUTEINFO32A sei;
|
||||
int i;
|
||||
|
||||
TRACE(shell,"(%p)->(execinfo=%p)\n",this,lpcmi);
|
||||
TRACE(shell,"(%p)->(invcom=%p verb=%p)\n",this,lpcmi,lpcmi->lpVerb);
|
||||
|
||||
if(HIWORD(lpcmi->lpVerb))
|
||||
{ //the command is being sent via a verb
|
||||
|
@ -232,7 +234,7 @@ static HRESULT WINAPI IContextMenu_InvokeCommand(LPCONTEXTMENU this, LPCMINVOKEC
|
|||
should never be invoked if there isn't at least one key item in the list.*/
|
||||
|
||||
for(i = 0; this->aPidls[i]; i++)
|
||||
{ if(!this->pPidlMgr->lpvtbl->fnIsValue(this->pPidlMgr, this->aPidls[i]))
|
||||
{ if(!_ILIsValue(this->aPidls[i]))
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -273,46 +275,56 @@ static HRESULT WINAPI IContextMenu_GetCommandString( LPCONTEXTMENU this, UINT32
|
|||
UINT32 uFlags,LPUINT32 lpReserved,LPSTR lpszName,UINT32 uMaxNameLen)
|
||||
{ HRESULT hr = E_INVALIDARG;
|
||||
|
||||
TRACE(shell,"(%p)->(idcom=%x flags=%x %p name=%s len=%x)\n",this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
|
||||
TRACE(shell,"(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
|
||||
|
||||
switch(uFlags)
|
||||
switch(uFlags)
|
||||
{ case GCS_HELPTEXT:
|
||||
hr = E_NOTIMPL;
|
||||
break;
|
||||
hr = E_NOTIMPL;
|
||||
break;
|
||||
|
||||
case GCS_VERBA:
|
||||
switch(idCommand)
|
||||
{ case IDM_RENAME:
|
||||
strcpy((LPSTR)lpszName, "rename");
|
||||
hr = NOERROR;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
switch(idCommand)
|
||||
{ case IDM_RENAME:
|
||||
strcpy((LPSTR)lpszName, "rename");
|
||||
hr = NOERROR;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
/* NT 4.0 with IE 3.0x or no IE will always call this with GCS_VERBW. In this
|
||||
case, you need to do the lstrcpyW to the pointer passed.*/
|
||||
/* NT 4.0 with IE 3.0x or no IE will always call this with GCS_VERBW. In this
|
||||
case, you need to do the lstrcpyW to the pointer passed.*/
|
||||
case GCS_VERBW:
|
||||
switch(idCommand)
|
||||
{ case IDM_RENAME:
|
||||
lstrcpyAtoW((LPWSTR)lpszName, "rename");
|
||||
hr = NOERROR;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
switch(idCommand)
|
||||
{ case IDM_RENAME:
|
||||
lstrcpyAtoW((LPWSTR)lpszName, "rename");
|
||||
hr = NOERROR;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case GCS_VALIDATE:
|
||||
hr = NOERROR;
|
||||
break;
|
||||
hr = NOERROR;
|
||||
break;
|
||||
}
|
||||
TRACE(shell,"-- (%p)->(name=%s)\n",this, lpszName);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* IContextMenu_HandleMenuMsg()
|
||||
* NOTES
|
||||
* should be only in IContextMenu2 and IContextMenu3
|
||||
* is nevertheless called from word95
|
||||
*/
|
||||
static HRESULT WINAPI IContextMenu_HandleMenuMsg(LPCONTEXTMENU this, UINT32 uMsg,WPARAM32 wParam,LPARAM lParam)
|
||||
{ TRACE(shell,"(%p)->(msg=%x wp=%x lp=%lx)\n",this, uMsg, wParam, lParam);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
/**************************************************************************
|
||||
* IContextMenu_AllocPidlTable()
|
||||
*/
|
||||
BOOL32 IContextMenu_AllocPidlTable(LPCONTEXTMENU this, DWORD dwEntries)
|
||||
{ //add one for NULL terminator
|
||||
TRACE(shell,"(%p)->(entrys=%u)\n",this, dwEntries);
|
||||
TRACE(shell,"(%p)->(entrys=%lu)\n",this, dwEntries);
|
||||
dwEntries++;
|
||||
|
||||
this->aPidls = (LPITEMIDLIST*)SHAlloc(dwEntries * sizeof(LPITEMIDLIST));
|
||||
|
@ -327,17 +339,17 @@ BOOL32 IContextMenu_AllocPidlTable(LPCONTEXTMENU this, DWORD dwEntries)
|
|||
* IContextMenu_FreePidlTable()
|
||||
*/
|
||||
void IContextMenu_FreePidlTable(LPCONTEXTMENU this)
|
||||
{ int i;
|
||||
{ int i;
|
||||
|
||||
TRACE(shell,"(%p)->()\n",this);
|
||||
|
||||
if(this->aPidls)
|
||||
{ for(i = 0; this->aPidls[i]; i++)
|
||||
{ SHFree(this->aPidls[i]);
|
||||
}
|
||||
{ SHFree(this->aPidls[i]);
|
||||
}
|
||||
|
||||
SHFree(this->aPidls);
|
||||
this->aPidls = NULL;
|
||||
SHFree(this->aPidls);
|
||||
this->aPidls = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -366,18 +378,16 @@ BOOL32 IContextMenu_CanRenameItems(LPCONTEXTMENU this)
|
|||
TRACE(shell,"(%p)->()\n",this);
|
||||
|
||||
if(this->aPidls)
|
||||
{ if(this->pPidlMgr)
|
||||
{ for(i = 0; this->aPidls[i]; i++){} /*get the number of items assigned to this object*/
|
||||
if(i > 1) /*you can't rename more than one item at a time*/
|
||||
{ return FALSE;
|
||||
}
|
||||
{ for(i = 0; this->aPidls[i]; i++){} /*get the number of items assigned to this object*/
|
||||
if(i > 1) /*you can't rename more than one item at a time*/
|
||||
{ return FALSE;
|
||||
}
|
||||
dwAttributes = SFGAO_CANRENAME;
|
||||
this->pSFParent->lpvtbl->fnGetAttributesOf(this->pSFParent, i,
|
||||
(LPCITEMIDLIST*)this->aPidls, &dwAttributes);
|
||||
|
||||
return dwAttributes & SFGAO_CANRENAME;
|
||||
}
|
||||
}
|
||||
return dwAttributes & SFGAO_CANRENAME;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "winnls.h"
|
||||
#include "winproc.h"
|
||||
#include "commctrl.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
/* IEnumIDList Implementation */
|
||||
|
@ -63,27 +63,17 @@ LPENUMIDLIST IEnumIDList_Constructor( LPCSTR lpszPath, DWORD dwFlags, HRESULT* p
|
|||
lpeidl->mpLast=NULL;
|
||||
lpeidl->mpCurrent=NULL;
|
||||
|
||||
TRACE(shell,"(%p)->(%s 0x%08lx %p)\n",lpeidl,debugstr_a(lpszPath),dwFlags,pResult);
|
||||
|
||||
lpeidl->mpPidlMgr=PidlMgr_Constructor();
|
||||
if (!lpeidl->mpPidlMgr)
|
||||
{ if (pResult)
|
||||
{ *pResult=E_OUTOFMEMORY;
|
||||
HeapFree(GetProcessHeap(),0,lpeidl);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
TRACE(shell,"(%p)->(%s 0x%08lx %p)\n",lpeidl,debugstr_a(lpszPath),dwFlags,pResult);
|
||||
|
||||
if(!IEnumIDList_CreateEnumList(lpeidl, lpszPath, dwFlags))
|
||||
{ if(pResult)
|
||||
{ *pResult = E_OUTOFMEMORY;
|
||||
HeapFree(GetProcessHeap(),0,lpeidl->mpPidlMgr);
|
||||
HeapFree(GetProcessHeap(),0,lpeidl);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{ if(pResult)
|
||||
{ *pResult = E_OUTOFMEMORY;
|
||||
HeapFree(GetProcessHeap(),0,lpeidl);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE(shell,"-- (%p)->()\n",lpeidl);
|
||||
TRACE(shell,"-- (%p)->()\n",lpeidl);
|
||||
return lpeidl;
|
||||
}
|
||||
|
||||
|
@ -128,8 +118,9 @@ static ULONG WINAPI IEnumIDList_Release(LPENUMIDLIST this)
|
|||
{ TRACE(shell,"(%p)->()\n",this);
|
||||
if (!--(this->ref))
|
||||
{ TRACE(shell," destroying IEnumIDList(%p)\n",this);
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
return 0;
|
||||
IEnumIDList_DeleteList(this);
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
return 0;
|
||||
}
|
||||
return this->ref;
|
||||
}
|
||||
|
@ -140,38 +131,38 @@ static ULONG WINAPI IEnumIDList_Release(LPENUMIDLIST this)
|
|||
|
||||
static HRESULT WINAPI IEnumIDList_Next(
|
||||
LPENUMIDLIST this,ULONG celt,LPITEMIDLIST * rgelt,ULONG *pceltFetched)
|
||||
{ ULONG i;
|
||||
HRESULT hr = S_OK;
|
||||
LPITEMIDLIST temp;
|
||||
{ ULONG i;
|
||||
HRESULT hr = S_OK;
|
||||
LPITEMIDLIST temp;
|
||||
|
||||
TRACE(shell,"(%p)->(%ld,%p, %p)\n",this,celt,rgelt,pceltFetched);
|
||||
|
||||
/* It is valid to leave pceltFetched NULL when celt is 1. Some of explorer's
|
||||
subsystems actually use it (and so may a third party browser)
|
||||
*/
|
||||
if(pceltFetched)
|
||||
*pceltFetched = 0;
|
||||
/* It is valid to leave pceltFetched NULL when celt is 1. Some of explorer's
|
||||
* subsystems actually use it (and so may a third party browser)
|
||||
*/
|
||||
if(pceltFetched)
|
||||
*pceltFetched = 0;
|
||||
|
||||
*rgelt=0;
|
||||
|
||||
if(celt > 1 && !pceltFetched)
|
||||
{ return E_INVALIDARG;
|
||||
if(celt > 1 && !pceltFetched)
|
||||
{ return E_INVALIDARG;
|
||||
}
|
||||
|
||||
for(i = 0; i < celt; i++)
|
||||
{ if(!(this->mpCurrent))
|
||||
{ hr = S_FALSE;
|
||||
break;
|
||||
}
|
||||
temp = ILClone(this->mpCurrent->pidl);
|
||||
rgelt[i] = temp;
|
||||
this->mpCurrent = this->mpCurrent->pNext;
|
||||
}
|
||||
if(pceltFetched)
|
||||
{ *pceltFetched = i;
|
||||
for(i = 0; i < celt; i++)
|
||||
{ if(!(this->mpCurrent))
|
||||
{ hr = S_FALSE;
|
||||
break;
|
||||
}
|
||||
temp = ILClone(this->mpCurrent->pidl);
|
||||
rgelt[i] = temp;
|
||||
this->mpCurrent = this->mpCurrent->pNext;
|
||||
}
|
||||
if(pceltFetched)
|
||||
{ *pceltFetched = i;
|
||||
}
|
||||
|
||||
return hr;
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -215,96 +206,123 @@ static HRESULT WINAPI IEnumIDList_Clone(
|
|||
* fixme: add wildcards to path
|
||||
*/
|
||||
static BOOL32 WINAPI IEnumIDList_CreateEnumList(LPENUMIDLIST this, LPCSTR lpszPath, DWORD dwFlags)
|
||||
{ LPITEMIDLIST pidl=NULL;
|
||||
WIN32_FIND_DATA32A stffile;
|
||||
HANDLE32 hFile;
|
||||
DWORD dwDrivemap;
|
||||
CHAR szDriveName[4];
|
||||
CHAR szPath[MAX_PATH];
|
||||
{ LPITEMIDLIST pidl=NULL;
|
||||
LPPIDLDATA pData=NULL;
|
||||
WIN32_FIND_DATA32A stffile;
|
||||
HANDLE32 hFile;
|
||||
DWORD dwDrivemap;
|
||||
CHAR szDriveName[4];
|
||||
CHAR szPath[MAX_PATH];
|
||||
|
||||
TRACE(shell,"(%p)->(%s 0x%08lx) \n",this,debugstr_a(lpszPath),dwFlags);
|
||||
TRACE(shell,"(%p)->(%s 0x%08lx) \n",this,debugstr_a(lpszPath),dwFlags);
|
||||
|
||||
if (lpszPath && lpszPath[0]!='\0')
|
||||
{ strcpy(szPath, lpszPath);
|
||||
PathAddBackslash(szPath);
|
||||
strcat(szPath,"*.*");
|
||||
}
|
||||
if (lpszPath && lpszPath[0]!='\0')
|
||||
{ strcpy(szPath, lpszPath);
|
||||
PathAddBackslash(szPath);
|
||||
strcat(szPath,"*.*");
|
||||
}
|
||||
|
||||
/*enumerate the folders*/
|
||||
if(dwFlags & SHCONTF_FOLDERS)
|
||||
{ /* special case - we can't enumerate the Desktop level Objects (MyComputer,Nethood...
|
||||
so we need to fake an enumeration of those.*/
|
||||
/*enumerate the folders*/
|
||||
if(dwFlags & SHCONTF_FOLDERS)
|
||||
{ /* special case - we can't enumerate the Desktop level Objects (MyComputer,Nethood...
|
||||
so we need to fake an enumeration of those.*/
|
||||
if(!lpszPath)
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_FOLDERS (special) items\n",this);
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_FOLDERS (special) items\n",this);
|
||||
//create the pidl for this item
|
||||
pidl = this->mpPidlMgr->lpvtbl->fnCreateMyComputer(this->mpPidlMgr);
|
||||
if(pidl)
|
||||
{ if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (lpszPath[0]=='\0') /* enumerate the drives*/
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_FOLDERS (drives)\n",this);
|
||||
dwDrivemap = GetLogicalDrives();
|
||||
strcpy (szDriveName,"A:\\");
|
||||
while (szDriveName[0]<='Z')
|
||||
{ if(dwDrivemap & 0x00000001L)
|
||||
{ pidl = this->mpPidlMgr->lpvtbl->fnCreateDrive(this->mpPidlMgr,szDriveName );
|
||||
if(pidl)
|
||||
{ if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
szDriveName[0]++;
|
||||
dwDrivemap = dwDrivemap >> 1;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_FOLDERS of %s\n",this,debugstr_a(szPath));
|
||||
hFile = FindFirstFile32A(szPath,&stffile);
|
||||
if ( hFile != INVALID_HANDLE_VALUE32 )
|
||||
{ do
|
||||
{ if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && strcmp (stffile.cFileName, ".") && strcmp (stffile.cFileName, ".."))
|
||||
{ pidl = this->mpPidlMgr->lpvtbl->fnCreateFolder(this->mpPidlMgr, stffile.cFileName);
|
||||
if(pidl)
|
||||
{ if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
} while( FindNextFile32A(hFile,&stffile));
|
||||
pidl = _ILCreateMyComputer();
|
||||
if(pidl)
|
||||
{ pData = _ILGetDataPointer(pidl);
|
||||
pData->u.generic.dwSFGAO = SFGAO_HASPROPSHEET | SFGAO_READONLY | SFGAO_HASSUBFOLDER;
|
||||
if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (lpszPath[0]=='\0') /* enumerate the drives*/
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_FOLDERS (drives)\n",this);
|
||||
dwDrivemap = GetLogicalDrives();
|
||||
strcpy (szDriveName,"A:\\");
|
||||
while (szDriveName[0]<='Z')
|
||||
{ if(dwDrivemap & 0x00000001L)
|
||||
{ pidl = _ILCreateDrive(szDriveName);
|
||||
pData = _ILGetDataPointer(pidl);
|
||||
pData->u.drive.dwSFGAO = SFGAO_HASPROPSHEET | SFGAO_READONLY | SFGAO_CANLINK |
|
||||
SFGAO_HASSUBFOLDER | SFGAO_DROPTARGET | SFGAO_FILESYSTEM;
|
||||
if(pidl)
|
||||
{ if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
szDriveName[0]++;
|
||||
dwDrivemap = dwDrivemap >> 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_FOLDERS of %s\n",this,debugstr_a(szPath));
|
||||
hFile = FindFirstFile32A(szPath,&stffile);
|
||||
if ( hFile != INVALID_HANDLE_VALUE32 )
|
||||
{ do
|
||||
{ if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && strcmp (stffile.cFileName, ".") && strcmp (stffile.cFileName, ".."))
|
||||
{ pidl = _ILCreateFolder( stffile.cFileName);
|
||||
if(pidl)
|
||||
{ pData = _ILGetDataPointer(pidl);
|
||||
pData->u.folder.dwSFGAO = SFGAO_CANCOPY | SFGAO_CANDELETE | SFGAO_CANLINK |
|
||||
SFGAO_CANMOVE | SFGAO_CANRENAME | SFGAO_DROPTARGET |
|
||||
SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
|
||||
if ( stffile.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
||||
{ pData->u.folder.dwSFGAO |= SFGAO_READONLY;
|
||||
}
|
||||
FileTimeToDosDateTime(&stffile.ftLastWriteTime,&pData->u.folder.uFileDate,&pData->u.folder.uFileTime);
|
||||
pData->u.folder.dwFileSize = stffile.nFileSizeLow;
|
||||
pData->u.folder.uFileAttribs=stffile.dwFileAttributes;
|
||||
strncpy (pData->u.folder.szAlternateName, stffile.cAlternateFileName,14);
|
||||
if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
} while( FindNextFile32A(hFile,&stffile));
|
||||
FindClose32 (hFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
//enumerate the non-folder items (values)
|
||||
if(dwFlags & SHCONTF_NONFOLDERS)
|
||||
{ if(lpszPath)
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_NONFOLDERS of %s\n",this,debugstr_a(szPath));
|
||||
hFile = FindFirstFile32A(szPath,&stffile);
|
||||
if ( hFile != INVALID_HANDLE_VALUE32 )
|
||||
{ do
|
||||
{ if (! (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
{ pidl = this->mpPidlMgr->lpvtbl->fnCreateValue(this->mpPidlMgr, stffile.cFileName);
|
||||
if(pidl)
|
||||
{ if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
} while( FindNextFile32A(hFile,&stffile));
|
||||
FindClose32 (hFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//enumerate the non-folder items (values)
|
||||
if(dwFlags & SHCONTF_NONFOLDERS)
|
||||
{ if(lpszPath)
|
||||
{ TRACE (shell,"-- (%p)-> enumerate SHCONTF_NONFOLDERS of %s\n",this,debugstr_a(szPath));
|
||||
hFile = FindFirstFile32A(szPath,&stffile);
|
||||
if ( hFile != INVALID_HANDLE_VALUE32 )
|
||||
{ do
|
||||
{ if (! (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
{ pidl = _ILCreateValue( stffile.cFileName);
|
||||
if(pidl)
|
||||
{ pData = _ILGetDataPointer(pidl);
|
||||
pData->u.file.dwSFGAO = SFGAO_CANCOPY | SFGAO_CANDELETE | SFGAO_CANLINK |
|
||||
SFGAO_CANMOVE | SFGAO_CANRENAME | SFGAO_DROPTARGET |
|
||||
SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM;
|
||||
if ( stffile.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
||||
{ pData->u.file.dwSFGAO |= SFGAO_READONLY;
|
||||
}
|
||||
FileTimeToDosDateTime(&stffile.ftLastWriteTime,&pData->u.file.uFileDate,&pData->u.file.uFileTime);
|
||||
pData->u.file.dwFileSize = stffile.nFileSizeLow;
|
||||
pData->u.file.uFileAttribs=stffile.dwFileAttributes;
|
||||
strncpy (pData->u.file.szAlternateName, stffile.cAlternateFileName,14);
|
||||
if(!IEnumIDList_AddToEnumList(this, pidl))
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ return FALSE;
|
||||
}
|
||||
}
|
||||
} while( FindNextFile32A(hFile,&stffile));
|
||||
FindClose32 (hFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -314,7 +332,7 @@ static BOOL32 WINAPI IEnumIDList_AddToEnumList(LPENUMIDLIST this,LPITEMIDLIST pi
|
|||
{ LPENUMLIST pNew;
|
||||
|
||||
TRACE(shell,"(%p)->(pidl=%p)\n",this,pidl);
|
||||
pNew = (LPENUMLIST)HeapAlloc(GetProcessHeap(),0,sizeof(ENUMLIST));
|
||||
pNew = (LPENUMLIST)SHAlloc(sizeof(ENUMLIST));
|
||||
if(pNew)
|
||||
{ //set the next pointer
|
||||
pNew->pNext = NULL;
|
||||
|
|
|
@ -35,8 +35,8 @@ static HRESULT WINAPI IExtractIcon_QueryInterface(LPEXTRACTICON, REFIID, LPVOID
|
|||
static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON);
|
||||
static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON);
|
||||
static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON);
|
||||
static HRESULT IExtractIcon_GetIconLocation(LPEXTRACTICON, UINT32, LPSTR, UINT32, int *, UINT32 *);
|
||||
static HRESULT IExtractIcon_Extract(LPEXTRACTICON, LPCSTR, UINT32, HICON32 *, HICON32 *, UINT32);
|
||||
static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON, UINT32, LPSTR, UINT32, int *, UINT32 *);
|
||||
static HRESULT WINAPI IExtractIcon_Extract(LPEXTRACTICON, LPCSTR, UINT32, HICON32 *, HICON32 *, UINT32);
|
||||
|
||||
/* IShellLink Implementation */
|
||||
static HRESULT WINAPI IShellLink_QueryInterface(LPSHELLLINK,REFIID,LPVOID*);
|
||||
|
@ -118,16 +118,22 @@ static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON this)
|
|||
* NOTE
|
||||
* FIXME returns allways the icon no. 3 (closed Folder)
|
||||
*/
|
||||
static HRESULT IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT32 uFlags, LPSTR szIconFile, UINT32 cchMax, int * piIndex, UINT32 * pwFlags)
|
||||
static HRESULT WINAPI IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT32 uFlags, LPSTR szIconFile, UINT32 cchMax, int * piIndex, UINT32 * pwFlags)
|
||||
{ FIXME (shell,"(%p) (flags=%u file=%s max=%u %p %p) semi-stub\n", this, uFlags, szIconFile, cchMax, piIndex, pwFlags);
|
||||
*pwFlags = GIL_NOTFILENAME;
|
||||
*piIndex = 3;
|
||||
return NOERROR;
|
||||
if (!szIconFile)
|
||||
{ *piIndex = 20;
|
||||
}
|
||||
else
|
||||
{ *piIndex = 3;
|
||||
}
|
||||
*pwFlags = GIL_NOTFILENAME;
|
||||
|
||||
return NOERROR;
|
||||
}
|
||||
/**************************************************************************
|
||||
* IExtractIcon_Extract
|
||||
*/
|
||||
static HRESULT IExtractIcon_Extract(LPEXTRACTICON this, LPCSTR pszFile, UINT32 nIconIndex, HICON32 *phiconLarge, HICON32 *phiconSmall, UINT32 nIconSize)
|
||||
static HRESULT WINAPI IExtractIcon_Extract(LPEXTRACTICON this, LPCSTR pszFile, UINT32 nIconIndex, HICON32 *phiconLarge, HICON32 *phiconSmall, UINT32 nIconSize)
|
||||
{ FIXME (shell,"(%p) (file=%s index=%u %p %p size=%u) semi-stub\n", this, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
|
||||
*phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
|
||||
*phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
|
||||
|
|
|
@ -26,16 +26,18 @@
|
|||
#include "pidl.h"
|
||||
|
||||
void pdump (LPCITEMIDLIST pidl)
|
||||
{ DWORD type;
|
||||
CHAR * szData;
|
||||
LPITEMIDLIST pidltemp = pidl;
|
||||
TRACE(pidl,"---------- pidl=%p \n", pidl);
|
||||
do
|
||||
{ szData = ((LPPIDLDATA )(pidltemp->mkid.abID))->szText;
|
||||
type = ((LPPIDLDATA )(pidltemp->mkid.abID))->type;
|
||||
TRACE(pidl,"---- pidl=%p size=%u type=%lx %s\n",pidltemp, pidltemp->mkid.cb,type,debugstr_a(szData));
|
||||
pidltemp = (LPITEMIDLIST)(((BYTE*)pidltemp)+pidltemp->mkid.cb);
|
||||
} while (pidltemp->mkid.cb);
|
||||
{ DWORD type;
|
||||
CHAR * szData;
|
||||
LPITEMIDLIST pidltemp = pidl;
|
||||
TRACE(pidl,"---------- pidl=%p \n", pidl);
|
||||
do
|
||||
{ type = _ILGetDataPointer(pidltemp)->type;
|
||||
szData = _ILGetTextPointer(type, _ILGetDataPointer(pidltemp));
|
||||
|
||||
TRACE(pidl,"---- pidl=%p size=%u type=%lx %s\n",pidltemp, pidltemp->mkid.cb,type,debugstr_a(szData));
|
||||
|
||||
pidltemp = ILGetNext(pidltemp);
|
||||
} while (pidltemp->mkid.cb);
|
||||
}
|
||||
/*************************************************************************
|
||||
* ILGetDisplayName [SHELL32.15]
|
||||
|
@ -48,20 +50,18 @@ BOOL32 WINAPI ILGetDisplayName(LPCITEMIDLIST iil,LPSTR path)
|
|||
/*************************************************************************
|
||||
* ILFindLastID [SHELL32.16]
|
||||
*/
|
||||
LPSHITEMID WINAPI ILFindLastID(LPITEMIDLIST iil)
|
||||
{ LPSHITEMID lastsii,sii;
|
||||
LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl)
|
||||
{ LPITEMIDLIST pidlLast = NULL;
|
||||
|
||||
TRACE(pidl,"%p\n",iil);
|
||||
if (!iil)
|
||||
{ return NULL;
|
||||
}
|
||||
sii = &(iil->mkid);
|
||||
lastsii = sii;
|
||||
while (sii->cb)
|
||||
{ lastsii = sii;
|
||||
sii = (LPSHITEMID)(((char*)sii)+sii->cb);
|
||||
TRACE(pidl,"(pidl=%p)\n",pidl);
|
||||
|
||||
if(pidl)
|
||||
{ while(pidl->mkid.cb)
|
||||
{ pidlLast = (LPITEMIDLIST)pidl;
|
||||
pidl = ILGetNext(pidl);
|
||||
}
|
||||
}
|
||||
return lastsii;
|
||||
return pidlLast;
|
||||
}
|
||||
/*************************************************************************
|
||||
* ILRemoveLastID [SHELL32.17]
|
||||
|
@ -69,13 +69,11 @@ LPSHITEMID WINAPI ILFindLastID(LPITEMIDLIST iil)
|
|||
* Removes the last item
|
||||
*/
|
||||
BOOL32 WINAPI ILRemoveLastID(LPCITEMIDLIST pidl)
|
||||
{ LPCITEMIDLIST xpidl;
|
||||
|
||||
TRACE(shell,"pidl=%p\n",pidl);
|
||||
if (!pidl || !pidl->mkid.cb)
|
||||
return 0;
|
||||
ILFindLastID(pidl)->cb = 0;
|
||||
return 1;
|
||||
{ TRACE(shell,"pidl=%p\n",pidl);
|
||||
if (!pidl || !pidl->mkid.cb)
|
||||
return 0;
|
||||
ILFindLastID(pidl)->mkid.cb = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -181,7 +179,7 @@ DWORD WINAPI ILGetSize(LPITEMIDLIST pidl)
|
|||
}
|
||||
/*************************************************************************
|
||||
* ILGetNext [SHELL32.153]
|
||||
* gets the next simple pidl ot of a complex pidl
|
||||
* gets the next simple pidl of a complex pidl
|
||||
*
|
||||
* PARAMETERS
|
||||
* pidl ITEMIDLIST
|
||||
|
@ -191,16 +189,16 @@ DWORD WINAPI ILGetSize(LPITEMIDLIST pidl)
|
|||
*
|
||||
*/
|
||||
LPITEMIDLIST WINAPI ILGetNext(LPITEMIDLIST pidl)
|
||||
{ LPITEMIDLIST nextpidl;
|
||||
{ LPITEMIDLIST nextpidl;
|
||||
|
||||
TRACE(pidl,"(pidl=%p)\n",pidl);
|
||||
if(pidl)
|
||||
{ nextpidl = (LPITEMIDLIST)(LPBYTE)(((LPBYTE)pidl) + pidl->mkid.cb);
|
||||
return nextpidl;
|
||||
}
|
||||
else
|
||||
{ return (NULL);
|
||||
}
|
||||
TRACE(pidl,"(pidl=%p)\n",pidl);
|
||||
if(pidl)
|
||||
{ nextpidl = (LPITEMIDLIST)(LPBYTE)(((LPBYTE)pidl) + pidl->mkid.cb);
|
||||
return nextpidl;
|
||||
}
|
||||
else
|
||||
{ return (NULL);
|
||||
}
|
||||
}
|
||||
/*************************************************************************
|
||||
* ILAppend [SHELL32.154]
|
||||
|
@ -231,152 +229,83 @@ DWORD WINAPI ILFree(LPVOID pidl)
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* INTERNAL CLASS pidlmgr
|
||||
* internal functions
|
||||
*/
|
||||
|
||||
static struct PidlMgr_VTable pmgrvt = {
|
||||
PidlMgr_CreateDesktop,
|
||||
PidlMgr_CreateMyComputer,
|
||||
PidlMgr_CreateDrive,
|
||||
PidlMgr_CreateFolder,
|
||||
PidlMgr_CreateValue,
|
||||
PidlMgr_GetDesktop,
|
||||
PidlMgr_GetDrive,
|
||||
PidlMgr_GetLastItem,
|
||||
PidlMgr_GetItemText,
|
||||
PidlMgr_IsDesktop,
|
||||
PidlMgr_IsMyComputer,
|
||||
PidlMgr_IsDrive,
|
||||
PidlMgr_IsFolder,
|
||||
PidlMgr_IsValue,
|
||||
PidlMgr_HasFolders,
|
||||
PidlMgr_GetFolderText,
|
||||
PidlMgr_GetValueText,
|
||||
PidlMgr_GetValueType,
|
||||
PidlMgr_GetDataText,
|
||||
PidlMgr_GetPidlPath,
|
||||
PidlMgr_Create,
|
||||
PidlMgr_GetData,
|
||||
PidlMgr_GetDataPointer,
|
||||
PidlMgr_SeparatePathAndValue
|
||||
};
|
||||
/**************************************************************************
|
||||
* PidlMgr_Constructor
|
||||
* _ILCreateDesktop()
|
||||
* _ILCreateMyComputer()
|
||||
* _ILCreateDrive()
|
||||
* _ILCreateFolder()
|
||||
* _ILCreateValue()
|
||||
*/
|
||||
LPPIDLMGR PidlMgr_Constructor()
|
||||
{ LPPIDLMGR pmgr;
|
||||
pmgr = (LPPIDLMGR)HeapAlloc(GetProcessHeap(),0,sizeof(pidlmgr));
|
||||
pmgr->lpvtbl = &pmgrvt;
|
||||
TRACE(pidl,"(%p)->()\n",pmgr);
|
||||
/** FIXMEDllRefCount++;*/
|
||||
return pmgr;
|
||||
LPITEMIDLIST WINAPI _ILCreateDesktop()
|
||||
{ TRACE(pidl,"()\n");
|
||||
return _ILCreate(PT_DESKTOP, NULL, 0);
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_Destructor
|
||||
*/
|
||||
void PidlMgr_Destructor(LPPIDLMGR this)
|
||||
{ HeapFree(GetProcessHeap(),0,this);
|
||||
TRACE(pidl,"(%p)->()\n",this);
|
||||
/** FIXMEDllRefCount--;*/
|
||||
LPITEMIDLIST WINAPI _ILCreateMyComputer()
|
||||
{ TRACE(pidl,"()\n");
|
||||
return _ILCreate(PT_MYCOMP, (void *)"My Computer", strlen ("My Computer")+1);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* PidlMgr_CreateDesktop()
|
||||
* PidlMgr_CreateMyComputer()
|
||||
* PidlMgr_CreateDrive()
|
||||
* PidlMgr_CreateFolder()
|
||||
* PidlMgr_CreateValue()
|
||||
*/
|
||||
LPITEMIDLIST PidlMgr_CreateDesktop(LPPIDLMGR this)
|
||||
{ TRACE(pidl,"(%p)->()\n",this);
|
||||
return PidlMgr_Create(this,PT_DESKTOP, NULL, 0);
|
||||
}
|
||||
LPITEMIDLIST PidlMgr_CreateMyComputer(LPPIDLMGR this)
|
||||
{ TRACE(pidl,"(%p)->()\n",this);
|
||||
return PidlMgr_Create(this,PT_MYCOMP, (void *)"My Computer", strlen ("My Computer")+1);
|
||||
}
|
||||
LPITEMIDLIST PidlMgr_CreateDrive(LPPIDLMGR this, LPCSTR lpszNew)
|
||||
{ char sTemp[4];
|
||||
strncpy (sTemp,lpszNew,4);
|
||||
LPITEMIDLIST WINAPI _ILCreateDrive( LPCSTR lpszNew)
|
||||
{ char sTemp[4];
|
||||
strncpy (sTemp,lpszNew,4);
|
||||
sTemp[2]='\\';
|
||||
sTemp[3]=0x00;
|
||||
TRACE(pidl,"(%p)->(%s)\n",this,sTemp);
|
||||
return PidlMgr_Create(this,PT_DRIVE,(LPVOID)&sTemp[0],4);
|
||||
TRACE(pidl,"(%s)\n",sTemp);
|
||||
return _ILCreate(PT_DRIVE,(LPVOID)&sTemp[0],4);
|
||||
}
|
||||
LPITEMIDLIST PidlMgr_CreateFolder(LPPIDLMGR this, LPCSTR lpszNew)
|
||||
{ TRACE(pidl,"(%p)->(%s)\n",this,lpszNew);
|
||||
return PidlMgr_Create(this,PT_FOLDER, (LPVOID)lpszNew, strlen(lpszNew)+1);
|
||||
LPITEMIDLIST WINAPI _ILCreateFolder( LPCSTR lpszNew)
|
||||
{ TRACE(pidl,"(%s)\n",lpszNew);
|
||||
return _ILCreate(PT_FOLDER, (LPVOID)lpszNew, strlen(lpszNew)+1);
|
||||
}
|
||||
LPITEMIDLIST PidlMgr_CreateValue(LPPIDLMGR this,LPCSTR lpszNew)
|
||||
{ TRACE(pidl,"(%p)->(%s)\n",this,lpszNew);
|
||||
return PidlMgr_Create(this,PT_VALUE, (LPVOID)lpszNew, strlen(lpszNew)+1);
|
||||
LPITEMIDLIST WINAPI _ILCreateValue(LPCSTR lpszNew)
|
||||
{ TRACE(pidl,"(%s)\n",lpszNew);
|
||||
return _ILCreate(PT_VALUE, (LPVOID)lpszNew, strlen(lpszNew)+1);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetDesktop()
|
||||
*
|
||||
* FIXME: quick hack
|
||||
*/
|
||||
BOOL32 PidlMgr_GetDesktop(LPPIDLMGR this,LPCITEMIDLIST pidl,LPSTR pOut)
|
||||
{ TRACE(pidl,"(%p)->(%p %p)\n",this,pidl,pOut);
|
||||
return (BOOL32)PidlMgr_GetData(this,PT_DESKTOP, pidl, (LPVOID)pOut, 255);
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetDrive()
|
||||
* _ILGetDrive()
|
||||
*
|
||||
* FIXME: quick hack
|
||||
*/
|
||||
BOOL32 PidlMgr_GetDrive(LPPIDLMGR this,LPCITEMIDLIST pidl,LPSTR pOut, UINT16 uSize)
|
||||
{ LPITEMIDLIST pidlTemp=NULL;
|
||||
BOOL32 WINAPI _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT16 uSize)
|
||||
{ LPITEMIDLIST pidlTemp=NULL;
|
||||
|
||||
TRACE(pidl,"(%p)->(%p,%p,%u)\n",this,pidl,pOut,uSize);
|
||||
if(PidlMgr_IsMyComputer(this,pidl))
|
||||
{ pidlTemp = ILGetNext(pidl);
|
||||
TRACE(pidl,"(%p,%p,%u)\n",pidl,pOut,uSize);
|
||||
if(_ILIsMyComputer(pidl))
|
||||
{ pidlTemp = ILGetNext(pidl);
|
||||
}
|
||||
else if (pidlTemp && PidlMgr_IsDrive(this,pidlTemp))
|
||||
{ return (BOOL32)PidlMgr_GetData(this,PT_DRIVE, pidlTemp, (LPVOID)pOut, uSize);
|
||||
else if (pidlTemp && _ILIsDrive(pidlTemp))
|
||||
{ return (BOOL32)_ILGetData(PT_DRIVE, pidlTemp, (LPVOID)pOut, uSize);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetLastItem()
|
||||
* Gets the last item in the list
|
||||
*/
|
||||
LPITEMIDLIST PidlMgr_GetLastItem(LPPIDLMGR this,LPCITEMIDLIST pidl)
|
||||
{ LPITEMIDLIST pidlLast = NULL;
|
||||
|
||||
TRACE(pidl,"(%p)->(pidl=%p)\n",this,pidl);
|
||||
|
||||
if(pidl)
|
||||
{ while(pidl->mkid.cb)
|
||||
{ pidlLast = (LPITEMIDLIST)pidl;
|
||||
pidl = ILGetNext(pidl);
|
||||
}
|
||||
}
|
||||
return pidlLast;
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetItemText()
|
||||
* _ILGetItemText()
|
||||
* Gets the text for only this item
|
||||
*/
|
||||
DWORD PidlMgr_GetItemText(LPPIDLMGR this,LPCITEMIDLIST pidl, LPSTR lpszText, UINT16 uSize)
|
||||
{ TRACE(pidl,"(%p)->(pidl=%p %p %x)\n",this,pidl,lpszText,uSize);
|
||||
if (PidlMgr_IsMyComputer(this, pidl))
|
||||
{ return PidlMgr_GetData(this,PT_MYCOMP, pidl, (LPVOID)lpszText, uSize);
|
||||
DWORD WINAPI _ILGetItemText(LPCITEMIDLIST pidl, LPSTR lpszText, UINT16 uSize)
|
||||
{ TRACE(pidl,"(pidl=%p %p %x)\n",pidl,lpszText,uSize);
|
||||
if (_ILIsMyComputer(pidl))
|
||||
{ return _ILGetData(PT_MYCOMP, pidl, (LPVOID)lpszText, uSize);
|
||||
}
|
||||
if (PidlMgr_IsDrive(this, pidl))
|
||||
{ return PidlMgr_GetData(this,PT_DRIVE, pidl, (LPVOID)lpszText, uSize);
|
||||
if (_ILIsDrive(pidl))
|
||||
{ return _ILGetData(PT_DRIVE, pidl, (LPVOID)lpszText, uSize);
|
||||
}
|
||||
return PidlMgr_GetData(this,PT_TEXT, pidl, (LPVOID)lpszText, uSize);
|
||||
if (_ILIsFolder (pidl))
|
||||
{ return _ILGetData(PT_FOLDER, pidl, (LPVOID)lpszText, uSize);
|
||||
}
|
||||
return _ILGetData(PT_VALUE, pidl, (LPVOID)lpszText, uSize);
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_IsDesktop()
|
||||
* PidlMgr_IsDrive()
|
||||
* PidlMgr_IsFolder()
|
||||
* PidlMgr_IsValue()
|
||||
* _ILIsDesktop()
|
||||
* _ILIsDrive()
|
||||
* _ILIsFolder()
|
||||
* _ILIsValue()
|
||||
*/
|
||||
BOOL32 PidlMgr_IsDesktop(LPPIDLMGR this,LPCITEMIDLIST pidl)
|
||||
{ TRACE(pidl,"%p->(%p)\n",this,pidl);
|
||||
BOOL32 WINAPI _ILIsDesktop(LPCITEMIDLIST pidl)
|
||||
{ TRACE(pidl,"(%p)\n",pidl);
|
||||
|
||||
if (! pidl)
|
||||
return FALSE;
|
||||
|
@ -384,239 +313,184 @@ BOOL32 PidlMgr_IsDesktop(LPPIDLMGR this,LPCITEMIDLIST pidl)
|
|||
return ( pidl->mkid.cb == 0x00 );
|
||||
}
|
||||
|
||||
BOOL32 PidlMgr_IsMyComputer(LPPIDLMGR this,LPCITEMIDLIST pidl)
|
||||
BOOL32 WINAPI _ILIsMyComputer(LPCITEMIDLIST pidl)
|
||||
{ LPPIDLDATA pData;
|
||||
TRACE(pidl,"%p->(%p)\n",this,pidl);
|
||||
TRACE(pidl,"(%p)\n",pidl);
|
||||
|
||||
if (! pidl)
|
||||
return FALSE;
|
||||
|
||||
pData = PidlMgr_GetDataPointer(this,pidl);
|
||||
pData = _ILGetDataPointer(pidl);
|
||||
return (PT_MYCOMP == pData->type);
|
||||
}
|
||||
|
||||
BOOL32 PidlMgr_IsDrive(LPPIDLMGR this,LPCITEMIDLIST pidl)
|
||||
BOOL32 WINAPI _ILIsDrive(LPCITEMIDLIST pidl)
|
||||
{ LPPIDLDATA pData;
|
||||
TRACE(pidl,"%p->(%p)\n",this,pidl);
|
||||
TRACE(pidl,"(%p)\n",pidl);
|
||||
|
||||
if (! pidl)
|
||||
return FALSE;
|
||||
|
||||
pData = PidlMgr_GetDataPointer(this,pidl);
|
||||
pData = _ILGetDataPointer(pidl);
|
||||
return (PT_DRIVE == pData->type);
|
||||
}
|
||||
|
||||
BOOL32 PidlMgr_IsFolder(LPPIDLMGR this,LPCITEMIDLIST pidl)
|
||||
BOOL32 WINAPI _ILIsFolder(LPCITEMIDLIST pidl)
|
||||
{ LPPIDLDATA pData;
|
||||
TRACE(pidl,"%p->(%p)\n",this,pidl);
|
||||
TRACE(pidl,"(%p)\n",pidl);
|
||||
|
||||
if (! pidl)
|
||||
return FALSE;
|
||||
|
||||
pData = PidlMgr_GetDataPointer(this,pidl);
|
||||
pData = _ILGetDataPointer(pidl);
|
||||
return (PT_FOLDER == pData->type);
|
||||
}
|
||||
|
||||
BOOL32 PidlMgr_IsValue(LPPIDLMGR this,LPCITEMIDLIST pidl)
|
||||
BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST pidl)
|
||||
{ LPPIDLDATA pData;
|
||||
TRACE(pidl,"%p->(%p)\n",this,pidl);
|
||||
TRACE(pidl,"(%p)\n",pidl);
|
||||
|
||||
if (! pidl)
|
||||
return FALSE;
|
||||
|
||||
pData = PidlMgr_GetDataPointer(this,pidl);
|
||||
pData = _ILGetDataPointer(pidl);
|
||||
return (PT_VALUE == pData->type);
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_HasFolders()
|
||||
* _ILHasFolders()
|
||||
* fixme: quick hack
|
||||
*/
|
||||
BOOL32 PidlMgr_HasFolders(LPPIDLMGR this, LPSTR pszPath, LPCITEMIDLIST pidl)
|
||||
{ BOOL32 bResult= FALSE;
|
||||
WIN32_FIND_DATA32A stffile;
|
||||
HANDLE32 hFile;
|
||||
BOOL32 WINAPI _ILHasFolders( LPSTR pszPath, LPCITEMIDLIST pidl)
|
||||
{ BOOL32 bResult= FALSE;
|
||||
WIN32_FIND_DATA32A stffile;
|
||||
HANDLE32 hFile;
|
||||
|
||||
TRACE(pidl,"(%p)->%p %p\n",this, pszPath, pidl);
|
||||
TRACE(pidl,"%p %p\n", pszPath, pidl);
|
||||
|
||||
hFile = FindFirstFile32A(pszPath,&stffile);
|
||||
do
|
||||
{ if (! (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
{ bResult= TRUE;
|
||||
}
|
||||
} while( FindNextFile32A(hFile,&stffile));
|
||||
FindClose32 (hFile);
|
||||
hFile = FindFirstFile32A(pszPath,&stffile);
|
||||
do
|
||||
{ if (! (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
{ bResult= TRUE;
|
||||
}
|
||||
} while( FindNextFile32A(hFile,&stffile));
|
||||
FindClose32 (hFile);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetFolderText()
|
||||
* _ILGetFolderText()
|
||||
* Creates a Path string from a PIDL, filtering out the special Folders
|
||||
*/
|
||||
DWORD PidlMgr_GetFolderText(LPPIDLMGR this,LPCITEMIDLIST pidl,
|
||||
LPSTR lpszPath, DWORD dwSize)
|
||||
{ LPITEMIDLIST pidlTemp;
|
||||
DWORD dwCopied = 0;
|
||||
DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST pidl,LPSTR lpszPath, DWORD dwSize)
|
||||
{ LPITEMIDLIST pidlTemp;
|
||||
DWORD dwCopied = 0;
|
||||
LPSTR pText;
|
||||
|
||||
TRACE(pidl,"(%p)->(%p)\n",this,pidl);
|
||||
TRACE(pidl,"(%p)\n",pidl);
|
||||
|
||||
if(!pidl)
|
||||
{ return 0;
|
||||
}
|
||||
|
||||
if(PidlMgr_IsMyComputer(this,pidl))
|
||||
{ pidlTemp = ILGetNext(pidl);
|
||||
TRACE(pidl,"-- (%p)->skip My Computer\n",this);
|
||||
}
|
||||
else
|
||||
{ pidlTemp = (LPITEMIDLIST)pidl;
|
||||
}
|
||||
|
||||
//if this is NULL, return the required size of the buffer
|
||||
if(!lpszPath)
|
||||
{ while(pidlTemp->mkid.cb)
|
||||
{ LPPIDLDATA pData = PidlMgr_GetDataPointer(this,pidlTemp);
|
||||
|
||||
//add the length of this item plus one for the backslash
|
||||
dwCopied += strlen(pData->szText) + 1; /* FIXME pData->szText is not every time a string*/
|
||||
|
||||
pidlTemp = ILGetNext(pidlTemp);
|
||||
}
|
||||
|
||||
//add one for the NULL terminator
|
||||
TRACE(pidl,"-- (%p)->(size=%lu)\n",this,dwCopied);
|
||||
return dwCopied + 1;
|
||||
}
|
||||
|
||||
*lpszPath = 0;
|
||||
|
||||
while(pidlTemp->mkid.cb && (dwCopied < dwSize))
|
||||
{ LPPIDLDATA pData = PidlMgr_GetDataPointer(this,pidlTemp);
|
||||
|
||||
//if this item is a value, then skip it and finish
|
||||
if(PT_VALUE == pData->type)
|
||||
{ break;
|
||||
if(!pidl)
|
||||
{ return 0;
|
||||
}
|
||||
|
||||
strcat(lpszPath, pData->szText);
|
||||
strcat(lpszPath, "\\");
|
||||
dwCopied += strlen(pData->szText) + 1;
|
||||
pidlTemp = ILGetNext(pidlTemp);
|
||||
|
||||
TRACE(pidl,"-- (%p)->(size=%lu,%s)\n",this,dwCopied,lpszPath);
|
||||
}
|
||||
if(_ILIsMyComputer(pidl))
|
||||
{ pidlTemp = ILGetNext(pidl);
|
||||
TRACE(pidl,"-- skip My Computer\n");
|
||||
}
|
||||
else
|
||||
{ pidlTemp = (LPITEMIDLIST)pidl;
|
||||
}
|
||||
|
||||
//remove the last backslash if necessary
|
||||
if(dwCopied)
|
||||
{ if(*(lpszPath + strlen(lpszPath) - 1) == '\\')
|
||||
{ *(lpszPath + strlen(lpszPath) - 1) = 0;
|
||||
dwCopied--;
|
||||
}
|
||||
}
|
||||
TRACE(pidl,"-- (%p)->(path=%s)\n",this,lpszPath);
|
||||
return dwCopied;
|
||||
//if this is NULL, return the required size of the buffer
|
||||
if(!lpszPath)
|
||||
{ while(pidlTemp->mkid.cb)
|
||||
{ LPPIDLDATA pData = _ILGetDataPointer(pidlTemp);
|
||||
pText = _ILGetTextPointer(pData->type,pData);
|
||||
|
||||
/*add the length of this item plus one for the backslash
|
||||
fixme: is one to much, drive has its own backslash*/
|
||||
dwCopied += strlen(pText) + 1;
|
||||
pidlTemp = ILGetNext(pidlTemp);
|
||||
}
|
||||
|
||||
//add one for the NULL terminator
|
||||
TRACE(pidl,"-- (size=%lu)\n",dwCopied);
|
||||
return dwCopied + 1;
|
||||
}
|
||||
|
||||
*lpszPath = 0;
|
||||
|
||||
while(pidlTemp->mkid.cb && (dwCopied < dwSize))
|
||||
{ LPPIDLDATA pData = _ILGetDataPointer(pidlTemp);
|
||||
|
||||
//if this item is a value, then skip it and finish
|
||||
if(PT_VALUE == pData->type)
|
||||
{ break;
|
||||
}
|
||||
pText = _ILGetTextPointer(pData->type,pData);
|
||||
strcat(lpszPath, pText);
|
||||
PathAddBackslash(lpszPath);
|
||||
dwCopied += strlen(pText) + 1;
|
||||
pidlTemp = ILGetNext(pidlTemp);
|
||||
|
||||
TRACE(pidl,"-- (size=%lu,%s)\n",dwCopied,lpszPath);
|
||||
}
|
||||
|
||||
//remove the last backslash if necessary
|
||||
if(dwCopied)
|
||||
{ if(*(lpszPath + strlen(lpszPath) - 1) == '\\')
|
||||
{ *(lpszPath + strlen(lpszPath) - 1) = 0;
|
||||
dwCopied--;
|
||||
}
|
||||
}
|
||||
TRACE(pidl,"-- (path=%s)\n",lpszPath);
|
||||
return dwCopied;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetValueText()
|
||||
* _ILGetValueText()
|
||||
* Gets the text for the last item in the list
|
||||
*/
|
||||
DWORD PidlMgr_GetValueText(LPPIDLMGR this,
|
||||
DWORD WINAPI _ILGetValueText(
|
||||
LPCITEMIDLIST pidl, LPSTR lpszValue, DWORD dwSize)
|
||||
{ LPITEMIDLIST pidlTemp=pidl;
|
||||
CHAR szText[MAX_PATH];
|
||||
{ LPITEMIDLIST pidlTemp=pidl;
|
||||
CHAR szText[MAX_PATH];
|
||||
|
||||
TRACE(pidl,"(%p)->(pidl=%p %p 0x%08lx)\n",this,pidl,lpszValue,dwSize);
|
||||
TRACE(pidl,"(pidl=%p %p 0x%08lx)\n",pidl,lpszValue,dwSize);
|
||||
|
||||
if(!pidl)
|
||||
{ return 0;
|
||||
if(!pidl)
|
||||
{ return 0;
|
||||
}
|
||||
|
||||
while(pidlTemp->mkid.cb && !PidlMgr_IsValue(this,pidlTemp))
|
||||
{ pidlTemp = ILGetNext(pidlTemp);
|
||||
}
|
||||
|
||||
if(!pidlTemp->mkid.cb)
|
||||
{ return 0;
|
||||
while(pidlTemp->mkid.cb && !_ILIsValue(pidlTemp))
|
||||
{ pidlTemp = ILGetNext(pidlTemp);
|
||||
}
|
||||
|
||||
PidlMgr_GetItemText(this, pidlTemp, szText, sizeof(szText));
|
||||
if(!pidlTemp->mkid.cb)
|
||||
{ return 0;
|
||||
}
|
||||
|
||||
if(!lpszValue)
|
||||
{ return strlen(szText) + 1;
|
||||
}
|
||||
strcpy(lpszValue, szText);
|
||||
TRACE(pidl,"-- (%p)->(pidl=%p %p=%s 0x%08lx)\n",this,pidl,lpszValue,lpszValue,dwSize);
|
||||
return strlen(lpszValue);
|
||||
_ILGetItemText( pidlTemp, szText, sizeof(szText));
|
||||
|
||||
if(!lpszValue)
|
||||
{ return strlen(szText) + 1;
|
||||
}
|
||||
strcpy(lpszValue, szText);
|
||||
TRACE(pidl,"-- (pidl=%p %p=%s 0x%08lx)\n",pidl,lpszValue,lpszValue,dwSize);
|
||||
return strlen(lpszValue);
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetValueType()
|
||||
* _ILGetDataText()
|
||||
* NOTES
|
||||
* used from ShellView
|
||||
*/
|
||||
BOOL32 PidlMgr_GetValueType( LPPIDLMGR this,
|
||||
LPCITEMIDLIST pidlPath,
|
||||
LPCITEMIDLIST pidlValue,
|
||||
LPDWORD pdwType)
|
||||
{ LPSTR lpszFolder,
|
||||
lpszValueName;
|
||||
DWORD dwNameSize;
|
||||
|
||||
FIXME(pidl,"(%p)->(%p %p %p) stub\n",this,pidlPath,pidlValue,pdwType);
|
||||
|
||||
if(!pidlPath)
|
||||
{ return FALSE;
|
||||
}
|
||||
|
||||
if(!pidlValue)
|
||||
{ return FALSE;
|
||||
}
|
||||
|
||||
if(!pdwType)
|
||||
{ return FALSE;
|
||||
}
|
||||
|
||||
//get the Desktop
|
||||
//PidlMgr_GetDesktop(this,pidlPath);
|
||||
|
||||
/* fixme: add the driveletter here*/
|
||||
|
||||
//assemble the Folder string
|
||||
dwNameSize = PidlMgr_GetFolderText(this,pidlPath, NULL, 0);
|
||||
lpszFolder = (LPSTR)HeapAlloc(GetProcessHeap(),0,dwNameSize);
|
||||
if(!lpszFolder)
|
||||
{ return FALSE;
|
||||
}
|
||||
PidlMgr_GetFolderText(this,pidlPath, lpszFolder, dwNameSize);
|
||||
|
||||
//assemble the value name
|
||||
dwNameSize = PidlMgr_GetValueText(this,pidlValue, NULL, 0);
|
||||
lpszValueName = (LPSTR)HeapAlloc(GetProcessHeap(),0,dwNameSize);
|
||||
if(!lpszValueName)
|
||||
{ HeapFree(GetProcessHeap(),0,lpszFolder);
|
||||
return FALSE;
|
||||
}
|
||||
PidlMgr_GetValueText(this,pidlValue, lpszValueName, dwNameSize);
|
||||
|
||||
/* fixme: we've got the path now do something with it
|
||||
-like get the filetype*/
|
||||
|
||||
pdwType=NULL;
|
||||
|
||||
HeapFree(GetProcessHeap(),0,lpszFolder);
|
||||
HeapFree(GetProcessHeap(),0,lpszValueName);
|
||||
return TRUE;
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetDataText()
|
||||
*/
|
||||
DWORD PidlMgr_GetDataText( LPPIDLMGR this,
|
||||
LPCITEMIDLIST pidlPath, LPCITEMIDLIST pidlValue, LPSTR lpszOut, DWORD dwOutSize)
|
||||
DWORD WINAPI _ILGetDataText( LPCITEMIDLIST pidlPath, LPCITEMIDLIST pidlValue, LPSTR lpszOut, DWORD dwOutSize)
|
||||
{ LPSTR lpszFolder,
|
||||
lpszValueName;
|
||||
DWORD dwNameSize;
|
||||
|
||||
FIXME(pidl,"(%p)->(pidl=%p pidl=%p) stub\n",this,pidlPath,pidlValue);
|
||||
FIXME(pidl,"(pidl=%p pidl=%p) stub\n",pidlPath,pidlValue);
|
||||
|
||||
if(!lpszOut || !pidlPath || !pidlValue)
|
||||
{ return FALSE;
|
||||
|
@ -625,43 +499,42 @@ DWORD PidlMgr_GetDataText( LPPIDLMGR this,
|
|||
/* fixme: get the driveletter*/
|
||||
|
||||
//assemble the Folder string
|
||||
dwNameSize = PidlMgr_GetFolderText(this,pidlPath, NULL, 0);
|
||||
dwNameSize = _ILGetFolderText(pidlPath, NULL, 0);
|
||||
lpszFolder = (LPSTR)HeapAlloc(GetProcessHeap(),0,dwNameSize);
|
||||
if(!lpszFolder)
|
||||
{ return FALSE;
|
||||
}
|
||||
PidlMgr_GetFolderText(this,pidlPath, lpszFolder, dwNameSize);
|
||||
_ILGetFolderText(pidlPath, lpszFolder, dwNameSize);
|
||||
|
||||
//assemble the value name
|
||||
dwNameSize = PidlMgr_GetValueText(this,pidlValue, NULL, 0);
|
||||
dwNameSize = _ILGetValueText(pidlValue, NULL, 0);
|
||||
lpszValueName = (LPSTR)HeapAlloc(GetProcessHeap(),0,dwNameSize);
|
||||
if(!lpszValueName)
|
||||
{ HeapFree(GetProcessHeap(),0,lpszFolder);
|
||||
return FALSE;
|
||||
}
|
||||
PidlMgr_GetValueText(this,pidlValue, lpszValueName, dwNameSize);
|
||||
_ILGetValueText(pidlValue, lpszValueName, dwNameSize);
|
||||
|
||||
/* fixme: we've got the path now do something with it*/
|
||||
|
||||
HeapFree(GetProcessHeap(),0,lpszFolder);
|
||||
HeapFree(GetProcessHeap(),0,lpszValueName);
|
||||
|
||||
TRACE(pidl,"-- (%p)->(%p=%s 0x%08lx)\n",this,lpszOut,lpszOut,dwOutSize);
|
||||
TRACE(pidl,"-- (%p=%s 0x%08lx)\n",lpszOut,lpszOut,dwOutSize);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* CPidlMgr::GetPidlPath()
|
||||
* _ILGetPidlPath()
|
||||
* Create a string that includes the Drive name, the folder text and
|
||||
* the value text.
|
||||
*/
|
||||
DWORD PidlMgr_GetPidlPath(LPPIDLMGR this,
|
||||
LPCITEMIDLIST pidl, LPSTR lpszOut, DWORD dwOutSize)
|
||||
DWORD WINAPI _ILGetPidlPath( LPCITEMIDLIST pidl, LPSTR lpszOut, DWORD dwOutSize)
|
||||
{ LPSTR lpszTemp;
|
||||
WORD len;
|
||||
|
||||
TRACE(pidl,"(%p)->(%p,%lu)\n",this,lpszOut,dwOutSize);
|
||||
TRACE(pidl,"(%p,%lu)\n",lpszOut,dwOutSize);
|
||||
|
||||
if(!lpszOut)
|
||||
{ return 0;
|
||||
|
@ -670,7 +543,7 @@ DWORD PidlMgr_GetPidlPath(LPPIDLMGR this,
|
|||
*lpszOut = 0;
|
||||
lpszTemp = lpszOut;
|
||||
|
||||
dwOutSize -= PidlMgr_GetFolderText(this,pidl, lpszTemp, dwOutSize);
|
||||
dwOutSize -= _ILGetFolderText(pidl, lpszTemp, dwOutSize);
|
||||
|
||||
//add a backslash if necessary
|
||||
len = strlen(lpszTemp);
|
||||
|
@ -683,164 +556,165 @@ DWORD PidlMgr_GetPidlPath(LPPIDLMGR this,
|
|||
lpszTemp = lpszOut + strlen(lpszOut);
|
||||
|
||||
//add the value string
|
||||
PidlMgr_GetValueText(this,pidl, lpszTemp, dwOutSize);
|
||||
_ILGetValueText(pidl, lpszTemp, dwOutSize);
|
||||
|
||||
//remove the last backslash if necessary
|
||||
if(*(lpszOut + strlen(lpszOut) - 1) == '\\')
|
||||
{ *(lpszOut + strlen(lpszOut) - 1) = 0;
|
||||
}
|
||||
|
||||
TRACE(pidl,"-- (%p)->(%p=%s,%lu)\n",this,lpszOut,lpszOut,dwOutSize);
|
||||
TRACE(pidl,"-- (%p=%s,%lu)\n",lpszOut,lpszOut,dwOutSize);
|
||||
|
||||
return strlen(lpszOut);
|
||||
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* PidlMgr_Create()
|
||||
* _ILCreate()
|
||||
* Creates a new PIDL
|
||||
* type = PT_DESKTOP | PT_DRIVE | PT_FOLDER | PT_VALUE
|
||||
* pIn = data
|
||||
* uInSize = size of data
|
||||
*/
|
||||
|
||||
LPITEMIDLIST PidlMgr_Create(LPPIDLMGR this,PIDLTYPE type, LPVOID pIn, UINT16 uInSize)
|
||||
{ LPITEMIDLIST pidlOut=NULL;
|
||||
UINT16 uSize;
|
||||
LPITEMIDLIST pidlTemp=NULL;
|
||||
LPPIDLDATA pData;
|
||||
LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE type, LPVOID pIn, UINT16 uInSize)
|
||||
{ LPITEMIDLIST pidlOut=NULL;
|
||||
UINT16 uSize;
|
||||
LPITEMIDLIST pidlTemp=NULL;
|
||||
LPPIDLDATA pData;
|
||||
LPSTR pszDest;
|
||||
|
||||
TRACE(pidl,"(%x %p %x)\n",type,pIn,uInSize);
|
||||
|
||||
TRACE(pidl,"(%p)->(%x %p %x)\n",this,type,pIn,uInSize);
|
||||
|
||||
if ( type == PT_DESKTOP)
|
||||
{ pidlOut = SHAlloc(2);
|
||||
pidlOut->mkid.cb=0x0000;
|
||||
return pidlOut;
|
||||
if ( type == PT_DESKTOP)
|
||||
{ pidlOut = SHAlloc(2);
|
||||
pidlOut->mkid.cb=0x0000;
|
||||
return pidlOut;
|
||||
}
|
||||
|
||||
if (! pIn)
|
||||
if (! pIn)
|
||||
{ return NULL;
|
||||
}
|
||||
|
||||
uSize = 2 + (sizeof(PIDLTYPE)) + uInSize + 2; /* cb + PIDLTYPE + uInSize +2 */
|
||||
pidlOut = SHAlloc(uSize);
|
||||
pidlTemp = pidlOut;
|
||||
if(pidlOut)
|
||||
{ pidlTemp->mkid.cb = uSize - 2;
|
||||
pData =(LPPIDLDATA) &(pidlTemp->mkid.abID[0]);
|
||||
pData->type = type;
|
||||
switch(type)
|
||||
{ case PT_MYCOMP:
|
||||
memcpy(pData->szText, pIn, uInSize);
|
||||
TRACE(pidl,"- (%p)->create My Computer: %s\n",this,debugstr_a(pData->szText));
|
||||
break;
|
||||
case PT_DRIVE:
|
||||
memcpy(pData->szText, pIn, uInSize);
|
||||
TRACE(pidl,"- (%p)->create Drive: %s\n",this,debugstr_a(pData->szText));
|
||||
break;
|
||||
case PT_FOLDER:
|
||||
case PT_VALUE:
|
||||
memcpy(pData->szText, pIn, uInSize);
|
||||
TRACE(pidl,"- (%p)->create Value: %s\n",this,debugstr_a(pData->szText));
|
||||
break;
|
||||
default:
|
||||
FIXME(pidl,"- (%p) wrong argument\n",this);
|
||||
break;
|
||||
}
|
||||
/* the sizes of: cb(2), pidldata-1, szText+1, next cb(2) */
|
||||
switch (type)
|
||||
{ case PT_DRIVE:
|
||||
uSize = 4 + 10;
|
||||
break;
|
||||
default:
|
||||
uSize = 4 + (sizeof(PIDLDATA)) + uInSize;
|
||||
}
|
||||
pidlOut = SHAlloc(uSize);
|
||||
pidlTemp = pidlOut;
|
||||
if(pidlOut)
|
||||
{ pidlTemp->mkid.cb = uSize - 2;
|
||||
pData =_ILGetDataPointer(pidlTemp);
|
||||
pszDest = _ILGetTextPointer(type, pData);
|
||||
pData->type = type;
|
||||
switch(type)
|
||||
{ case PT_MYCOMP:
|
||||
memcpy(pszDest, pIn, uInSize);
|
||||
TRACE(pidl,"- create My Computer: %s\n",debugstr_a(pszDest));
|
||||
break;
|
||||
case PT_DRIVE:
|
||||
memcpy(pszDest, pIn, uInSize);
|
||||
TRACE(pidl,"- create Drive: %s\n",debugstr_a(pszDest));
|
||||
break;
|
||||
case PT_FOLDER:
|
||||
case PT_VALUE:
|
||||
memcpy(pszDest, pIn, uInSize);
|
||||
TRACE(pidl,"- create Value: %s\n",debugstr_a(pszDest));
|
||||
break;
|
||||
default:
|
||||
FIXME(pidl,"-- wrong argument\n");
|
||||
break;
|
||||
}
|
||||
|
||||
pidlTemp = ILGetNext(pidlTemp);
|
||||
pidlTemp->mkid.cb = 0x00;
|
||||
}
|
||||
TRACE(pidl,"-- (%p)->(pidl=%p, size=%u)\n",this,pidlOut,uSize-2);
|
||||
return pidlOut;
|
||||
pidlTemp = ILGetNext(pidlTemp);
|
||||
pidlTemp->mkid.cb = 0x00;
|
||||
}
|
||||
TRACE(pidl,"-- (pidl=%p, size=%u)\n",pidlOut,uSize-2);
|
||||
return pidlOut;
|
||||
}
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetData(PIDLTYPE, LPCITEMIDLIST, LPVOID, UINT16)
|
||||
* _ILGetData(PIDLTYPE, LPCITEMIDLIST, LPVOID, UINT16)
|
||||
*/
|
||||
DWORD PidlMgr_GetData(
|
||||
LPPIDLMGR this,
|
||||
PIDLTYPE type,
|
||||
LPCITEMIDLIST pidl,
|
||||
LPVOID pOut,
|
||||
UINT16 uOutSize)
|
||||
{ LPPIDLDATA pData;
|
||||
DWORD dwReturn=0;
|
||||
|
||||
TRACE(pidl,"(%p)->(%x %p %p %x)\n",this,type,pidl,pOut,uOutSize);
|
||||
DWORD WINAPI _ILGetData(PIDLTYPE type, LPCITEMIDLIST pidl, LPVOID pOut, UINT16 uOutSize)
|
||||
{ LPPIDLDATA pData;
|
||||
DWORD dwReturn=0;
|
||||
LPSTR pszSrc;
|
||||
|
||||
if(!pidl)
|
||||
{ return 0;
|
||||
TRACE(pidl,"(%x %p %p %x)\n",type,pidl,pOut,uOutSize);
|
||||
|
||||
if(!pidl)
|
||||
{ return 0;
|
||||
}
|
||||
|
||||
pData = PidlMgr_GetDataPointer(this,pidl);
|
||||
*(LPSTR)pOut = 0;
|
||||
|
||||
//copy the data
|
||||
switch(type)
|
||||
{ case PT_MYCOMP: if(uOutSize < 1)
|
||||
return 0;
|
||||
if(PT_MYCOMP != pData->type)
|
||||
return 0;
|
||||
*(LPSTR)pOut = 0;
|
||||
strncpy((LPSTR)pOut, "My Computer", uOutSize);
|
||||
dwReturn = strlen((LPSTR)pOut);
|
||||
break;
|
||||
pData = _ILGetDataPointer(pidl);
|
||||
if ( pData->type != type)
|
||||
{ ERR(pidl,"-- wrong type\n");
|
||||
return 0;
|
||||
}
|
||||
pszSrc = _ILGetTextPointer(pData->type, pData);
|
||||
|
||||
case PT_DRIVE: if(uOutSize < 1)
|
||||
return 0;
|
||||
if(PT_DRIVE != pData->type)
|
||||
return 0;
|
||||
*(LPSTR)pOut = 0;
|
||||
strncpy((LPSTR)pOut, pData->szText, uOutSize);
|
||||
dwReturn = strlen((LPSTR)pOut);
|
||||
break;
|
||||
switch(type)
|
||||
{ case PT_MYCOMP:
|
||||
if(uOutSize < 1)
|
||||
return 0;
|
||||
strncpy((LPSTR)pOut, "My Computer", uOutSize);
|
||||
dwReturn = strlen((LPSTR)pOut);
|
||||
break;
|
||||
|
||||
case PT_FOLDER:
|
||||
case PT_VALUE:
|
||||
case PT_TEXT: *(LPSTR)pOut = 0;
|
||||
strncpy((LPSTR)pOut, pData->szText, uOutSize);
|
||||
dwReturn = strlen((LPSTR)pOut);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
TRACE(pidl,"-- (%p)->(%p=%s 0x%08lx)\n",this,pOut,(char*)pOut,dwReturn);
|
||||
return dwReturn;
|
||||
case PT_DRIVE:
|
||||
if(uOutSize < 1)
|
||||
return 0;
|
||||
strncpy((LPSTR)pOut, pszSrc, uOutSize);
|
||||
dwReturn = strlen((LPSTR)pOut);
|
||||
break;
|
||||
|
||||
case PT_FOLDER:
|
||||
case PT_VALUE:
|
||||
strncpy((LPSTR)pOut, pszSrc, uOutSize);
|
||||
dwReturn = strlen((LPSTR)pOut);
|
||||
break;
|
||||
default:
|
||||
ERR(pidl,"-- unknown type\n");
|
||||
break;
|
||||
}
|
||||
TRACE(pidl,"-- (%p=%s 0x%08lx)\n",pOut,(char*)pOut,dwReturn);
|
||||
return dwReturn;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* PidlMgr_GetDataPointer()
|
||||
* _ILGetDataPointer()
|
||||
*/
|
||||
LPPIDLDATA PidlMgr_GetDataPointer(LPPIDLMGR this,LPITEMIDLIST pidl)
|
||||
{ if(!pidl)
|
||||
{ return NULL;
|
||||
LPPIDLDATA WINAPI _ILGetDataPointer(LPITEMIDLIST pidl)
|
||||
{ if(!pidl)
|
||||
{ return NULL;
|
||||
}
|
||||
TRACE(pidl,"(%p)->(%p)\n" ,this, pidl);
|
||||
return (LPPIDLDATA)(pidl->mkid.abID);
|
||||
TRACE(pidl,"(%p)\n", pidl);
|
||||
return (LPPIDLDATA)(&pidl->mkid.abID);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* CPidlMgr_SeparatePathAndValue)
|
||||
* Creates a separate path and value PIDL from a fully qualified PIDL.
|
||||
* _ILGetTextPointer()
|
||||
* gets a pointer to the string stored in the pidl
|
||||
*/
|
||||
BOOL32 PidlMgr_SeparatePathAndValue(LPPIDLMGR this,
|
||||
LPITEMIDLIST pidlFQ, LPITEMIDLIST *ppidlPath, LPITEMIDLIST *ppidlValue)
|
||||
{ LPITEMIDLIST pidlTemp;
|
||||
TRACE(pidl,"(%p)->(pidl=%p pidl=%p pidl=%p)",this,pidlFQ,ppidlPath,ppidlValue);
|
||||
if(!pidlFQ)
|
||||
{ return FALSE;
|
||||
LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata)
|
||||
{ TRACE(pidl,"(type=%x data=%p)\n", type, pidldata);
|
||||
|
||||
if(!pidldata)
|
||||
{ return NULL;
|
||||
}
|
||||
|
||||
*ppidlValue = PidlMgr_GetLastItem(this,pidlFQ);
|
||||
|
||||
if(!PidlMgr_IsValue(this,*ppidlValue))
|
||||
{ return FALSE;
|
||||
switch (type)
|
||||
{ case PT_DRIVE:
|
||||
return (LPSTR)&(pidldata->u.drive.szDriveName);
|
||||
case PT_MYCOMP:
|
||||
case PT_FOLDER:
|
||||
case PT_VALUE:
|
||||
return (LPSTR)&(pidldata->u.file.szText);
|
||||
}
|
||||
|
||||
*ppidlValue = ILClone(*ppidlValue);
|
||||
*ppidlPath = ILClone(pidlFQ);
|
||||
|
||||
pidlTemp = PidlMgr_GetLastItem(this,*ppidlPath);
|
||||
pidlTemp->mkid.cb = 0x00;
|
||||
|
||||
return TRUE;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -1,31 +1,100 @@
|
|||
/* INTERNAL CLASS pidlmgr */
|
||||
|
||||
/*
|
||||
* internal pidl functions
|
||||
* 1998 <juergen.schmied@metronet.de>
|
||||
*
|
||||
* DO NOT use this definitions outside the shell32.dll !
|
||||
*
|
||||
* The contents of a pidl should never used from a application
|
||||
* directly.
|
||||
*
|
||||
* This stuff is used from SHGetFileAttributes, ShellFolder
|
||||
* EnumIDList and ShellView.
|
||||
*/
|
||||
|
||||
#ifndef __WINE_PIDL_H
|
||||
#define __WINE_PIDL_H
|
||||
#include "shlobj.h"
|
||||
|
||||
extern LPITEMIDLIST PidlMgr_CreateDesktop(LPPIDLMGR);
|
||||
extern LPITEMIDLIST PidlMgr_CreateMyComputer(LPPIDLMGR);
|
||||
extern LPITEMIDLIST PidlMgr_CreateDrive(LPPIDLMGR,LPCSTR);
|
||||
extern LPITEMIDLIST PidlMgr_CreateFolder(LPPIDLMGR,LPCSTR);
|
||||
extern LPITEMIDLIST PidlMgr_CreateValue(LPPIDLMGR,LPCSTR);
|
||||
extern BOOL32 PidlMgr_GetDesktop(LPPIDLMGR,LPCITEMIDLIST,LPSTR);
|
||||
extern BOOL32 PidlMgr_GetDrive(LPPIDLMGR,LPCITEMIDLIST,LPSTR,UINT16);
|
||||
extern LPITEMIDLIST PidlMgr_GetLastItem(LPPIDLMGR,LPCITEMIDLIST);
|
||||
extern DWORD PidlMgr_GetItemText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,UINT16);
|
||||
extern BOOL32 PidlMgr_IsDesktop(LPPIDLMGR,LPCITEMIDLIST);
|
||||
extern BOOL32 PidlMgr_IsMyComputer(LPPIDLMGR,LPCITEMIDLIST);
|
||||
extern BOOL32 PidlMgr_IsDrive(LPPIDLMGR,LPCITEMIDLIST);
|
||||
extern BOOL32 PidlMgr_IsFolder(LPPIDLMGR,LPCITEMIDLIST);
|
||||
extern BOOL32 PidlMgr_IsValue(LPPIDLMGR,LPCITEMIDLIST);
|
||||
extern BOOL32 PidlMgr_HasFolders(LPPIDLMGR,LPSTR,LPCITEMIDLIST);
|
||||
extern DWORD PidlMgr_GetFolderText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
|
||||
extern DWORD PidlMgr_GetValueText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
|
||||
extern BOOL32 PidlMgr_GetValueType(LPPIDLMGR,LPCITEMIDLIST,LPCITEMIDLIST,LPDWORD);
|
||||
extern DWORD PidlMgr_GetDataText(LPPIDLMGR,LPCITEMIDLIST,LPCITEMIDLIST,LPSTR,DWORD);
|
||||
extern DWORD PidlMgr_GetPidlPath(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
|
||||
extern LPITEMIDLIST PidlMgr_Create(LPPIDLMGR,PIDLTYPE,LPVOID,UINT16);
|
||||
extern DWORD PidlMgr_GetData(LPPIDLMGR,PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT16);
|
||||
extern LPPIDLDATA PidlMgr_GetDataPointer(LPPIDLMGR,LPCITEMIDLIST);
|
||||
extern BOOL32 PidlMgr_SeparatePathAndValue(LPPIDLMGR,LPITEMIDLIST,LPITEMIDLIST*,LPITEMIDLIST*);
|
||||
/*
|
||||
* the pidl does cache fileattributes to speed up SHGetAttributes when
|
||||
* displaying a big number of files.
|
||||
*
|
||||
* a pidl of NULL means the desktop
|
||||
*
|
||||
* The structure of the pidl seens to be a union. The first byte of the
|
||||
* PIDLDATA desribes the type of pidl.
|
||||
*
|
||||
* first byte - my Computer 0x1F
|
||||
* control/printer 0x2E
|
||||
* drive 0x23
|
||||
* folder 0x31
|
||||
* drive: the second byte is the start of a string
|
||||
* C : \
|
||||
* 43 3A 5C
|
||||
* file: see the PIDLDATA structure
|
||||
*/
|
||||
|
||||
#define PT_DESKTOP 0x0000 /*fixme*/
|
||||
#define PT_MYCOMP 0x001F
|
||||
#define PT_SPECIAL 0x002E
|
||||
#define PT_DRIVE 0x0023
|
||||
#define PT_FOLDER 0x0031
|
||||
#define PT_VALUE 0x0033 /*fixme*/
|
||||
|
||||
#pragma pack(1)
|
||||
typedef WORD PIDLTYPE;
|
||||
typedef struct tagPIDLDATA
|
||||
{ PIDLTYPE type;
|
||||
union
|
||||
{ struct
|
||||
{ CHAR szDriveName[4];
|
||||
/* end of MS compatible*/
|
||||
DWORD dwSFGAO;
|
||||
} drive;
|
||||
struct
|
||||
{ DWORD dwFileSize;
|
||||
WORD uFileDate;
|
||||
WORD uFileTime;
|
||||
WORD uFileAttribs;
|
||||
/* end of MS compatible*/
|
||||
DWORD dwSFGAO;
|
||||
CHAR szAlternateName[14]; /* the 8.3 Name*/
|
||||
CHAR szText[1]; /* last entry, variable size */
|
||||
} file, folder, generic;
|
||||
}u;
|
||||
}
|
||||
/* here starts my implementation*/
|
||||
PIDLDATA, *LPPIDLDATA;
|
||||
#pragma pack(4)
|
||||
|
||||
LPITEMIDLIST WINAPI _ILCreateDesktop();
|
||||
LPITEMIDLIST WINAPI _ILCreateMyComputer();
|
||||
LPITEMIDLIST WINAPI _ILCreateDrive(LPCSTR);
|
||||
LPITEMIDLIST WINAPI _ILCreateFolder(LPCSTR);
|
||||
LPITEMIDLIST WINAPI _ILCreateValue(LPCSTR);
|
||||
LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE,LPVOID,UINT16);
|
||||
|
||||
BOOL32 WINAPI _ILGetDrive(LPCITEMIDLIST,LPSTR,UINT16);
|
||||
DWORD WINAPI _ILGetItemText(LPCITEMIDLIST,LPSTR,UINT16);
|
||||
DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST,LPSTR,DWORD);
|
||||
DWORD WINAPI _ILGetValueText(LPCITEMIDLIST,LPSTR,DWORD);
|
||||
DWORD WINAPI _ILGetDataText(LPCITEMIDLIST,LPCITEMIDLIST,LPSTR,DWORD);
|
||||
DWORD WINAPI _ILGetPidlPath(LPCITEMIDLIST,LPSTR,DWORD);
|
||||
DWORD WINAPI _ILGetData(PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT16);
|
||||
|
||||
BOOL32 WINAPI _ILIsDesktop(LPCITEMIDLIST);
|
||||
BOOL32 WINAPI _ILIsMyComputer(LPCITEMIDLIST);
|
||||
BOOL32 WINAPI _ILIsDrive(LPCITEMIDLIST);
|
||||
BOOL32 WINAPI _ILIsFolder(LPCITEMIDLIST);
|
||||
BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST);
|
||||
|
||||
BOOL32 WINAPI _ILHasFolders(LPSTR,LPCITEMIDLIST);
|
||||
|
||||
LPPIDLDATA WINAPI _ILGetDataPointer(LPCITEMIDLIST);
|
||||
LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
|
||||
/*
|
||||
BOOL32 WINAPI _ILGetDesktop(LPCITEMIDLIST,LPSTR);
|
||||
BOOL32 WINAPI _ILSeparatePathAndValue(LPITEMIDLIST,LPITEMIDLIST*,LPITEMIDLIST*);
|
||||
BOOL32 WINAPI _ILGetValueType(LPCITEMIDLIST,LPCITEMIDLIST,LPDWORD);
|
||||
*/
|
||||
#endif
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "commctrl.h"
|
||||
#include "authors.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -108,16 +109,16 @@ BOOL32 WINAPI Shell_GetImageList(HIMAGELIST * imglist1,HIMAGELIST * imglist2)
|
|||
{ WARN(shell,"(%p,%p):semi-stub.\n",imglist1,imglist2);
|
||||
if (imglist1)
|
||||
{ *imglist1=ShellBigIconList;
|
||||
}
|
||||
if (imglist2)
|
||||
{ *imglist2=ShellSmallIconList;
|
||||
}
|
||||
}
|
||||
if (imglist2)
|
||||
{ *imglist2=ShellSmallIconList;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetFileInfoA [SHELL32.218]
|
||||
* SHGetFileInfoA [SHELL32.218]
|
||||
*
|
||||
* FIXME
|
||||
*
|
||||
|
@ -128,43 +129,51 @@ HIMAGELIST ShellBigIconList = 0;
|
|||
DWORD WINAPI SHGetFileInfo32A(LPCSTR path,DWORD dwFileAttributes,
|
||||
SHFILEINFO32A *psfi, UINT32 sizeofpsfi,
|
||||
UINT32 flags )
|
||||
{ CHAR szTemp[MAX_PATH];
|
||||
DWORD ret=0;
|
||||
{ CHAR szTemp[MAX_PATH];
|
||||
LPPIDLDATA pData;
|
||||
DWORD ret=0;
|
||||
|
||||
TRACE(shell,"(%s,0x%lx,%p,0x%x,0x%x)\n",
|
||||
TRACE(shell,"(%s,0x%lx,%p,0x%x,0x%x)\n",
|
||||
path,dwFileAttributes,psfi,sizeofpsfi,flags);
|
||||
|
||||
/* translate the pidl to a path*/
|
||||
if (flags & SHGFI_PIDL)
|
||||
{ SHGetPathFromIDList32A ((LPCITEMIDLIST)path,szTemp);
|
||||
TRACE(shell,"pidl=%p is %s\n",path,szTemp);
|
||||
}
|
||||
else
|
||||
{ TRACE(shell,"path=%p\n",path);
|
||||
}
|
||||
/* translate the pidl to a path*/
|
||||
if (flags & SHGFI_PIDL)
|
||||
{ SHGetPathFromIDList32A ((LPCITEMIDLIST)path,szTemp);
|
||||
TRACE(shell,"pidl=%p is %s\n",path,szTemp);
|
||||
}
|
||||
else
|
||||
{ TRACE(shell,"path=%p\n",path);
|
||||
}
|
||||
|
||||
if (flags & SHGFI_ATTRIBUTES)
|
||||
{ FIXME(shell,"file attributes, stub\n");
|
||||
psfi->dwAttributes=SFGAO_FILESYSTEM;
|
||||
ret=TRUE;
|
||||
}
|
||||
if (flags & SHGFI_ATTRIBUTES)
|
||||
{ if (flags & SHGFI_PIDL)
|
||||
{ pData = _ILGetDataPointer((LPCITEMIDLIST)path);
|
||||
psfi->dwAttributes = pData->u.generic.dwSFGAO; /* fixme: no direct access*/
|
||||
ret=TRUE;
|
||||
}
|
||||
else
|
||||
{ psfi->dwAttributes=SFGAO_FILESYSTEM;
|
||||
ret=TRUE;
|
||||
}
|
||||
FIXME(shell,"file attributes, stub\n");
|
||||
}
|
||||
|
||||
if (flags & SHGFI_DISPLAYNAME)
|
||||
{ if (flags & SHGFI_PIDL)
|
||||
{ strcpy(psfi->szDisplayName,szTemp);
|
||||
}
|
||||
else
|
||||
{ strcpy(psfi->szDisplayName,path);
|
||||
TRACE(shell,"displayname=%s\n", szTemp);
|
||||
}
|
||||
ret=TRUE;
|
||||
}
|
||||
if (flags & SHGFI_DISPLAYNAME)
|
||||
{ if (flags & SHGFI_PIDL)
|
||||
{ strcpy(psfi->szDisplayName,szTemp);
|
||||
}
|
||||
else
|
||||
{ strcpy(psfi->szDisplayName,path);
|
||||
}
|
||||
TRACE(shell,"displayname=%s\n", psfi->szDisplayName);
|
||||
ret=TRUE;
|
||||
}
|
||||
|
||||
if (flags & SHGFI_TYPENAME)
|
||||
{ FIXME(shell,"get the file type, stub\n");
|
||||
strcpy(psfi->szTypeName,"");
|
||||
ret=TRUE;
|
||||
}
|
||||
if (flags & SHGFI_TYPENAME)
|
||||
{ FIXME(shell,"get the file type, stub\n");
|
||||
strcpy(psfi->szTypeName,"FIXME: Type");
|
||||
ret=TRUE;
|
||||
}
|
||||
|
||||
if (flags & SHGFI_ICONLOCATION)
|
||||
{ FIXME(shell,"location of icon, stub\n");
|
||||
|
@ -422,17 +431,17 @@ HRESULT WINAPI SHGetSpecialFolderLocation(HWND32 hwndOwner, INT32 nFolder, LPITE
|
|||
LPWSTR lpszDisplayName = (LPWSTR)&pszTemp[0];
|
||||
HKEY key;
|
||||
|
||||
enum
|
||||
{ FT_UNKNOWN= 0x00000000,
|
||||
enum
|
||||
{ FT_UNKNOWN= 0x00000000,
|
||||
FT_DIR= 0x00000001,
|
||||
FT_DESKTOP= 0x00000002
|
||||
} tFolder;
|
||||
|
||||
TRACE(shell,"(%04x,%d,%p)\n", hwndOwner,nFolder,ppidl);
|
||||
TRACE(shell,"(%04x,%d,%p)\n", hwndOwner,nFolder,ppidl);
|
||||
|
||||
strcpy(buffer,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\");
|
||||
strcpy(buffer,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\");
|
||||
|
||||
res=RegCreateKeyEx32A(HKEY_CURRENT_USER,buffer,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&key,&dwdisp);
|
||||
res=RegCreateKeyEx32A(HKEY_CURRENT_USER,buffer,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&key,&dwdisp);
|
||||
if (res)
|
||||
{ ERR(shell,"Could not create key %s %08lx \n",buffer,res);
|
||||
return E_OUTOFMEMORY;
|
||||
|
@ -440,151 +449,152 @@ HRESULT WINAPI SHGetSpecialFolderLocation(HWND32 hwndOwner, INT32 nFolder, LPITE
|
|||
|
||||
tFolder=FT_DIR;
|
||||
switch (nFolder)
|
||||
{ case CSIDL_BITBUCKET:
|
||||
strcpy (buffer,"xxx"); /*not in the registry*/
|
||||
TRACE (shell,"looking for Recycler\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_CONTROLS:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Control\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_DESKTOP:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Desktop\n");
|
||||
tFolder=FT_DESKTOP;
|
||||
break;
|
||||
case CSIDL_DESKTOPDIRECTORY:
|
||||
strcpy (buffer,"Desktop");
|
||||
break;
|
||||
case CSIDL_DRIVES:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Drives\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_FONTS:
|
||||
strcpy (buffer,"Fonts");
|
||||
break;
|
||||
case CSIDL_NETHOOD:
|
||||
strcpy (buffer,"NetHood");
|
||||
break;
|
||||
case CSIDL_NETWORK:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Network\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_PERSONAL:
|
||||
strcpy (buffer,"Personal");
|
||||
break;
|
||||
case CSIDL_FAVORITES:
|
||||
strcpy (buffer,"Favorites");
|
||||
break;
|
||||
case CSIDL_PRINTERS:
|
||||
strcpy (buffer,"PrintHood");
|
||||
break;
|
||||
case CSIDL_PROGRAMS:
|
||||
strcpy (buffer,"Programs");
|
||||
break;
|
||||
case CSIDL_RECENT:
|
||||
strcpy (buffer,"Recent");
|
||||
break;
|
||||
case CSIDL_SENDTO:
|
||||
strcpy (buffer,"SendTo");
|
||||
break;
|
||||
case CSIDL_STARTMENU:
|
||||
strcpy (buffer,"Start Menu");
|
||||
break;
|
||||
case CSIDL_STARTUP:
|
||||
strcpy (buffer,"Startup");
|
||||
break;
|
||||
case CSIDL_TEMPLATES:
|
||||
strcpy (buffer,"Templates");
|
||||
break;
|
||||
default:
|
||||
ERR (shell,"unknown CSIDL\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
{ case CSIDL_BITBUCKET:
|
||||
strcpy (buffer,"xxx"); /*not in the registry*/
|
||||
TRACE (shell,"looking for Recycler\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_CONTROLS:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Control\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_DESKTOP:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Desktop\n");
|
||||
tFolder=FT_DESKTOP;
|
||||
break;
|
||||
case CSIDL_DESKTOPDIRECTORY:
|
||||
strcpy (buffer,"Desktop");
|
||||
break;
|
||||
case CSIDL_DRIVES:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Drives\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_FONTS:
|
||||
strcpy (buffer,"Fonts");
|
||||
break;
|
||||
case CSIDL_NETHOOD:
|
||||
strcpy (buffer,"NetHood");
|
||||
break;
|
||||
case CSIDL_NETWORK:
|
||||
strcpy (buffer,"xxx"); /*virtual folder*/
|
||||
TRACE (shell,"looking for Network\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
case CSIDL_PERSONAL:
|
||||
strcpy (buffer,"Personal");
|
||||
break;
|
||||
case CSIDL_FAVORITES:
|
||||
strcpy (buffer,"Favorites");
|
||||
break;
|
||||
case CSIDL_PRINTERS:
|
||||
strcpy (buffer,"PrintHood");
|
||||
break;
|
||||
case CSIDL_PROGRAMS:
|
||||
strcpy (buffer,"Programs");
|
||||
break;
|
||||
case CSIDL_RECENT:
|
||||
strcpy (buffer,"Recent");
|
||||
break;
|
||||
case CSIDL_SENDTO:
|
||||
strcpy (buffer,"SendTo");
|
||||
break;
|
||||
case CSIDL_STARTMENU:
|
||||
strcpy (buffer,"Start Menu");
|
||||
break;
|
||||
case CSIDL_STARTUP:
|
||||
strcpy (buffer,"Startup");
|
||||
break;
|
||||
case CSIDL_TEMPLATES:
|
||||
strcpy (buffer,"Templates");
|
||||
break;
|
||||
default:
|
||||
ERR (shell,"unknown CSIDL\n");
|
||||
tFolder=FT_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
TRACE(shell,"Key=%s\n",buffer);
|
||||
TRACE(shell,"Key=%s\n",buffer);
|
||||
|
||||
type=REG_SZ;
|
||||
type=REG_SZ;
|
||||
|
||||
switch (tFolder)
|
||||
switch (tFolder)
|
||||
{ case FT_DIR:
|
||||
/* Directory: get the value from the registry, if its not there
|
||||
create it and the directory*/
|
||||
if (RegQueryValueEx32A(key,buffer,NULL,&type,tpath,&tpathlen))
|
||||
{ GetWindowsDirectory32A(npath,MAX_PATH);
|
||||
if (RegQueryValueEx32A(key,buffer,NULL,&type,tpath,&tpathlen))
|
||||
{ GetWindowsDirectory32A(npath,MAX_PATH);
|
||||
PathAddBackslash(npath);
|
||||
switch (nFolder)
|
||||
{ case CSIDL_DESKTOPDIRECTORY:
|
||||
strcat (npath,"Desktop");
|
||||
break;
|
||||
switch (nFolder)
|
||||
{ case CSIDL_DESKTOPDIRECTORY:
|
||||
strcat (npath,"Desktop");
|
||||
break;
|
||||
case CSIDL_FONTS:
|
||||
strcat (npath,"Fonts");
|
||||
break;
|
||||
strcat (npath,"Fonts");
|
||||
break;
|
||||
case CSIDL_NETHOOD:
|
||||
strcat (npath,"NetHood");
|
||||
break;
|
||||
strcat (npath,"NetHood");
|
||||
break;
|
||||
case CSIDL_PERSONAL:
|
||||
strcpy (npath,"C:\\Personal");
|
||||
break;
|
||||
strcpy (npath,"C:\\Personal");
|
||||
break;
|
||||
case CSIDL_FAVORITES:
|
||||
strcat (npath,"Favorites");
|
||||
break;
|
||||
strcat (npath,"Favorites");
|
||||
break;
|
||||
case CSIDL_PRINTERS:
|
||||
strcat (npath,"PrintHood");
|
||||
break;
|
||||
strcat (npath,"PrintHood");
|
||||
break;
|
||||
case CSIDL_PROGRAMS:
|
||||
strcat (npath,"Start Menu");
|
||||
CreateDirectory32A(npath,NULL);
|
||||
strcat (npath,"\\Programs");
|
||||
break;
|
||||
strcat (npath,"Start Menu");
|
||||
CreateDirectory32A(npath,NULL);
|
||||
strcat (npath,"\\Programs");
|
||||
break;
|
||||
case CSIDL_RECENT:
|
||||
strcat (npath,"Recent");
|
||||
break;
|
||||
strcat (npath,"Recent");
|
||||
break;
|
||||
case CSIDL_SENDTO:
|
||||
strcat (npath,"SendTo");
|
||||
break;
|
||||
strcat (npath,"SendTo");
|
||||
break;
|
||||
case CSIDL_STARTMENU:
|
||||
strcat (npath,"Start Menu");
|
||||
break;
|
||||
strcat (npath,"Start Menu");
|
||||
break;
|
||||
case CSIDL_STARTUP:
|
||||
strcat (npath,"Start Menu");
|
||||
CreateDirectory32A(npath,NULL);
|
||||
strcat (npath,"\\Startup");
|
||||
break;
|
||||
strcat (npath,"Start Menu");
|
||||
CreateDirectory32A(npath,NULL);
|
||||
strcat (npath,"\\Startup");
|
||||
break;
|
||||
case CSIDL_TEMPLATES:
|
||||
strcat (npath,"Templates");
|
||||
break;
|
||||
default:
|
||||
strcat (npath,"Templates");
|
||||
break;
|
||||
default:
|
||||
RegCloseKey(key);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
if (RegSetValueEx32A(key,buffer,0,REG_SZ,npath,sizeof(npath)+1))
|
||||
{ ERR(shell,"could not create value %s\n",buffer);
|
||||
RegCloseKey(key);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
TRACE(shell,"value %s=%s created\n",buffer,npath);
|
||||
CreateDirectory32A(npath,NULL);
|
||||
}
|
||||
break;
|
||||
case FT_DESKTOP:
|
||||
strcpy (tpath,"Desktop");
|
||||
break;
|
||||
}
|
||||
if (RegSetValueEx32A(key,buffer,0,REG_SZ,npath,sizeof(npath)+1))
|
||||
{ ERR(shell,"could not create value %s\n",buffer);
|
||||
RegCloseKey(key);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
TRACE(shell,"value %s=%s created\n",buffer,npath);
|
||||
CreateDirectory32A(npath,NULL);
|
||||
strcpy(tpath,npath);
|
||||
}
|
||||
break;
|
||||
case FT_DESKTOP:
|
||||
strcpy (tpath,"Desktop");
|
||||
break;
|
||||
default:
|
||||
RegCloseKey(key);
|
||||
return E_OUTOFMEMORY;
|
||||
break;
|
||||
}
|
||||
RegCloseKey(key);
|
||||
return E_OUTOFMEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
RegCloseKey(key);
|
||||
|
||||
TRACE(shell,"Value=%s\n",tpath);
|
||||
LocalToWideChar32(lpszDisplayName, tpath, 256);
|
||||
TRACE(shell,"Value=%s\n",tpath);
|
||||
LocalToWideChar32(lpszDisplayName, tpath, 256);
|
||||
|
||||
if (SHGetDesktopFolder(&shellfolder)==S_OK)
|
||||
{ shellfolder->lpvtbl->fnParseDisplayName(shellfolder,hwndOwner, NULL,lpszDisplayName,&pchEaten,ppidl,NULL);
|
||||
|
@ -935,7 +945,7 @@ BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvRe
|
|||
exit (1);
|
||||
}
|
||||
if ( ! ShellSmallIconList )
|
||||
{ if ( (ShellSmallIconList = pImageList_Create(sysMetrics[SM_CXSMICON],sysMetrics[SM_CYSMICON],0x101,0,0x20)) )
|
||||
{ if ( (ShellSmallIconList = pImageList_Create(sysMetrics[SM_CXSMICON],sysMetrics[SM_CYSMICON],ILC_COLORDDB | ILC_MASK,0,0x20)) )
|
||||
{ for (index=0;index < 40; index++)
|
||||
{ if ( ! ( htmpIcon = ExtractIcon32A(hinstDLL, szShellPath, index))
|
||||
|| ( -1 == (iiconindex = pImageList_AddIcon (ShellSmallIconList, htmpIcon))) )
|
||||
|
@ -946,7 +956,7 @@ BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvRe
|
|||
}
|
||||
}
|
||||
if ( ! ShellBigIconList )
|
||||
{ if ( (ShellBigIconList = pImageList_Create(SYSMETRICS_CXSMICON, SYSMETRICS_CYSMICON,0x101,0,0x20)) )
|
||||
{ if ( (ShellBigIconList = pImageList_Create(SYSMETRICS_CXSMICON, SYSMETRICS_CYSMICON,ILC_COLORDDB | ILC_MASK,0,0x20)) )
|
||||
{ for (index=0;index < 40; index++)
|
||||
{ if ( ! (htmpIcon = ExtractIcon32A( hinstDLL, szShellPath, index))
|
||||
|| (-1 == (iiconindex = pImageList_AddIcon (ShellBigIconList, htmpIcon))) )
|
||||
|
|
|
@ -29,29 +29,30 @@
|
|||
typedef DWORD (* WINAPI GetClassPtr)(REFCLSID,REFIID,LPVOID);
|
||||
|
||||
static GetClassPtr SH_find_moduleproc(LPSTR dllname,HMODULE32 *xhmod,LPSTR name)
|
||||
{ HMODULE32 hmod;
|
||||
FARPROC32 dllunload,nameproc;
|
||||
{ HMODULE32 hmod;
|
||||
FARPROC32 dllunload,nameproc;
|
||||
|
||||
TRACE(shell,"dll=%s, hmodule=%p, name=%s\n",dllname, xhmod, name);
|
||||
if (xhmod)
|
||||
{ *xhmod = 0;
|
||||
}
|
||||
{ *xhmod = 0;
|
||||
}
|
||||
if (!strcasecmp(PathFindFilename(dllname),"shell32.dll"))
|
||||
{ return (GetClassPtr)SHELL32_DllGetClassObject;
|
||||
}
|
||||
}
|
||||
|
||||
hmod = LoadLibraryEx32A(dllname,0,LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
if (!hmod)
|
||||
{ return NULL;
|
||||
}
|
||||
}
|
||||
dllunload = GetProcAddress32(hmod,"DllCanUnloadNow");
|
||||
if (!dllunload)
|
||||
{ if (xhmod)
|
||||
{ *xhmod = hmod;
|
||||
}
|
||||
}
|
||||
{ *xhmod = hmod;
|
||||
}
|
||||
}
|
||||
nameproc = GetProcAddress32(hmod,name);
|
||||
if (!nameproc)
|
||||
{ FreeLibrary32(hmod);
|
||||
{ FreeLibrary32(hmod);
|
||||
return NULL;
|
||||
}
|
||||
/* register unloadable dll with unloadproc ... */
|
||||
|
@ -73,21 +74,14 @@ static DWORD SH_get_instance(REFCLSID clsid,LPSTR dllname,LPVOID unknownouter,RE
|
|||
dllgetclassob = SH_find_moduleproc(dllname,NULL,"DllGetClassObject");
|
||||
if (!dllgetclassob)
|
||||
{ return 0x80070000|GetLastError();
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME */
|
||||
/*
|
||||
hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,inst);
|
||||
if (hres<0)
|
||||
return hres;
|
||||
|
||||
*/
|
||||
hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,&classfac);
|
||||
if (hres<0 || (hres>=0x80000000))
|
||||
{ return hres;
|
||||
}
|
||||
}
|
||||
if (!classfac)
|
||||
{ FIXME(shell,"no classfactory, but hres is 0x%ld!\n",hres);
|
||||
{ FIXME(shell,"no classfactory, but hres is 0x%ld!\n",hres);
|
||||
return E_FAIL;
|
||||
}
|
||||
classfac->lpvtbl->fnCreateInstance(classfac,unknownouter,refiid,inst);
|
||||
|
@ -111,11 +105,11 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
|
|||
|
||||
if (clsid)
|
||||
{ WINE_StringFromCLSID(clsid,xclsid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ if (!aclsid)
|
||||
{ return 0x80040154;
|
||||
}
|
||||
}
|
||||
strcpy(xclsid,aclsid);
|
||||
}
|
||||
TRACE(shell,"(%p,\n\tSID:\t%s,%p,\n\tIID:\t%s,%p)\n",aclsid,xclsid,unknownouter,xiid,inst);
|
||||
|
@ -124,11 +118,11 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
|
|||
|
||||
if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,buffer,0,0x02000000,&inprockey))
|
||||
{ return SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||
}
|
||||
}
|
||||
pathlen=sizeof(path);
|
||||
|
||||
if (RegQueryValue32A(inprockey,NULL,path,&pathlen))
|
||||
{ RegCloseKey(inprockey);
|
||||
{ RegCloseKey(inprockey);
|
||||
return SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||
}
|
||||
|
||||
|
@ -136,7 +130,7 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
|
|||
tmodellen=sizeof(tmodel);
|
||||
type=REG_SZ;
|
||||
if (RegQueryValueEx32A(inprockey,"ThreadingModel",NULL,&type,tmodel,&tmodellen))
|
||||
{ RegCloseKey(inprockey);
|
||||
{ RegCloseKey(inprockey);
|
||||
return SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||
}
|
||||
|
||||
|
@ -144,8 +138,8 @@ LRESULT WINAPI SHCoCreateInstance(LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownout
|
|||
|
||||
hres=SH_get_instance(clsid,path,unknownouter,refiid,inst);
|
||||
if (hres<0)
|
||||
{ hres=SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||
}
|
||||
{ hres=SH_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||
}
|
||||
RegCloseKey(inprockey);
|
||||
return hres;
|
||||
}
|
||||
|
@ -178,11 +172,11 @@ DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
|
|||
if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)||
|
||||
IsEqualCLSID(rclsid, &CLSID_ShellLink))
|
||||
{ if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)) /*debug*/
|
||||
{ TRACE(shell,"requested CLSID_ShellDesktop\n");
|
||||
}
|
||||
{ TRACE(shell,"-- requested CLSID_ShellDesktop\n");
|
||||
}
|
||||
if(IsEqualCLSID(rclsid, &CLSID_ShellLink)) /*debug*/
|
||||
{ TRACE(shell,"requested CLSID_ShellLink\n");
|
||||
}
|
||||
{ TRACE(shell,"-- requested CLSID_ShellLink\n");
|
||||
}
|
||||
lpclf = IClassFactory_Constructor();
|
||||
if(lpclf)
|
||||
{ hres = lpclf->lpvtbl->fnQueryInterface(lpclf,iid, ppv);
|
||||
|
@ -190,10 +184,10 @@ DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
|
|||
}
|
||||
}
|
||||
else
|
||||
{ WARN(shell, "clsid(%s) not in buildin SHELL32\n",xclsid);
|
||||
{ WARN(shell, "-- CLSID not found\n");
|
||||
hres = CLASS_E_CLASSNOTAVAILABLE;
|
||||
}
|
||||
TRACE(shell,"RETURN pointer to interface: %p\n",ppv);
|
||||
TRACE(shell,"-- return pointer to interface: %p\n",*ppv);
|
||||
return hres;
|
||||
}
|
||||
|
||||
|
@ -249,26 +243,26 @@ LPCLASSFACTORY IClassFactory_Constructor()
|
|||
*/
|
||||
static HRESULT WINAPI IClassFactory_QueryInterface(
|
||||
LPCLASSFACTORY this, REFIID riid, LPVOID *ppvObj)
|
||||
{ char xriid[50];
|
||||
WINE_StringFromCLSID((LPCLSID)riid,xriid);
|
||||
TRACE(shell,"(%p)->(\n\tIID:\t%s)\n",this,xriid);
|
||||
{ char xriid[50];
|
||||
WINE_StringFromCLSID((LPCLSID)riid,xriid);
|
||||
TRACE(shell,"(%p)->(\n\tIID:\t%s)\n",this,xriid);
|
||||
|
||||
*ppvObj = NULL;
|
||||
*ppvObj = NULL;
|
||||
|
||||
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
|
||||
{ *ppvObj = this;
|
||||
}
|
||||
else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/
|
||||
{ *ppvObj = (IClassFactory*)this;
|
||||
}
|
||||
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
|
||||
{ *ppvObj = this;
|
||||
}
|
||||
else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/
|
||||
{ *ppvObj = (IClassFactory*)this;
|
||||
}
|
||||
|
||||
if(*ppvObj)
|
||||
{ (*(LPCLASSFACTORY*)ppvObj)->lpvtbl->fnAddRef(this);
|
||||
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
|
||||
return S_OK;
|
||||
}
|
||||
if(*ppvObj)
|
||||
{ (*(LPCLASSFACTORY*)ppvObj)->lpvtbl->fnAddRef(this);
|
||||
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
|
||||
return S_OK;
|
||||
}
|
||||
TRACE(shell,"-- Interface: E_NOINTERFACE\n");
|
||||
return E_NOINTERFACE;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
/******************************************************************************
|
||||
* IClassFactory_AddRef
|
||||
|
@ -294,12 +288,12 @@ static ULONG WINAPI IClassFactory_Release(LPCLASSFACTORY this)
|
|||
*/
|
||||
static HRESULT WINAPI IClassFactory_CreateInstance(
|
||||
LPCLASSFACTORY this, LPUNKNOWN pUnknown, REFIID riid, LPVOID *ppObject)
|
||||
{ IUnknown *pObj = NULL;
|
||||
{ IUnknown *pObj = NULL;
|
||||
HRESULT hres;
|
||||
char xriid[50];
|
||||
|
||||
WINE_StringFromCLSID((LPCLSID)riid,xriid);
|
||||
TRACE(shell,"%p->(%p,\n\tIID:\t%s,%p)\n",this,pUnknown,xriid,ppObject);
|
||||
WINE_StringFromCLSID((LPCLSID)riid,xriid);
|
||||
TRACE(shell,"%p->(%p,\n\tIID:\t%s,%p)\n",this,pUnknown,xriid,ppObject);
|
||||
|
||||
*ppObject = NULL;
|
||||
|
||||
|
@ -308,39 +302,39 @@ static HRESULT WINAPI IClassFactory_CreateInstance(
|
|||
}
|
||||
|
||||
if (IsEqualIID(riid, &IID_IShellFolder))
|
||||
{ pObj = (IUnknown *)IShellFolder_Constructor(NULL,NULL);
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IShellView))
|
||||
{ pObj = (IUnknown *)IShellView_Constructor();
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IShellLink))
|
||||
{ pObj = (IUnknown *)IShellLink_Constructor();
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IExtractIcon))
|
||||
{ pObj = (IUnknown *)IExtractIcon_Constructor(NULL);
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IContextMenu))
|
||||
{ pObj = (IUnknown *)IContextMenu_Constructor(NULL, NULL, 0);
|
||||
}
|
||||
else
|
||||
{ ERR(shell,"unknown IID requested\n\tIID:\t%s\n",xriid);
|
||||
return(E_NOINTERFACE);
|
||||
}
|
||||
{ pObj = (IUnknown *)IShellFolder_Constructor(NULL,NULL);
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IShellView))
|
||||
{ pObj = (IUnknown *)IShellView_Constructor();
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IShellLink))
|
||||
{ pObj = (IUnknown *)IShellLink_Constructor();
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IExtractIcon))
|
||||
{ pObj = (IUnknown *)IExtractIcon_Constructor(NULL);
|
||||
}
|
||||
else if (IsEqualIID(riid, &IID_IContextMenu))
|
||||
{ pObj = (IUnknown *)IContextMenu_Constructor(NULL, NULL, 0);
|
||||
}
|
||||
else
|
||||
{ ERR(shell,"unknown IID requested\n\tIID:\t%s\n",xriid);
|
||||
return(E_NOINTERFACE);
|
||||
}
|
||||
|
||||
if (!pObj)
|
||||
{ return(E_OUTOFMEMORY);
|
||||
}
|
||||
if (!pObj)
|
||||
{ return(E_OUTOFMEMORY);
|
||||
}
|
||||
|
||||
hres = pObj->lpvtbl->fnQueryInterface(pObj,riid, ppObject);
|
||||
pObj->lpvtbl->fnRelease(pObj);
|
||||
TRACE(shell,"-- Object created: (%p)->%p\n",this,*ppObject);
|
||||
pObj->lpvtbl->fnRelease(pObj);
|
||||
TRACE(shell,"-- Object created: (%p)->%p\n",this,*ppObject);
|
||||
|
||||
return hres;
|
||||
return hres;
|
||||
}
|
||||
/******************************************************************************
|
||||
* IClassFactory_LockServer
|
||||
*/
|
||||
static HRESULT WINAPI IClassFactory_LockServer(LPCLASSFACTORY this, BOOL32 fLock)
|
||||
{ TRACE(shell,"%p->(0x%x), not implemented\n",this, fLock);
|
||||
return E_NOTIMPL;
|
||||
{ TRACE(shell,"%p->(0x%x), not implemented\n",this, fLock);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
|
|
@ -416,8 +416,8 @@ BOOL32 WINAPI PathYetAnotherMakeUniqueName(LPDWORD x,LPDWORD y) {
|
|||
*
|
||||
*/
|
||||
DWORD WINAPI
|
||||
SHMapPIDLToSystemImageListIndex(DWORD x,DWORD y,DWORD z)
|
||||
{ FIXME(shell,"(%08lx,%08lx,%08lx):stub.\n",x,y,z);
|
||||
SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,DWORD y,DWORD z)
|
||||
{ FIXME(shell,"(folder=%p,%08lx,%08lx):stub.\n",sh,y,z);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -452,15 +452,22 @@ StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
|
|||
* SHCloneSpecialIDList [SHELL32.89]
|
||||
*
|
||||
* PARAMETERS
|
||||
* hwnd
|
||||
* hwndOwner [in]
|
||||
* nFolder [in] CSIDL_xxxxx ??
|
||||
*
|
||||
* RETURNS
|
||||
* pidl ??
|
||||
* NOTES
|
||||
* exported by ordinal
|
||||
*/
|
||||
DWORD WINAPI SHCloneSpecialIDList(HWND32 hwnd,DWORD x2,DWORD x3) {
|
||||
FIXME(shell,"(hwnd=0x%x,0x%lx,0x%lx):stub.\n",
|
||||
hwnd,x2,x3
|
||||
);
|
||||
return S_OK;
|
||||
LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND32 hwndOwner,DWORD nFolder,DWORD x3)
|
||||
{ LPITEMIDLIST ppidl;
|
||||
WARN(shell,"(hwnd=0x%x,csidl=0x%lx,0x%lx):semi-stub.\n",
|
||||
hwndOwner,nFolder,x3);
|
||||
|
||||
SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
|
||||
|
||||
return ppidl;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -484,7 +491,7 @@ BOOL32 WINAPI IsLFNDrive(LPCSTR path) {
|
|||
* exported by ordinal
|
||||
*/
|
||||
void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
|
||||
FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
|
||||
FIXME(shell,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
|
||||
x1,x2,x3,x4
|
||||
);
|
||||
}
|
||||
|
@ -513,8 +520,8 @@ void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) {
|
|||
*/
|
||||
void __cdecl
|
||||
ShellMessageBoxA(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
|
||||
char buf[100],buf2[100],*buf3;
|
||||
LPVOID args = &arglist;
|
||||
char buf[100],buf2[100]/*,*buf3*/;
|
||||
/* LPVOID args = &arglist;*/
|
||||
|
||||
if (!LoadString32A(hmod,x,buf,100))
|
||||
strcpy(buf,"Desktop");
|
||||
|
@ -584,11 +591,12 @@ LPSTR WINAPI PathGetExtension(LPSTR path,DWORD y,DWORD z)
|
|||
* SHCreateDirectory [SHELL32.165]
|
||||
*
|
||||
* NOTES
|
||||
* exported by ordinal
|
||||
* exported by ordinal
|
||||
* not sure about LPSECURITY_ATTRIBUTES
|
||||
*/
|
||||
DWORD WINAPI SHCreateDirectory(DWORD x,LPCSTR path) {
|
||||
TRACE(shell,"(%08lx,%s):stub.\n",x,path);
|
||||
if (CreateDirectory32A(path,x))
|
||||
DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) {
|
||||
TRACE(shell,"(%p,%s):stub.\n",sec,path);
|
||||
if (CreateDirectory32A(path,sec))
|
||||
return TRUE;
|
||||
/* SHChangeNotify(8,1,path,0); */
|
||||
return FALSE;
|
||||
|
@ -760,7 +768,7 @@ DWORD WINAPI SHAddToRecentDocs32 (UINT32 uFlags,LPCVOID pv)
|
|||
* exported by name
|
||||
*/
|
||||
DWORD WINAPI SHFileOperation32 (
|
||||
LPSHFILEOPSTRUCT32 lpFileOp)
|
||||
LPSHFILEOPSTRUCT32A lpFileOp)
|
||||
{ FIXME (shell,"(%p):stub.\n", lpFileOp);
|
||||
return 1;
|
||||
}
|
||||
|
@ -794,34 +802,100 @@ HRESULT WINAPI SHCreateShellFolderViewEx32(
|
|||
/*************************************************************************
|
||||
* SHFind_InitMenuPopup [SHELL32.149]
|
||||
*
|
||||
* NOTES
|
||||
* Registers the menu behind the "Start" button
|
||||
*
|
||||
* PARAMETERS
|
||||
* hMenu [in] handel of menu previously created
|
||||
* hWndParent [in] parent window
|
||||
* w [in] no pointer
|
||||
* x [in] no pointer
|
||||
*/
|
||||
HRESULT WINAPI SHFind_InitMenuPopup (DWORD u, DWORD v, DWORD w, DWORD x)
|
||||
{ FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x);
|
||||
return 0;
|
||||
HRESULT WINAPI SHFind_InitMenuPopup (HMENU32 hMenu, HWND32 hWndParent, DWORD w, DWORD x)
|
||||
{ FIXME(shell,"hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
|
||||
hMenu,hWndParent,w,x);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* FileMenu_InitMenuPopup [SHELL32.109]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI FileMenu_InitMenuPopup (DWORD hmenu)
|
||||
{ FIXME(shell,"hmenu=0x%lx stub\n",hmenu);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* FileMenu_Create [SHELL32.114]
|
||||
*
|
||||
* w retval from LoadBitmapA
|
||||
*
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI FileMenu_Create (DWORD u, DWORD v, DWORD w, DWORD x, DWORD z)
|
||||
{ FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
|
||||
{ FIXME(shell,"0x%08lx 0x%08lx hbmp=0x%lx 0x%08lx 0x%08lx stub\n",u,v,w,x,z);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* FileMenu_TrackPopupMenuEx [SHELL32.116]
|
||||
*
|
||||
* PARAMETERS
|
||||
* uFlags [in] according to TrackPopupMenuEx
|
||||
* posX [in]
|
||||
* posY [in]
|
||||
* hWndParent [in]
|
||||
* z could be rect (trace) or TPMPARAMS (TrackPopupMenuEx)
|
||||
*/
|
||||
HRESULT WINAPI FileMenu_TrackPopupMenuEx (DWORD t, DWORD uFlags, DWORD posX, DWORD posY, HWND32 hWndParent, DWORD z)
|
||||
{ FIXME(shell,"0x%lx flags=0x%lx posx=0x%lx posy=0x%lx hwndp=0x%x 0x%lx stub\n",
|
||||
t,uFlags,posX,posY, hWndParent,z);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHWinHelp [SHELL32.127]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
|
||||
{ FIXME(shell,"0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHRunConrolPanel [SHELL32.161]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHRunConrolPanel (DWORD x, DWORD z)
|
||||
{ FIXME(shell,"0x%08lx 0x%08lx stub\n",x,z);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* ShellExecuteEx [SHELL32.291]
|
||||
*
|
||||
*/
|
||||
BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFOA u)
|
||||
{ FIXME(shell,"%p stub\n",u);
|
||||
return 0;
|
||||
BOOL32 WINAPI ShellExecuteEx32A (LPSHELLEXECUTEINFO32A sei)
|
||||
{ CHAR szTemp[MAX_PATH];
|
||||
FIXME(shell,"%p stub\n",sei);
|
||||
|
||||
if (sei->fMask & SEE_MASK_IDLIST)
|
||||
{ SHGetPathFromIDList32A (sei->lpIDList,szTemp);
|
||||
TRACE (shell,"-- idlist=%p (%s)\n", sei->lpIDList, szTemp);
|
||||
}
|
||||
|
||||
if (sei->fMask & SEE_MASK_CLASSNAME)
|
||||
{ TRACE (shell,"-- classname= %s\n", sei->lpClass);
|
||||
}
|
||||
|
||||
if (sei->lpVerb)
|
||||
{ TRACE (shell,"-- action=%s\n", sei->lpVerb);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHSetInstanceExplorer [SHELL32.176]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
|
||||
{ FIXME(shell,"0x%08lx stub\n",u);
|
||||
return 0;
|
||||
{ FIXME(shell,"0x%08lx stub\n",u);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHGetInstanceExplorer [SHELL32.256]
|
||||
|
@ -830,8 +904,8 @@ HRESULT WINAPI SHSetInstanceExplorer (DWORD u)
|
|||
* exported by name
|
||||
*/
|
||||
HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
|
||||
{ FIXME(shell,"0x%08lx stub\n",u);
|
||||
return 0;
|
||||
{ FIXME(shell,"0x%08lx stub\n",u);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHFreeUnusedLibraries [SHELL32.123]
|
||||
|
@ -840,6 +914,43 @@ HRESULT WINAPI SHGetInstanceExplorer (DWORD u)
|
|||
* exported by name
|
||||
*/
|
||||
HRESULT WINAPI SHFreeUnusedLibraries (DWORD u)
|
||||
{ FIXME(shell,"0x%08lx stub\n",u);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* DAD_ShowDragImage [SHELL32.137]
|
||||
*
|
||||
* NOTES
|
||||
* exported by name
|
||||
*/
|
||||
HRESULT WINAPI DAD_ShowDragImage (DWORD u)
|
||||
{ FIXME(shell,"0x%08lx stub\n",u);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* FileMenu_Destroy [SHELL32.118]
|
||||
*
|
||||
* NOTES
|
||||
* exported by name
|
||||
*/
|
||||
HRESULT WINAPI FileMenu_Destroy (DWORD u)
|
||||
{ FIXME(shell,"0x%08lx stub\n",u);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHGetDataFromIDListA [SHELL32.247]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHGetDataFromIDListA(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y)
|
||||
{ FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x,y);
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHFileOperationA [SHELL32.243]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHFileOperationA(DWORD x)
|
||||
{ FIXME(shell,"0x%08lx stub\n",x);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "winnls.h"
|
||||
#include "winproc.h"
|
||||
#include "commctrl.h"
|
||||
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
|
||||
static HRESULT WINAPI IShellFolder_QueryInterface(LPSHELLFOLDER,REFIID,LPVOID*);
|
||||
|
@ -55,25 +55,25 @@ static BOOL32 WINAPI IShellFolder_GetFolderPath(LPSHELLFOLDER,LPSTR,DWORD);
|
|||
* LPSTR pointer to first, not yet parsed char
|
||||
*/
|
||||
LPSTR GetNextElement(LPSTR pszNext,LPSTR pszOut,DWORD dwOut)
|
||||
{ LPSTR pszTail = pszNext;
|
||||
DWORD dwCopy;
|
||||
TRACE(shell,"(%s %p 0x%08lx)\n",debugstr_a(pszNext),pszOut,dwOut);
|
||||
{ LPSTR pszTail = pszNext;
|
||||
DWORD dwCopy;
|
||||
TRACE(shell,"(%s %p 0x%08lx)\n",debugstr_a(pszNext),pszOut,dwOut);
|
||||
|
||||
if(!pszNext || !*pszNext)
|
||||
return NULL;
|
||||
if(!pszNext || !*pszNext)
|
||||
return NULL;
|
||||
|
||||
while(*pszTail && (*pszTail != '\\'))
|
||||
{ pszTail++;
|
||||
}
|
||||
dwCopy=((LPBYTE)pszTail-(LPBYTE)pszNext)/sizeof(CHAR)+1;
|
||||
lstrcpyn32A(pszOut, pszNext, (dwOut<dwCopy)? dwOut : dwCopy);
|
||||
while(*pszTail && (*pszTail != '\\'))
|
||||
{ pszTail++;
|
||||
}
|
||||
dwCopy=((LPBYTE)pszTail-(LPBYTE)pszNext)/sizeof(CHAR)+1;
|
||||
lstrcpyn32A(pszOut, pszNext, (dwOut<dwCopy)? dwOut : dwCopy);
|
||||
|
||||
if(*pszTail)
|
||||
{ pszTail++;
|
||||
if(*pszTail)
|
||||
{ pszTail++;
|
||||
}
|
||||
|
||||
TRACE(shell,"--(%s %s 0x%08lx)\n",debugstr_a(pszNext),debugstr_a(pszOut),dwOut);
|
||||
return pszTail;
|
||||
TRACE(shell,"--(%s %s 0x%08lx)\n",debugstr_a(pszNext),debugstr_a(pszOut),dwOut);
|
||||
return pszTail;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -100,46 +100,38 @@ static struct IShellFolder_VTable sfvt =
|
|||
*/
|
||||
|
||||
LPSHELLFOLDER IShellFolder_Constructor(LPSHELLFOLDER pParent,LPITEMIDLIST pidl)
|
||||
{ LPSHELLFOLDER sf;
|
||||
{ LPSHELLFOLDER sf;
|
||||
DWORD dwSize=0;
|
||||
sf=(LPSHELLFOLDER)HeapAlloc(GetProcessHeap(),0,sizeof(IShellFolder));
|
||||
sf->ref=1;
|
||||
sf->lpvtbl=&sfvt;
|
||||
sf->mlpszFolder=NULL;
|
||||
sf=(LPSHELLFOLDER)HeapAlloc(GetProcessHeap(),0,sizeof(IShellFolder));
|
||||
sf->ref=1;
|
||||
sf->lpvtbl=&sfvt;
|
||||
sf->mlpszFolder=NULL;
|
||||
sf->mpSFParent=pParent;
|
||||
|
||||
TRACE(shell,"(%p)->(parent=%p, pidl=%p)\n",sf,pParent, pidl);
|
||||
|
||||
/* create own pidl-manager*/
|
||||
sf->pPidlMgr = PidlMgr_Constructor();
|
||||
if (! sf->pPidlMgr )
|
||||
{ HeapFree(GetProcessHeap(),0,sf);
|
||||
ERR (shell,"-- Could not initialize PidMGR\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* keep a copy of the pidl in the instance*/
|
||||
sf->mpidl = ILClone(pidl);
|
||||
/* keep a copy of the pidl in the instance*/
|
||||
sf->mpidl = ILClone(pidl);
|
||||
sf->mpidlNSRoot = NULL;
|
||||
|
||||
if(sf->mpidl) /* do we have a pidl?*/
|
||||
{ dwSize = 0;
|
||||
if(sf->mpSFParent->mlpszFolder)
|
||||
{ dwSize += strlen(sf->mpSFParent->mlpszFolder) + 1;
|
||||
}
|
||||
dwSize += sf->pPidlMgr->lpvtbl->fnGetFolderText(sf->pPidlMgr,sf->mpidl,NULL,0);
|
||||
sf->mlpszFolder = SHAlloc(dwSize);
|
||||
if(sf->mlpszFolder)
|
||||
{ *(sf->mlpszFolder)=0x00;
|
||||
if(sf->mpSFParent->mlpszFolder)
|
||||
{ strcpy(sf->mlpszFolder, sf->mpSFParent->mlpszFolder);
|
||||
PathAddBackslash (sf->mlpszFolder);
|
||||
}
|
||||
sf->pPidlMgr->lpvtbl->fnGetFolderText(sf->pPidlMgr, sf->mpidl, sf->mlpszFolder+strlen(sf->mlpszFolder), dwSize-strlen(sf->mlpszFolder));
|
||||
}
|
||||
}
|
||||
if(sf->mpidl) /* do we have a pidl?*/
|
||||
{ dwSize = 0;
|
||||
if(sf->mpSFParent->mlpszFolder)
|
||||
{ dwSize += strlen(sf->mpSFParent->mlpszFolder) + 1;
|
||||
}
|
||||
dwSize += _ILGetFolderText(sf->mpidl,NULL,0);
|
||||
sf->mlpszFolder = SHAlloc(dwSize);
|
||||
if(sf->mlpszFolder)
|
||||
{ *(sf->mlpszFolder)=0x00;
|
||||
if(sf->mpSFParent->mlpszFolder)
|
||||
{ strcpy(sf->mlpszFolder, sf->mpSFParent->mlpszFolder);
|
||||
PathAddBackslash (sf->mlpszFolder);
|
||||
}
|
||||
_ILGetFolderText(sf->mpidl, sf->mlpszFolder+strlen(sf->mlpszFolder), dwSize-strlen(sf->mlpszFolder));
|
||||
}
|
||||
}
|
||||
|
||||
TRACE(shell,"-- (%p)->(%p,%p,parent=%s)\n",sf,pParent, pidl, debugstr_a(sf->mlpszFolder));
|
||||
TRACE(shell,"-- (%p)->(%p,%p,parent=%s)\n",sf,pParent, pidl, debugstr_a(sf->mlpszFolder));
|
||||
return sf;
|
||||
}
|
||||
/**************************************************************************
|
||||
|
@ -185,30 +177,27 @@ static ULONG WINAPI IShellFolder_AddRef(LPSHELLFOLDER this)
|
|||
* IShellFolder_Release
|
||||
*/
|
||||
static ULONG WINAPI IShellFolder_Release(LPSHELLFOLDER this)
|
||||
{ TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
|
||||
if (!--(this->ref))
|
||||
{ TRACE(shell,"-- destroying IShellFolder(%p)\n",this);
|
||||
{ TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
|
||||
if (!--(this->ref))
|
||||
{ TRACE(shell,"-- destroying IShellFolder(%p)\n",this);
|
||||
|
||||
if (pdesktopfolder==this)
|
||||
{ pdesktopfolder=NULL;
|
||||
TRACE(shell,"-- destroyed IShellFolder(%p) was Desktopfolder\n",this);
|
||||
}
|
||||
if (this->pPidlMgr)
|
||||
{ PidlMgr_Destructor(this->pPidlMgr);
|
||||
}
|
||||
if(this->mpidlNSRoot)
|
||||
{ SHFree(this->mpidlNSRoot);
|
||||
}
|
||||
if(this->mpidl)
|
||||
{ SHFree(this->mpidl);
|
||||
}
|
||||
if(this->mlpszFolder)
|
||||
{ SHFree(this->mlpszFolder);
|
||||
}
|
||||
if (pdesktopfolder==this)
|
||||
{ pdesktopfolder=NULL;
|
||||
TRACE(shell,"-- destroyed IShellFolder(%p) was Desktopfolder\n",this);
|
||||
}
|
||||
if(this->mpidlNSRoot)
|
||||
{ SHFree(this->mpidlNSRoot);
|
||||
}
|
||||
if(this->mpidl)
|
||||
{ SHFree(this->mpidl);
|
||||
}
|
||||
if(this->mlpszFolder)
|
||||
{ SHFree(this->mlpszFolder);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return this->ref;
|
||||
}
|
||||
|
@ -245,46 +234,46 @@ static HRESULT WINAPI IShellFolder_ParseDisplayName(
|
|||
TRACE(shell,"(%p)->(HWND=0x%08x,%p,%p=%s,%p,pidl=%p,%p)\n",
|
||||
this,hwndOwner,pbcReserved,lpszDisplayName,debugstr_w(lpszDisplayName),pchEaten,ppidl,pdwAttributes);
|
||||
|
||||
if(pszTemp)
|
||||
{ hr = E_FAIL;
|
||||
WideCharToLocal32(pszTemp, lpszDisplayName, dwChars);
|
||||
if(*pszTemp)
|
||||
{ if (strcmp(pszTemp,"Desktop")==0)
|
||||
{ pidlFull = (LPITEMIDLIST)HeapAlloc(GetProcessHeap(),0,2);
|
||||
pidlFull->mkid.cb = 0;
|
||||
}
|
||||
else
|
||||
{ pidlFull = this->pPidlMgr->lpvtbl->fnCreateMyComputer(this->pPidlMgr);
|
||||
if(pszTemp)
|
||||
{ hr = E_FAIL;
|
||||
WideCharToLocal32(pszTemp, lpszDisplayName, dwChars);
|
||||
if(*pszTemp)
|
||||
{ if (strcmp(pszTemp,"Desktop")==0)
|
||||
{ pidlFull = (LPITEMIDLIST)HeapAlloc(GetProcessHeap(),0,2);
|
||||
pidlFull->mkid.cb = 0;
|
||||
}
|
||||
else
|
||||
{ pidlFull = _ILCreateMyComputer();
|
||||
|
||||
/* check if the lpszDisplayName is Folder or File*/
|
||||
bType = ! (GetFileAttributes32A(pszNext)&FILE_ATTRIBUTE_DIRECTORY);
|
||||
pszNext = GetNextElement(pszTemp, szElement, MAX_PATH);
|
||||
/* check if the lpszDisplayName is Folder or File*/
|
||||
bType = ! (GetFileAttributes32A(pszNext) & FILE_ATTRIBUTE_DIRECTORY);
|
||||
pszNext = GetNextElement(pszTemp, szElement, MAX_PATH);
|
||||
|
||||
pidlTemp = this->pPidlMgr->lpvtbl->fnCreateDrive(this->pPidlMgr,szElement);
|
||||
pidlOld = pidlFull;
|
||||
pidlFull = ILCombine(pidlFull,pidlTemp);
|
||||
SHFree(pidlOld);
|
||||
pidlTemp = _ILCreateDrive(szElement);
|
||||
pidlOld = pidlFull;
|
||||
pidlFull = ILCombine(pidlFull,pidlTemp);
|
||||
SHFree(pidlOld);
|
||||
|
||||
if(pidlFull)
|
||||
{ while((pszNext=GetNextElement(pszNext, szElement, MAX_PATH)))
|
||||
{ if(!*pszNext && bType)
|
||||
{ pidlTemp = this->pPidlMgr->lpvtbl->fnCreateValue(this->pPidlMgr,szElement);
|
||||
}
|
||||
else
|
||||
{ pidlTemp = this->pPidlMgr->lpvtbl->fnCreateFolder(this->pPidlMgr,szElement);
|
||||
}
|
||||
pidlOld = pidlFull;
|
||||
pidlFull = ILCombine(pidlFull,pidlTemp);
|
||||
SHFree(pidlOld);
|
||||
}
|
||||
hr = S_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(pidlFull)
|
||||
{ while((pszNext=GetNextElement(pszNext, szElement, MAX_PATH)))
|
||||
{ if(!*pszNext && bType)
|
||||
{ pidlTemp = _ILCreateValue(szElement);
|
||||
}
|
||||
else
|
||||
{ pidlTemp = _ILCreateFolder(szElement);
|
||||
}
|
||||
pidlOld = pidlFull;
|
||||
pidlFull = ILCombine(pidlFull,pidlTemp);
|
||||
SHFree(pidlOld);
|
||||
}
|
||||
hr = S_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
HeapFree(GetProcessHeap(),0,pszTemp);
|
||||
*ppidl = pidlFull;
|
||||
return hr;
|
||||
*ppidl = pidlFull;
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -415,26 +404,26 @@ static HRESULT WINAPI IShellFolder_CompareIDs(
|
|||
pidlTemp2 = ILGetNext(pidlTemp2);
|
||||
|
||||
/* at this point, both pidlTemp1 and pidlTemp2 point to the last item in the list */
|
||||
if(this->pPidlMgr->lpvtbl->fnIsValue(this->pPidlMgr,pidlTemp1) != this->pPidlMgr->lpvtbl->fnIsValue(this->pPidlMgr,pidlTemp2))
|
||||
{ if(this->pPidlMgr->lpvtbl->fnIsValue(this->pPidlMgr,pidlTemp1))
|
||||
if(_ILIsValue(pidlTemp1) != _ILIsValue(pidlTemp2))
|
||||
{ if(_ILIsValue(pidlTemp1))
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
this->pPidlMgr->lpvtbl->fnGetDrive(this->pPidlMgr, pidl1,szString1,sizeof(szString1));
|
||||
this->pPidlMgr->lpvtbl->fnGetDrive(this->pPidlMgr, pidl2,szString1,sizeof(szString2));
|
||||
_ILGetDrive( pidl1,szString1,sizeof(szString1));
|
||||
_ILGetDrive( pidl2,szString1,sizeof(szString2));
|
||||
nReturn = strcasecmp(szString1, szString2);
|
||||
if(nReturn)
|
||||
return nReturn;
|
||||
|
||||
this->pPidlMgr->lpvtbl->fnGetFolderText(this->pPidlMgr, pidl1,szString1,sizeof(szString1));
|
||||
this->pPidlMgr->lpvtbl->fnGetFolderText(this->pPidlMgr, pidl2,szString2,sizeof(szString2));
|
||||
_ILGetFolderText( pidl1,szString1,sizeof(szString1));
|
||||
_ILGetFolderText( pidl2,szString2,sizeof(szString2));
|
||||
nReturn = strcasecmp(szString1, szString2);
|
||||
if(nReturn)
|
||||
return nReturn;
|
||||
|
||||
this->pPidlMgr->lpvtbl->fnGetValueText(this->pPidlMgr,pidl1,szString1,sizeof(szString1));
|
||||
this->pPidlMgr->lpvtbl->fnGetValueText(this->pPidlMgr,pidl2,szString2,sizeof(szString2));
|
||||
_ILGetValueText(pidl1,szString1,sizeof(szString1));
|
||||
_ILGetValueText(pidl2,szString2,sizeof(szString2));
|
||||
return strcasecmp(szString1, szString2);
|
||||
}
|
||||
|
||||
|
@ -489,11 +478,7 @@ static HRESULT WINAPI IShellFolder_CreateViewObject(
|
|||
* passes ONE element in the array and writing to further elements will
|
||||
* cause the shell to fail later.
|
||||
*/
|
||||
static HRESULT WINAPI IShellFolder_GetAttributesOf(
|
||||
LPSHELLFOLDER this,
|
||||
UINT32 cidl,
|
||||
LPCITEMIDLIST *apidl, /*simple pidl's*/
|
||||
DWORD *rgfInOut)
|
||||
static HRESULT WINAPI IShellFolder_GetAttributesOf(LPSHELLFOLDER this,UINT32 cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut)
|
||||
{ LPCITEMIDLIST * pidltemp;
|
||||
DWORD i;
|
||||
|
||||
|
@ -510,19 +495,19 @@ static HRESULT WINAPI IShellFolder_GetAttributesOf(
|
|||
|
||||
do
|
||||
{ if (*pidltemp)
|
||||
{ if (this->pPidlMgr->lpvtbl->fnIsDesktop(this->pPidlMgr, *pidltemp))
|
||||
{ if (_ILIsDesktop( *pidltemp))
|
||||
{ *rgfInOut |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR);
|
||||
}
|
||||
else if (this->pPidlMgr->lpvtbl->fnIsMyComputer(this->pPidlMgr, *pidltemp))
|
||||
else if (_ILIsMyComputer( *pidltemp))
|
||||
{ *rgfInOut |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER);
|
||||
}
|
||||
else if (this->pPidlMgr->lpvtbl->fnIsDrive(this->pPidlMgr, *pidltemp))
|
||||
{ *rgfInOut |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM);
|
||||
else if (_ILIsDrive( *pidltemp))
|
||||
{ *rgfInOut |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM);
|
||||
}
|
||||
else if (this->pPidlMgr->lpvtbl->fnIsFolder(this->pPidlMgr, *pidltemp))
|
||||
{ *rgfInOut |= (SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER);
|
||||
else if (_ILIsFolder( *pidltemp))
|
||||
{ *rgfInOut |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM );
|
||||
}
|
||||
else if (this->pPidlMgr->lpvtbl->fnIsValue(this->pPidlMgr, *pidltemp))
|
||||
else if (_ILIsValue( *pidltemp))
|
||||
{ *rgfInOut |= (SFGAO_FILESYSTEM);
|
||||
}
|
||||
}
|
||||
|
@ -628,110 +613,107 @@ static HRESULT WINAPI IShellFolder_GetUIObjectOf( LPSHELLFOLDER this,HWND32 hwnd
|
|||
#define GET_SHGDN_FOR(dwFlags) ((DWORD)dwFlags & (DWORD)0x0000FF00)
|
||||
#define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF)
|
||||
|
||||
static HRESULT WINAPI IShellFolder_GetDisplayNameOf(
|
||||
LPSHELLFOLDER this,
|
||||
LPCITEMIDLIST pidl, /* simple/complex pidl*/
|
||||
DWORD dwFlags,
|
||||
LPSTRRET lpName)
|
||||
{ CHAR szText[MAX_PATH];
|
||||
CHAR szTemp[MAX_PATH];
|
||||
static HRESULT WINAPI IShellFolder_GetDisplayNameOf( LPSHELLFOLDER this, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET lpName)
|
||||
{ CHAR szText[MAX_PATH];
|
||||
CHAR szTemp[MAX_PATH];
|
||||
CHAR szSpecial[MAX_PATH];
|
||||
CHAR szDrive[MAX_PATH];
|
||||
DWORD dwVolumeSerialNumber,dwMaximumComponetLength,dwFileSystemFlags;
|
||||
LPITEMIDLIST pidlTemp=NULL;
|
||||
DWORD dwVolumeSerialNumber,dwMaximumComponetLength,dwFileSystemFlags;
|
||||
LPITEMIDLIST pidlTemp=NULL;
|
||||
BOOL32 bSimplePidl=FALSE;
|
||||
|
||||
TRACE(shell,"(%p)->(pidl=%p,0x%08lx,%p)\n",this,pidl,dwFlags,lpName);
|
||||
TRACE(shell,"(%p)->(pidl=%p,0x%08lx,%p)\n",this,pidl,dwFlags,lpName);
|
||||
|
||||
if (!pidl)
|
||||
{ return E_OUTOFMEMORY;
|
||||
}
|
||||
if (!pidl)
|
||||
{ return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
szSpecial[0]=0x00;
|
||||
szDrive[0]=0x00;
|
||||
szSpecial[0]=0x00;
|
||||
szDrive[0]=0x00;
|
||||
|
||||
/* test if simple(relative) or complex(absolute) pidl */
|
||||
pidlTemp = ILGetNext(pidl);
|
||||
/* test if simple(relative) or complex(absolute) pidl */
|
||||
pidlTemp = ILGetNext(pidl);
|
||||
if (pidlTemp->mkid.cb==0x00)
|
||||
{ bSimplePidl = TRUE;
|
||||
}
|
||||
if (this->pPidlMgr->lpvtbl->fnIsDesktop(this->pPidlMgr, pidl))
|
||||
if (_ILIsDesktop( pidl))
|
||||
{ strcpy (szText,"Desktop");
|
||||
}
|
||||
else
|
||||
{ if (this->pPidlMgr->lpvtbl->fnIsMyComputer(this->pPidlMgr, pidl))
|
||||
{ this->pPidlMgr->lpvtbl->fnGetItemText(this->pPidlMgr, pidl, szSpecial, MAX_PATH);
|
||||
}
|
||||
if (this->pPidlMgr->lpvtbl->fnIsDrive(this->pPidlMgr, pidl))
|
||||
{ pidlTemp = this->pPidlMgr->lpvtbl->fnGetLastItem(this->pPidlMgr,pidl);
|
||||
if (pidlTemp)
|
||||
{ this->pPidlMgr->lpvtbl->fnGetItemText(this->pPidlMgr, pidlTemp, szTemp, MAX_PATH);
|
||||
}
|
||||
if ( dwFlags==SHGDN_NORMAL || dwFlags==SHGDN_INFOLDER)
|
||||
{ GetVolumeInformation32A(szTemp,szDrive,MAX_PATH,&dwVolumeSerialNumber,&dwMaximumComponetLength,&dwFileSystemFlags,NULL,0);
|
||||
if (szTemp[2]=='\\')
|
||||
{ szTemp[2]=0x00;
|
||||
}
|
||||
strcat (szDrive," (");
|
||||
strcat (szDrive,szTemp);
|
||||
strcat (szDrive,")");
|
||||
}
|
||||
else
|
||||
{ PathAddBackslash (szTemp);
|
||||
strcpy(szDrive,szTemp);
|
||||
}
|
||||
}
|
||||
{ if (_ILIsMyComputer( pidl))
|
||||
{ _ILGetItemText( pidl, szSpecial, MAX_PATH);
|
||||
}
|
||||
if (_ILIsDrive( pidl))
|
||||
{ pidlTemp = ILFindLastID(pidl);
|
||||
if (pidlTemp)
|
||||
{ _ILGetItemText( pidlTemp, szTemp, MAX_PATH);
|
||||
}
|
||||
if ( dwFlags==SHGDN_NORMAL || dwFlags==SHGDN_INFOLDER)
|
||||
{ GetVolumeInformation32A(szTemp,szDrive,MAX_PATH,&dwVolumeSerialNumber,&dwMaximumComponetLength,&dwFileSystemFlags,NULL,0);
|
||||
if (szTemp[2]=='\\')
|
||||
{ szTemp[2]=0x00;
|
||||
}
|
||||
strcat (szDrive," (");
|
||||
strcat (szDrive,szTemp);
|
||||
strcat (szDrive,")");
|
||||
}
|
||||
else
|
||||
{ PathAddBackslash (szTemp);
|
||||
strcpy(szDrive,szTemp);
|
||||
}
|
||||
}
|
||||
|
||||
switch(dwFlags)
|
||||
{ case SHGDN_NORMAL:
|
||||
this->pPidlMgr->lpvtbl->fnGetPidlPath(this->pPidlMgr, pidl, szText, MAX_PATH);
|
||||
break;
|
||||
case SHGDN_INFOLDER:
|
||||
pidlTemp = this->pPidlMgr->lpvtbl->fnGetLastItem(this->pPidlMgr,pidl);
|
||||
if (pidlTemp)
|
||||
{ this->pPidlMgr->lpvtbl->fnGetItemText(this->pPidlMgr, pidlTemp, szText, MAX_PATH);
|
||||
}
|
||||
break;
|
||||
case SHGDN_FORPARSING:
|
||||
if (bSimplePidl)
|
||||
{ /* if the IShellFolder has parents, get the path from the
|
||||
parent and add the ItemName*/
|
||||
szText[0]=0x00;
|
||||
if (this->mlpszFolder && strlen (this->mlpszFolder))
|
||||
{ if (strcmp(this->mlpszFolder,"My Computer"))
|
||||
{ strcpy (szText,this->mlpszFolder);
|
||||
PathAddBackslash (szText);
|
||||
}
|
||||
}
|
||||
pidlTemp = this->pPidlMgr->lpvtbl->fnGetLastItem(this->pPidlMgr,pidl);
|
||||
switch(dwFlags)
|
||||
{ case SHGDN_NORMAL:
|
||||
_ILGetPidlPath( pidl, szText, MAX_PATH);
|
||||
break;
|
||||
case SHGDN_INFOLDER:
|
||||
pidlTemp = ILFindLastID(pidl);
|
||||
if (pidlTemp)
|
||||
{ _ILGetItemText( pidlTemp, szText, MAX_PATH);
|
||||
}
|
||||
break;
|
||||
case SHGDN_FORPARSING:
|
||||
if (bSimplePidl)
|
||||
{ /* if the IShellFolder has parents, get the path from the
|
||||
parent and add the ItemName*/
|
||||
szText[0]=0x00;
|
||||
if (this->mlpszFolder && strlen (this->mlpszFolder))
|
||||
{ if (strcmp(this->mlpszFolder,"My Computer"))
|
||||
{ strcpy (szText,this->mlpszFolder);
|
||||
PathAddBackslash (szText);
|
||||
}
|
||||
}
|
||||
pidlTemp = ILFindLastID(pidl);
|
||||
if (pidlTemp)
|
||||
{ this->pPidlMgr->lpvtbl->fnGetItemText(this->pPidlMgr, pidlTemp, szTemp, MAX_PATH );
|
||||
}
|
||||
strcat(szText,szTemp);
|
||||
}
|
||||
else
|
||||
{ /* if the pidl is absolute, get everything from the pidl*/
|
||||
this->pPidlMgr->lpvtbl->fnGetPidlPath(this->pPidlMgr, pidl, szText, MAX_PATH);
|
||||
}
|
||||
break;
|
||||
default: return E_INVALIDARG;
|
||||
}
|
||||
if ((szText[0]==0x00 && szDrive[0]!=0x00)|| (bSimplePidl && szDrive[0]!=0x00))
|
||||
{ strcpy(szText,szDrive);
|
||||
}
|
||||
if (szText[0]==0x00 && szSpecial[0]!=0x00)
|
||||
{ strcpy(szText,szSpecial);
|
||||
}
|
||||
}
|
||||
{ _ILGetItemText( pidlTemp, szTemp, MAX_PATH );
|
||||
}
|
||||
strcat(szText,szTemp);
|
||||
}
|
||||
else
|
||||
{ /* if the pidl is absolute, get everything from the pidl*/
|
||||
_ILGetPidlPath( pidl, szText, MAX_PATH);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
if ((szText[0]==0x00 && szDrive[0]!=0x00)|| (bSimplePidl && szDrive[0]!=0x00))
|
||||
{ strcpy(szText,szDrive);
|
||||
}
|
||||
if (szText[0]==0x00 && szSpecial[0]!=0x00)
|
||||
{ strcpy(szText,szSpecial);
|
||||
}
|
||||
}
|
||||
|
||||
TRACE(shell,"-- (%p)->(%s,%s,%s)\n",this,szSpecial,szDrive,szText);
|
||||
TRACE(shell,"-- (%p)->(%s,%s,%s)\n",this,szSpecial,szDrive,szText);
|
||||
|
||||
if(!(lpName))
|
||||
{ return E_OUTOFMEMORY;
|
||||
}
|
||||
lpName->uType = STRRET_CSTR;
|
||||
strcpy(lpName->u.cStr,szText);
|
||||
return S_OK;
|
||||
if(!(lpName))
|
||||
{ return E_OUTOFMEMORY;
|
||||
}
|
||||
lpName->uType = STRRET_CSTR;
|
||||
strcpy(lpName->u.cStr,szText);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -762,21 +744,20 @@ static HRESULT WINAPI IShellFolder_SetNameOf(
|
|||
* FIXME: drive not included
|
||||
*/
|
||||
static BOOL32 WINAPI IShellFolder_GetFolderPath(LPSHELLFOLDER this, LPSTR lpszOut, DWORD dwOutSize)
|
||||
{ CHAR szTemp[MAX_PATH];
|
||||
DWORD dwSize;
|
||||
|
||||
TRACE(shell,"(%p)->(%p %lu)\n",this, lpszOut, dwOutSize);
|
||||
if (!lpszOut)
|
||||
{ return FALSE;
|
||||
}
|
||||
|
||||
*lpszOut=0;
|
||||
|
||||
dwSize = strlen (this->mlpszFolder) +1;
|
||||
if ( dwSize > dwOutSize)
|
||||
return FALSE;
|
||||
strcpy(lpszOut, this->mlpszFolder);
|
||||
{ DWORD dwSize;
|
||||
|
||||
TRACE(shell,"-- (%p)->(return=%s)\n",this, lpszOut);
|
||||
return TRUE;
|
||||
TRACE(shell,"(%p)->(%p %lu)\n",this, lpszOut, dwOutSize);
|
||||
if (!lpszOut)
|
||||
{ return FALSE;
|
||||
}
|
||||
|
||||
*lpszOut=0;
|
||||
|
||||
dwSize = strlen (this->mlpszFolder) +1;
|
||||
if ( dwSize > dwOutSize)
|
||||
return FALSE;
|
||||
strcpy(lpszOut, this->mlpszFolder);
|
||||
|
||||
TRACE(shell,"-- (%p)->(return=%s)\n",this, lpszOut);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,8 @@ LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER pFolder, LPCITEMIDLIST pidl)
|
|||
sv->lpvtbl=&svvt;
|
||||
|
||||
sv->mpidl = ILClone(pidl);
|
||||
|
||||
sv->hMenu=0;
|
||||
|
||||
sv->pSFParent = pFolder;
|
||||
if(sv->pSFParent)
|
||||
sv->pSFParent->lpvtbl->fnAddRef(sv->pSFParent);
|
||||
|
@ -118,8 +119,8 @@ BOOL32 ShellView_CreateList (LPSHELLVIEW this)
|
|||
|
||||
TRACE(shell,"%p\n",this);
|
||||
|
||||
dwStyle = WS_TABSTOP | WS_VISIBLE |WS_CHILD | WS_BORDER | LVS_REPORT |
|
||||
LVS_SHAREIMAGELISTS | LVS_EDITLABELS ;
|
||||
dwStyle = WS_TABSTOP | WS_VISIBLE | WS_CHILD | WS_BORDER |
|
||||
LVS_ICON | LVS_SHAREIMAGELISTS | LVS_EDITLABELS ;
|
||||
|
||||
this->hWndList=CreateWindowEx32A( WS_EX_CLIENTEDGE,WC_LISTVIEW32A,NULL,dwStyle,
|
||||
0,0,0,0,
|
||||
|
@ -143,7 +144,7 @@ int nColumn3=100;
|
|||
int nColumn4=100;
|
||||
|
||||
BOOL32 ShellView_InitList(LPSHELLVIEW this)
|
||||
{ LV_COLUMN lvColumn;
|
||||
{ LVCOLUMN32A lvColumn;
|
||||
CHAR szString[50];
|
||||
|
||||
TRACE(shell,"%p\n",this);
|
||||
|
@ -152,29 +153,32 @@ BOOL32 ShellView_InitList(LPSHELLVIEW this)
|
|||
ListView_DeleteAllItems(this->hWndList); /*empty the list*/
|
||||
|
||||
//initialize the columns
|
||||
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
||||
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
|
||||
|
||||
lvColumn.fmt = LVCFMT_LEFT;
|
||||
lvColumn.pszText = szString;
|
||||
|
||||
lvColumn.cx = nColumn1;
|
||||
strcpy(szString,"File");
|
||||
/*LoadString32A(shell32_hInstance, IDS_COLUMN1, szString, sizeof(szString));*/
|
||||
ListView_InsertColumn(this->hWndList, 0, &lvColumn);
|
||||
ListView_InsertColumn32A(this->hWndList, 0, &lvColumn);
|
||||
|
||||
lvColumn.cx = nColumn2;
|
||||
strcpy(szString,"IDS_COLUMN2");
|
||||
ListView_InsertColumn(this->hWndList, 1, &lvColumn);
|
||||
strcpy(szString,"COLUMN2");
|
||||
ListView_InsertColumn32A(this->hWndList, 1, &lvColumn);
|
||||
|
||||
lvColumn.cx = nColumn3;
|
||||
strcpy(szString,"IDS_COLUMN3");
|
||||
ListView_InsertColumn(this->hWndList, 2, &lvColumn);
|
||||
strcpy(szString,"COLUMN3");
|
||||
ListView_InsertColumn32A(this->hWndList, 2, &lvColumn);
|
||||
|
||||
lvColumn.cx = nColumn4;
|
||||
strcpy(szString,"IDS_COLUMN4");
|
||||
ListView_InsertColumn(this->hWndList, 3, &lvColumn);
|
||||
|
||||
ListView_SetImageList(this->hWndList, ShellBigIconList, LVSIL_SMALL);
|
||||
strcpy(szString,"COLUMN4");
|
||||
ListView_InsertColumn32A(this->hWndList, 3, &lvColumn);
|
||||
|
||||
ListView_SetImageList(this->hWndList, ShellSmallIconList, LVSIL_SMALL);
|
||||
ListView_SetImageList(this->hWndList, ShellBigIconList, LVSIL_NORMAL);
|
||||
ListView_SetBkColor(this->hWndList, 0x00800000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
/**************************************************************************
|
||||
|
@ -204,11 +208,11 @@ void ShellView_FillList(LPSHELLVIEW this)
|
|||
{ LPENUMIDLIST pEnumIDList;
|
||||
LPITEMIDLIST pidl;
|
||||
DWORD dwFetched;
|
||||
LV_ITEM lvItem;
|
||||
LVITEM32A lvItem;
|
||||
|
||||
TRACE(shell,"%p\n",this);
|
||||
|
||||
if(S_OK == this->pSFParent->lpvtbl->fnEnumObjects(this->pSFParent,this->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList))
|
||||
if(SUCCEEDED(this->pSFParent->lpvtbl->fnEnumObjects(this->pSFParent,this->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList)))
|
||||
{ SendMessage32A(this->hWndList, WM_SETREDRAW, FALSE, 0); /*turn the listview's redrawing off*/
|
||||
|
||||
while((S_OK == pEnumIDList->lpvtbl->fnNext(pEnumIDList,1, &pidl, &dwFetched)) && dwFetched)
|
||||
|
@ -219,7 +223,7 @@ void ShellView_FillList(LPSHELLVIEW this)
|
|||
lvItem.lParam = (LPARAM)ILClone(pidl); /*set the item's data*/
|
||||
lvItem.pszText = LPSTR_TEXTCALLBACK32A; /*get text on a callback basis*/
|
||||
lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/
|
||||
ListView_InsertItem(this->hWndList, &lvItem); /*add the item*/
|
||||
ListView_InsertItem32A(this->hWndList, &lvItem); /*add the item*/
|
||||
}
|
||||
|
||||
/*sort the items*/
|
||||
|
@ -267,9 +271,11 @@ HMENU32 ShellView_BuildFileMenu(LPSHELLVIEW this)
|
|||
{ CHAR szText[MAX_PATH];
|
||||
MENUITEMINFO32A mii;
|
||||
int nTools,i;
|
||||
HMENU32 hSubMenu = CreatePopupMenu32();
|
||||
HMENU32 hSubMenu;
|
||||
|
||||
TRACE(shell,"(%p) stub\n",this);
|
||||
|
||||
hSubMenu = CreatePopupMenu32();
|
||||
if(hSubMenu)
|
||||
{ /*get the number of items in our global array*/
|
||||
for(nTools = 0; g_Tools[nTools].idCommand != -1; nTools++){}
|
||||
|
@ -478,7 +484,7 @@ LRESULT ShellView_OnKillFocus(LPSHELLVIEW this)
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* CShellView::AddRemoveDockingWindow()
|
||||
* ShellView_AddRemoveDockingWindow()
|
||||
*/
|
||||
BOOL32 ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL32 bAdd)
|
||||
{ TRACE(shell,"(%p)->(badd=0x%08x) stub\n",this,bAdd);
|
||||
|
@ -536,28 +542,6 @@ BOOL32 ShellView_AddRemoveDockingWindow(LPSHELLVIEW this, BOOL32 bAdd)
|
|||
return bReturn;*/
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ShellView_OnCommand()
|
||||
*/
|
||||
LRESULT ShellView_OnCommand(LPSHELLVIEW this,DWORD dwCmdID, DWORD dwCmd, HWND32 hwndCmd)
|
||||
{ TRACE(shell,"(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",this, dwCmdID, dwCmd, hwndCmd);
|
||||
switch(dwCmdID)
|
||||
{ case IDM_VIEW_FILES:
|
||||
g_bViewKeys = ! g_bViewKeys;
|
||||
IShellView_Refresh(this);
|
||||
break;
|
||||
|
||||
case IDM_VIEW_IDW:
|
||||
g_bShowIDW = ! g_bShowIDW;
|
||||
ShellView_AddRemoveDockingWindow(this, g_bShowIDW);
|
||||
break;
|
||||
|
||||
case IDM_MYFILEITEM:
|
||||
MessageBeep32(MB_OK);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**************************************************************************
|
||||
* ShellView_CanDoIDockingWindow()
|
||||
*/
|
||||
|
@ -590,12 +574,12 @@ LRESULT ShellView_UpdateMenu(LPSHELLVIEW this, HMENU32 hMenu)
|
|||
CheckMenuItem32(hMenu, IDM_VIEW_FILES, MF_BYCOMMAND | (g_bViewKeys ? MF_CHECKED: MF_UNCHECKED));
|
||||
|
||||
if(ShellView_CanDoIDockingWindow(this))
|
||||
{ EnableMenuItem32(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | MF_ENABLED);
|
||||
CheckMenuItem32(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | (g_bShowIDW ? MF_CHECKED: MF_UNCHECKED));
|
||||
{ EnableMenuItem32(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | MF_ENABLED);
|
||||
CheckMenuItem32(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | (g_bShowIDW ? MF_CHECKED: MF_UNCHECKED));
|
||||
}
|
||||
else
|
||||
{ EnableMenuItem32(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
|
||||
CheckMenuItem32(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
CheckMenuItem32(hMenu, IDM_VIEW_IDW, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -604,7 +588,7 @@ LRESULT ShellView_UpdateMenu(LPSHELLVIEW this, HMENU32 hMenu)
|
|||
* ShellView_UpdateShellSettings()
|
||||
|
||||
**************************************************************************/
|
||||
typedef void (WINAPI *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
|
||||
typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
|
||||
|
||||
|
||||
void ShellView_UpdateShellSettings(LPSHELLVIEW this)
|
||||
|
@ -664,202 +648,239 @@ LRESULT ShellView_OnSettingChange(LPSHELLVIEW this, LPCSTR lpszSection)
|
|||
* ShellView_DoContextMenu()
|
||||
*/
|
||||
void ShellView_DoContextMenu(LPSHELLVIEW this, WORD x, WORD y, BOOL32 fDefault)
|
||||
{ UINT32 uSelected = ListView_GetSelectedCount(this->hWndList);
|
||||
{ UINT32 uCommand, i, uSelected = ListView_GetSelectedCount(this->hWndList);
|
||||
HMENU32 hMenu;
|
||||
BOOL32 fExplore = FALSE;
|
||||
HWND32 hwndTree = 0;
|
||||
INT32 nMenuIndex;
|
||||
LPITEMIDLIST *aSelectedItems;
|
||||
UINT32 i;
|
||||
LPCONTEXTMENU pContextMenu = NULL;
|
||||
LVITEM lvItem;
|
||||
UINT32 uCommand;
|
||||
LVITEM32A lvItem;
|
||||
MENUITEMINFO32A mii;
|
||||
int nMenuIndex;
|
||||
CMINVOKECOMMANDINFO cmi;
|
||||
|
||||
LPCONTEXTMENU pContextMenu = NULL;
|
||||
CMINVOKECOMMANDINFO32 cmi;
|
||||
|
||||
TRACE(shell,"(%p)->(0x%08x 0x%08x 0x%08x) stub\n",this, x, y, fDefault);
|
||||
aSelectedItems = (LPITEMIDLIST*)SHAlloc(uSelected * sizeof(LPITEMIDLIST));
|
||||
|
||||
if(aSelectedItems)
|
||||
{ ZeroMemory(&lvItem, sizeof(lvItem));
|
||||
{ TRACE(shell,"-- aSelectedItems\n");
|
||||
ZeroMemory(&lvItem, sizeof(lvItem));
|
||||
lvItem.mask = LVIF_STATE | LVIF_PARAM;
|
||||
lvItem.stateMask = LVIS_SELECTED;
|
||||
lvItem.iItem = 0;
|
||||
|
||||
i = 0;
|
||||
|
||||
while(ListView_GetItem(this->hWndList, &lvItem) && (i < uSelected))
|
||||
{ if(lvItem.state & LVIS_SELECTED)
|
||||
{ aSelectedItems[i] = (LPITEMIDLIST)lvItem.lParam;
|
||||
i++;
|
||||
}
|
||||
lvItem.iItem++;
|
||||
}
|
||||
while(ListView_GetItem32A(this->hWndList, &lvItem) && (i < uSelected))
|
||||
{ if(lvItem.state & LVIS_SELECTED)
|
||||
{ aSelectedItems[i] = (LPITEMIDLIST)lvItem.lParam;
|
||||
i++;
|
||||
}
|
||||
lvItem.iItem++;
|
||||
}
|
||||
|
||||
this->pSFParent->lpvtbl->fnGetUIObjectOf(this->pSFParent, this->hWndParent, uSelected,
|
||||
(LPCITEMIDLIST*)aSelectedItems, &IID_IContextMenu, NULL,(LPVOID*)&pContextMenu);
|
||||
|
||||
if(pContextMenu)
|
||||
{ HMENU32 hMenu = CreatePopupMenu32();
|
||||
{ TRACE(shell,"-- pContextMenu\n");
|
||||
hMenu = CreatePopupMenu32();
|
||||
|
||||
/* See if we are in Explore or Open mode. If the browser's tree is present,
|
||||
then we are in Explore mode.*/
|
||||
|
||||
BOOL32 fExplore = FALSE;
|
||||
HWND32 hwndTree = 0;
|
||||
if(S_OK==(this->pShellBrowser->lpvtbl->fnGetControlWindow(this->pShellBrowser,FCW_TREE, &hwndTree)) && hwndTree)
|
||||
{ fExplore = TRUE;
|
||||
}
|
||||
fExplore = FALSE;
|
||||
hwndTree = 0;
|
||||
if(SUCCEEDED(this->pShellBrowser->lpvtbl->fnGetControlWindow(this->pShellBrowser,FCW_TREE, &hwndTree)) && hwndTree)
|
||||
{ TRACE(shell,"-- fExplore\n");
|
||||
fExplore = TRUE;
|
||||
}
|
||||
|
||||
if(hMenu && S_OK==(pContextMenu->lpvtbl->fnQueryContextMenu(pContextMenu,
|
||||
if(hMenu && SUCCEEDED(pContextMenu->lpvtbl->fnQueryContextMenu(pContextMenu,
|
||||
hMenu,0,MENU_OFFSET,MENU_MAX,CMF_NORMAL |
|
||||
(uSelected != 1 ? 0 : CMF_CANRENAME) | (fExplore ? CMF_EXPLORE : 0))))
|
||||
{ if(fDefault)
|
||||
{ uCommand = 0;
|
||||
(uSelected != 1 ? 0 : CMF_CANRENAME) |
|
||||
(fExplore ? CMF_EXPLORE : 0))))
|
||||
{ if(fDefault)
|
||||
{ TRACE(shell,"-- fDefault\n");
|
||||
uCommand = 0;
|
||||
|
||||
ZeroMemory(&mii, sizeof(mii));
|
||||
mii.cbSize = sizeof(mii);
|
||||
mii.fMask = MIIM_STATE | MIIM_ID;
|
||||
ZeroMemory(&mii, sizeof(mii));
|
||||
mii.cbSize = sizeof(mii);
|
||||
mii.fMask = MIIM_STATE | MIIM_ID;
|
||||
|
||||
nMenuIndex = 0;
|
||||
nMenuIndex = 0;
|
||||
|
||||
//find the default item in the menu
|
||||
while(GetMenuItemInfo32A(hMenu, nMenuIndex, TRUE, &mii))
|
||||
{ if(mii.fState & MFS_DEFAULT)
|
||||
{ uCommand = mii.wID;
|
||||
break;
|
||||
}
|
||||
nMenuIndex++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ uCommand = TrackPopupMenu32( hMenu,TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,this->hWnd,NULL);
|
||||
}
|
||||
/*find the default item in the menu*/
|
||||
while(GetMenuItemInfo32A(hMenu, nMenuIndex, TRUE, &mii))
|
||||
{ if(mii.fState & MFS_DEFAULT)
|
||||
{ uCommand = mii.wID;
|
||||
break;
|
||||
}
|
||||
nMenuIndex++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ TRACE(shell,"-- ! fDefault\n");
|
||||
uCommand = TrackPopupMenu32( hMenu,TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,this->hWnd,NULL);
|
||||
}
|
||||
|
||||
if(uCommand > 0)
|
||||
{ ZeroMemory(&cmi, sizeof(cmi));
|
||||
cmi.cbSize = sizeof(cmi);
|
||||
cmi.hwnd = this->hWndParent;
|
||||
cmi.lpVerb = (LPCSTR)MAKEINTRESOURCE32A(uCommand - MENU_OFFSET);
|
||||
pContextMenu->lpvtbl->fnInvokeCommand(pContextMenu, &cmi);
|
||||
}
|
||||
DestroyMenu32(hMenu);
|
||||
}
|
||||
pContextMenu->lpvtbl->fnRelease(pContextMenu);
|
||||
}
|
||||
SHFree(aSelectedItems);
|
||||
if(uCommand > 0)
|
||||
{ TRACE(shell,"-- ! uCommand\n");
|
||||
ZeroMemory(&cmi, sizeof(cmi));
|
||||
cmi.cbSize = sizeof(cmi);
|
||||
cmi.hwnd = this->hWndParent;
|
||||
cmi.lpVerb = (LPCSTR)MAKEINTRESOURCE32A(uCommand - MENU_OFFSET);
|
||||
pContextMenu->lpvtbl->fnInvokeCommand(pContextMenu, &cmi);
|
||||
}
|
||||
DestroyMenu32(hMenu);
|
||||
}
|
||||
pContextMenu->lpvtbl->fnRelease(pContextMenu);
|
||||
}
|
||||
SHFree(aSelectedItems);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ShellView_OnCommand()
|
||||
*/
|
||||
LRESULT ShellView_OnCommand(LPSHELLVIEW this,DWORD dwCmdID, DWORD dwCmd, HWND32 hwndCmd)
|
||||
{ TRACE(shell,"(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",this, dwCmdID, dwCmd, hwndCmd);
|
||||
switch(dwCmdID)
|
||||
{ case IDM_VIEW_FILES:
|
||||
g_bViewKeys = ! g_bViewKeys;
|
||||
IShellView_Refresh(this);
|
||||
break;
|
||||
|
||||
case IDM_VIEW_IDW:
|
||||
g_bShowIDW = ! g_bShowIDW;
|
||||
ShellView_AddRemoveDockingWindow(this, g_bShowIDW);
|
||||
break;
|
||||
|
||||
case IDM_MYFILEITEM:
|
||||
MessageBeep32(MB_OK);
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME(shell,"-- unknown command\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ShellView_OnNotify()
|
||||
*/
|
||||
|
||||
LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT32 CtlID, LPNMHDR lpnmh)
|
||||
{ NM_LISTVIEW *lpnmlv = (NM_LISTVIEW*)lpnmh;
|
||||
LV_DISPINFO *lpdi = (LV_DISPINFO *)lpnmh;
|
||||
LPITEMIDLIST pidl;
|
||||
DWORD dwCursor;
|
||||
STRRET str;
|
||||
UINT32 uFlags;
|
||||
IExtractIcon *pei;
|
||||
{ NM_LISTVIEW *lpnmlv = (NM_LISTVIEW*)lpnmh;
|
||||
NMLVDISPINFO32A *lpdi = (NMLVDISPINFO32A *)lpnmh;
|
||||
LPITEMIDLIST pidl;
|
||||
DWORD dwCursor;
|
||||
STRRET str;
|
||||
UINT32 uFlags;
|
||||
IExtractIcon *pei;
|
||||
|
||||
TRACE(shell,"%p CtlID=%u lpnmh->code=%x\n",this,CtlID,lpnmh->code);
|
||||
TRACE(shell,"%p CtlID=%u lpnmh->code=%x\n",this,CtlID,lpnmh->code);
|
||||
|
||||
switch(lpnmh->code)
|
||||
{ case NM_SETFOCUS:
|
||||
TRACE(shell,"NM_SETFOCUS %p\n",this);
|
||||
ShellView_OnSetFocus(this);
|
||||
break;
|
||||
switch(lpnmh->code)
|
||||
{ case NM_SETFOCUS:
|
||||
TRACE(shell,"NM_SETFOCUS %p\n",this);
|
||||
ShellView_OnSetFocus(this);
|
||||
break;
|
||||
|
||||
case NM_KILLFOCUS:
|
||||
TRACE(shell,"NM_KILLFOCUS %p\n",this);
|
||||
ShellView_OnDeactivate(this);
|
||||
break;
|
||||
case NM_KILLFOCUS:
|
||||
TRACE(shell,"NM_KILLFOCUS %p\n",this);
|
||||
ShellView_OnDeactivate(this);
|
||||
break;
|
||||
|
||||
case HDN_ENDTRACK:
|
||||
TRACE(shell,"HDN_ENDTRACK %p\n",this);
|
||||
/*nColumn1 = ListView_GetColumnWidth(this->hWndList, 0);
|
||||
nColumn2 = ListView_GetColumnWidth(this->hWndList, 1);*/
|
||||
return 0;
|
||||
case HDN_ENDTRACK32A:
|
||||
TRACE(shell,"HDN_ENDTRACK32A %p\n",this);
|
||||
/*nColumn1 = ListView_GetColumnWidth(this->hWndList, 0);
|
||||
nColumn2 = ListView_GetColumnWidth(this->hWndList, 1);*/
|
||||
return 0;
|
||||
|
||||
case LVN_DELETEITEM:
|
||||
TRACE(shell,"LVN_DELETEITEM %p\n",this);
|
||||
SHFree((LPITEMIDLIST)lpnmlv->lParam); /*delete the pidl because we made a copy of it*/
|
||||
break;
|
||||
case LVN_DELETEITEM:
|
||||
TRACE(shell,"LVN_DELETEITEM %p\n",this);
|
||||
SHFree((LPITEMIDLIST)lpnmlv->lParam); /*delete the pidl because we made a copy of it*/
|
||||
break;
|
||||
|
||||
#ifdef LVN_ITEMACTIVATE
|
||||
case LVN_ITEMACTIVATE:
|
||||
|
||||
#else //LVN_ITEMACTIVATE
|
||||
case NM_DBLCLK:
|
||||
case NM_RETURN:
|
||||
#endif //LVN_ITEMACTIVATE
|
||||
TRACE(shell,"LVN_ITEMACTIVATE | NM_RETURN %p\n",this);
|
||||
ShellView_DoContextMenu(this, 0, 0, TRUE);
|
||||
return 0;
|
||||
case LVN_ITEMACTIVATE:
|
||||
#else
|
||||
case NM_DBLCLK:
|
||||
case NM_RETURN:
|
||||
#endif
|
||||
TRACE(shell,"LVN_ITEMACTIVATE | NM_RETURN %p\n",this);
|
||||
ShellView_DoContextMenu(this, 0, 0, TRUE);
|
||||
return 0;
|
||||
|
||||
case LVN_GETDISPINFO:
|
||||
TRACE(shell,"LVN_GETDISPINFO %p\n",this);
|
||||
pidl = (LPITEMIDLIST)lpdi->item.lParam;
|
||||
case NM_RCLICK:
|
||||
TRACE(shell,"NM_RCLICK %p\n",this);
|
||||
dwCursor = GetMessagePos();
|
||||
ShellView_DoContextMenu(this, LOWORD(dwCursor), HIWORD(dwCursor), FALSE);
|
||||
|
||||
case LVN_GETDISPINFO32A:
|
||||
TRACE(shell,"LVN_GETDISPINFO32A %p\n",this);
|
||||
pidl = (LPITEMIDLIST)lpdi->item.lParam;
|
||||
|
||||
|
||||
if(lpdi->item.iSubItem) /*is the sub-item information being requested?*/
|
||||
{ if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/
|
||||
{ if(PidlMgr_IsValue(NULL,pidl)) /*is this a value or a folder?*/
|
||||
{ PidlMgr_GetDataText(NULL,this->mpidl, pidl, lpdi->item.pszText, lpdi->item.cchTextMax);
|
||||
if(!*lpdi->item.pszText)
|
||||
sprintf(lpdi->item.pszText, "file attrib %u", lpdi->item.iSubItem );
|
||||
}
|
||||
else /*its a folder*/
|
||||
{ sprintf(lpdi->item.pszText, "folder attrib %u", lpdi->item.iSubItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
else /*the item text is being requested*/
|
||||
{ if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/
|
||||
{ if(S_OK==this->pSFParent->lpvtbl->fnGetDisplayNameOf(this->pSFParent,pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str))
|
||||
{ if(STRRET_WSTR == str.uType)
|
||||
{ WideCharToLocal32(lpdi->item.pszText, str.u.pOleStr, lpdi->item.cchTextMax);
|
||||
SHFree(str.u.pOleStr);
|
||||
}
|
||||
if(STRRET_CSTR == str.uType)
|
||||
{ strncpy(lpdi->item.pszText, str.u.cStr, lpdi->item.cchTextMax);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(lpdi->item.iSubItem) /*is the sub-item information being requested?*/
|
||||
{ if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/
|
||||
{ if(_ILIsValue(pidl)) /*is this a value or a folder?*/
|
||||
{ _ILGetDataText(this->mpidl, pidl, lpdi->item.pszText, lpdi->item.cchTextMax);
|
||||
if(!*lpdi->item.pszText)
|
||||
sprintf(lpdi->item.pszText, "file attrib %u", lpdi->item.iSubItem );
|
||||
}
|
||||
else /*its a folder*/
|
||||
{ sprintf(lpdi->item.pszText, "folder attrib %u", lpdi->item.iSubItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
else /*the item text is being requested*/
|
||||
{ if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/
|
||||
{ if(SUCCEEDED(this->pSFParent->lpvtbl->fnGetDisplayNameOf(this->pSFParent,pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str)))
|
||||
{ if(STRRET_WSTR == str.uType)
|
||||
{ WideCharToLocal32(lpdi->item.pszText, str.u.pOleStr, lpdi->item.cchTextMax);
|
||||
SHFree(str.u.pOleStr);
|
||||
}
|
||||
if(STRRET_CSTR == str.uType)
|
||||
{ strncpy(lpdi->item.pszText, str.u.cStr, lpdi->item.cchTextMax);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(lpdi->item.mask & LVIF_IMAGE) /*is the image being requested?*/
|
||||
{ if(S_OK == (this->pSFParent->lpvtbl->fnGetUIObjectOf(this->pSFParent,this->hWnd,1,
|
||||
(LPCITEMIDLIST*)&pidl, (REFIID)&IID_IExtractIcon, NULL, (LPVOID*)&pei)))
|
||||
{ //GetIconLoaction will give us the index into our image list
|
||||
pei->lpvtbl->fnGetIconLocation(pei, GIL_FORSHELL, NULL, 0, &lpdi->item.iImage, &uFlags);
|
||||
pei->lpvtbl->fnRelease(pei);
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE(shell,"-- text=%s image=%x\n",lpdi->item.pszText, lpdi->item.iImage);
|
||||
return 0;
|
||||
if(lpdi->item.mask & LVIF_IMAGE) /*is the image being requested?*/
|
||||
{ if(SUCCEEDED(this->pSFParent->lpvtbl->fnGetUIObjectOf(this->pSFParent,this->hWnd,1,
|
||||
(LPCITEMIDLIST*)&pidl, (REFIID)&IID_IExtractIcon, NULL, (LPVOID*)&pei)))
|
||||
{ //GetIconLoaction will give us the index into our image list
|
||||
pei->lpvtbl->fnGetIconLocation(pei, GIL_FORSHELL, NULL, 0, &lpdi->item.iImage, &uFlags);
|
||||
pei->lpvtbl->fnRelease(pei);
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE(shell,"-- text=%s image=%x\n",lpdi->item.pszText, lpdi->item.iImage);
|
||||
return 0;
|
||||
|
||||
case NM_RCLICK:
|
||||
TRACE(shell,"NM_RCLICK %p\n",this);
|
||||
dwCursor = GetMessagePos();
|
||||
ShellView_DoContextMenu(this, LOWORD(dwCursor), HIWORD(dwCursor), FALSE);
|
||||
case NM_CLICK:
|
||||
TRACE(shell,"NM_CLICK %p\n",this);
|
||||
break;
|
||||
|
||||
case NM_CLICK:
|
||||
TRACE(shell,"NM_CLICK %p\n",this);
|
||||
break;
|
||||
case LVN_ITEMCHANGING:
|
||||
TRACE(shell,"LVN_ITEMCHANGING %p\n",this);
|
||||
break;
|
||||
|
||||
case LVN_ITEMCHANGING:
|
||||
TRACE(shell,"LVN_ITEMCHANGING %p\n",this);
|
||||
break;
|
||||
case LVN_ITEMCHANGED:
|
||||
TRACE(shell,"LVN_ITEMCHANGED %p\n",this);
|
||||
break;
|
||||
|
||||
case NM_CUSTOMDRAW:
|
||||
TRACE(shell,"NM_CUSTOMDRAW %p\n",this);
|
||||
break;
|
||||
case NM_CUSTOMDRAW:
|
||||
TRACE(shell,"NM_CUSTOMDRAW %p\n",this);
|
||||
break;
|
||||
|
||||
default:
|
||||
WARN (shell,"-- WM_NOTIFY unhandled\n");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
default:
|
||||
WARN (shell,"-- WM_NOTIFY unhandled\n");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -875,7 +896,8 @@ LRESULT ShellView_OnNotify(LPSHELLVIEW this, UINT32 CtlID, LPNMHDR lpnmh)
|
|||
LRESULT CALLBACK ShellView_WndProc(HWND32 hWnd, UINT32 uMessage, WPARAM32 wParam, LPARAM lParam)
|
||||
{ LPSHELLVIEW pThis = (LPSHELLVIEW)GetWindowLong32A(hWnd, GWL_USERDATA);
|
||||
LPCREATESTRUCT32A lpcs;
|
||||
|
||||
DWORD dwCursor;
|
||||
|
||||
FIXME(shell,"(hwnd=%x msg=%x wparm=%x lparm=%lx)\n",hWnd, uMessage, wParam, lParam);
|
||||
|
||||
switch (uMessage)
|
||||
|
@ -970,6 +992,11 @@ LRESULT CALLBACK ShellView_WndProc(HWND32 hWnd, UINT32 uMessage, WPARAM32 wParam
|
|||
|
||||
case WM_PARENTNOTIFY:
|
||||
TRACE(shell,"WM_PARENTNOTIFY\n");
|
||||
if ( LOWORD(wParam) == WM_RBUTTONDOWN ) /* fixme: should not be handled here*/
|
||||
{ dwCursor = GetMessagePos();
|
||||
ShellView_DoContextMenu(pThis, LOWORD(dwCursor), HIWORD(dwCursor), FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
|
@ -1033,7 +1060,7 @@ static ULONG WINAPI IShellView_Release(LPSHELLVIEW this)
|
|||
return this->ref;
|
||||
}
|
||||
/**************************************************************************
|
||||
* IShellView::GetWindow
|
||||
* ShellView_GetWindow
|
||||
*/
|
||||
static HRESULT WINAPI IShellView_GetWindow(LPSHELLVIEW this,HWND32 * phWnd)
|
||||
{ TRACE(shell,"(%p) stub\n",this);
|
||||
|
@ -1045,9 +1072,19 @@ static HRESULT WINAPI IShellView_ContextSensitiveHelp(LPSHELLVIEW this,BOOL32 fE
|
|||
{ FIXME(shell,"(%p) stub\n",this);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
/**************************************************************************
|
||||
* IShellView_TranslateAccelerator
|
||||
*
|
||||
* FIXME:
|
||||
* use the accel functions
|
||||
*/
|
||||
static HRESULT WINAPI IShellView_TranslateAccelerator(LPSHELLVIEW this,LPMSG32 lpmsg)
|
||||
{ FIXME(shell,"(%p)->(%p) stub\n",this,lpmsg);
|
||||
return E_NOTIMPL;
|
||||
{ FIXME(shell,"(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",this,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam);
|
||||
/* switch (lpmsg->message)
|
||||
{ case WM_RBUTTONDOWN:
|
||||
return SendMessage32A ( lpmsg->hwnd, WM_NOTIFY, );
|
||||
}*/
|
||||
return S_FALSE;
|
||||
}
|
||||
static HRESULT WINAPI IShellView_EnableModeless(LPSHELLVIEW this,BOOL32 fEnable)
|
||||
{ FIXME(shell,"(%p) stub\n",this);
|
||||
|
@ -1151,7 +1188,7 @@ static HRESULT WINAPI IShellView_DestroyViewWindow(LPSHELLVIEW this)
|
|||
IShellView_UIActivate(this, SVUIA_DEACTIVATE);
|
||||
if(this->hMenu)
|
||||
{ DestroyMenu32(this->hMenu);
|
||||
}
|
||||
}
|
||||
DestroyWindow32(this->hWnd);
|
||||
this->pShellBrowser->lpvtbl->fnRelease(this->pShellBrowser);
|
||||
return S_OK;
|
||||
|
|
|
@ -29,19 +29,29 @@
|
|||
-----------
|
||||
This paragraph describes the development status of the common controls.
|
||||
|
||||
|
||||
|
||||
|
||||
3.1 Animation Control
|
||||
---------------------
|
||||
Author:
|
||||
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
|
||||
|
||||
Status:
|
||||
- Nothing done at all.
|
||||
- Dummy control. No functionality.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.2 Combo Box Ex Control
|
||||
------------------------
|
||||
Author:
|
||||
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
|
||||
|
||||
Status:
|
||||
- Nothing done at all.
|
||||
- Dummy control. No functionality.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.3 Date and Time Picker Control
|
||||
|
@ -49,18 +59,27 @@
|
|||
Status:
|
||||
- Nothing done at all.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.4 Drag List Box Control
|
||||
-------------------------
|
||||
Status:
|
||||
- Nothing done at all.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.5 Flat Scroll Bar Control
|
||||
---------------------------
|
||||
Status:
|
||||
- Nothing done at all.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.6 Header Control
|
||||
------------------
|
||||
|
@ -73,8 +92,14 @@
|
|||
|
||||
3.7 Hot Key Control
|
||||
-------------------
|
||||
Author:
|
||||
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
|
||||
|
||||
Status:
|
||||
- Nothing done at all.
|
||||
Dummy control. No functionality.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.8 Image List (no control)
|
||||
|
@ -96,21 +121,30 @@
|
|||
Status:
|
||||
- Nothing done at all.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.10 List View Control
|
||||
----------------------
|
||||
Author:
|
||||
James Michael Mastros <root@jennifer-unix.dyn.ml.org>
|
||||
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
|
||||
|
||||
Status:
|
||||
- Development in progress.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.11 Month Calendar Control
|
||||
---------------------------
|
||||
Status:
|
||||
- Nothing done at all.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
||||
|
||||
3.12 Pager Control
|
||||
------------------
|
||||
|
@ -217,13 +251,11 @@
|
|||
3.20 Trackbar Control
|
||||
---------------------
|
||||
Author:
|
||||
Dummy written by Eric Kohl.
|
||||
Dummy written by Eric Kohl <ekohl@abo.rhein-zeitung.de>
|
||||
Alex Priem (alexp@sci.kun.nl)
|
||||
|
||||
Status:
|
||||
- Dummy control. No functionality.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
Under construction.
|
||||
|
||||
|
||||
3.21 Tree View Control
|
||||
|
@ -233,7 +265,7 @@
|
|||
Alex Priem (alexp@sci.kun.nl)
|
||||
|
||||
Status:
|
||||
- Dummy control. No functionality.
|
||||
Under contstruction.
|
||||
|
||||
|
||||
3.22 Updown Control
|
||||
|
@ -266,16 +298,16 @@
|
|||
------------------------
|
||||
|
||||
There are quite a lot of undocumented functions like:
|
||||
- DSA (Dynnamic Structure Array) functions.
|
||||
- DPA (Dymnamic Pointer Array?) functions.
|
||||
- DSA (Dynnamic Storage 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 Structure Arrays (DSA)
|
||||
------------------------------------
|
||||
5.1 Dymnamic Storage 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.
|
||||
|
||||
|
|
|
@ -14,13 +14,18 @@ The macros are defined in file.h as follows.:
|
|||
(((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
|
||||
((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
|
||||
((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
|
||||
((handle)>0x400) ? handle : \
|
||||
(handle)-5)
|
||||
|
||||
#define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
|
||||
((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
|
||||
((handle>0x400) ? handle : \
|
||||
(HFILE16)hnd+5); })
|
||||
|
||||
WARNING: be careful not to use the macro HFILE16_TO_HFILE32 on
|
||||
functions with side-effects, as it will cause them to be evaluated
|
||||
several times. This could be considered a bug, but the use of this
|
||||
macro is limited enough not to need a rewrite.
|
||||
|
||||
NOTE: The 0x400 special case above deals with LZW filehandles (see
|
||||
misc/lzexpand.c).
|
||||
|
|
|
@ -27,6 +27,12 @@ implemented the classes and filled function stubs.
|
|||
----------------
|
||||
Status:
|
||||
- development started
|
||||
|
||||
Undocumented:
|
||||
word95 gets a IContextMenu Interface and calls HandleMenuMsg()
|
||||
whitch should only a member of IContextMenu2.
|
||||
I suppose IContextMenu and IContextMenu2/3 are using the same vtable
|
||||
and are in effect the same.
|
||||
|
||||
4.2 IShellExtInit
|
||||
-----------------
|
||||
|
@ -60,12 +66,20 @@ implemented the classes and filled function stubs.
|
|||
4.7. PIDL Manager
|
||||
-----------------
|
||||
Status:
|
||||
- roughly complete will be migrated to a set of functions because it's
|
||||
- roughly complete will be migrated to a set of functions because it's
|
||||
not holding any instance data,
|
||||
|
||||
Undocumented:
|
||||
MS says: the abID of SHITEMID should be treated as binary data and not
|
||||
be interpreted by applications. Applys to everyone but MS itself.
|
||||
Word95 interprets the contents of abID (Filesize/Date) so we have to go
|
||||
for binary compatibility here.
|
||||
I expect the file open/close dialog in comctl32 does so also.
|
||||
|
||||
|
||||
5. Structures
|
||||
-------------
|
||||
|
||||
5.1 PIDL
|
||||
--------
|
||||
|
||||
|
|
|
@ -320,6 +320,10 @@ static DOS_DIR *DOSFS_OpenDir( LPCSTR path )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Treat empty path as root directory. This simplifies path split into
|
||||
directory and mask in several other places */
|
||||
if (!*path) path = "/";
|
||||
|
||||
#ifdef VFAT_IOCTL_READDIR_BOTH
|
||||
|
||||
/* Check if the VFAT ioctl is supported on this directory */
|
||||
|
@ -609,7 +613,7 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
|
|||
FILE_OBJECT *file;
|
||||
HFILE32 handle;
|
||||
|
||||
if (!name) return NULL; /* if FILE_DupUnixHandle was used */
|
||||
if (!name) return (HFILE32)NULL; /* if FILE_DupUnixHandle was used */
|
||||
if (name[0] && (name[1] == ':')) name += 2;
|
||||
if ((p = strrchr( name, '/' ))) name = p + 1;
|
||||
if ((p = strrchr( name, '\\' ))) name = p + 1;
|
||||
|
@ -624,18 +628,24 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
|
|||
if (!strcmp(DOSFS_Devices[i].name,"NUL"))
|
||||
return FILE_OpenUnixFile("/dev/null",unixmode);
|
||||
if (!strcmp(DOSFS_Devices[i].name,"CON")) {
|
||||
HFILE32 to_dup;
|
||||
HFILE32 handle;
|
||||
switch (unixmode) {
|
||||
case O_RDONLY:
|
||||
return GetStdHandle( STD_INPUT_HANDLE );
|
||||
to_dup = GetStdHandle( STD_INPUT_HANDLE );
|
||||
break;
|
||||
case O_WRONLY:
|
||||
return GetStdHandle( STD_OUTPUT_HANDLE );
|
||||
to_dup = GetStdHandle( STD_OUTPUT_HANDLE );
|
||||
break;
|
||||
default:
|
||||
FIXME(dosfs,"can't open CON read/write\n");
|
||||
return HFILE_ERROR32;
|
||||
break;
|
||||
}
|
||||
if (!DuplicateHandle( GetCurrentProcess(), to_dup, GetCurrentProcess(),
|
||||
&handle, 0, FALSE, DUPLICATE_SAME_ACCESS ))
|
||||
handle = HFILE_ERROR32;
|
||||
return handle;
|
||||
}
|
||||
if (!strcmp(DOSFS_Devices[i].name,"SCSIMGR$")) {
|
||||
if ((handle = FILE_Alloc( &file )) == INVALID_HANDLE_VALUE32)
|
||||
|
@ -1166,19 +1176,19 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
|
|||
|
||||
/* Skip to desired position */
|
||||
while (info.cur_pos < skip)
|
||||
if (DOSFS_ReadDir( info.dir, &long_name, &short_name ))
|
||||
if (info.dir && DOSFS_ReadDir( info.dir, &long_name, &short_name ))
|
||||
info.cur_pos++;
|
||||
else
|
||||
break;
|
||||
|
||||
if (info.cur_pos == skip && DOSFS_FindNextEx( &info, entry ))
|
||||
if (info.dir && info.cur_pos == skip && DOSFS_FindNextEx( &info, entry ))
|
||||
count = info.cur_pos - skip;
|
||||
else
|
||||
count = 0;
|
||||
|
||||
if (!count)
|
||||
{
|
||||
DOSFS_CloseDir( info.dir );
|
||||
if (info.dir) DOSFS_CloseDir( info.dir );
|
||||
memset( &info, '\0', sizeof(info) );
|
||||
}
|
||||
|
||||
|
|
|
@ -784,7 +784,7 @@ UINT32 WINAPI GetDriveType32A( LPCSTR root )
|
|||
case TYPE_HD: return DRIVE_FIXED;
|
||||
case TYPE_CDROM: return DRIVE_CDROM;
|
||||
case TYPE_NETWORK: return DRIVE_REMOTE;
|
||||
case TYPE_INVALID:
|
||||
case TYPE_INVALID: return DRIVE_DOESNOTEXIST;
|
||||
default: return DRIVE_CANNOTDETERMINE;
|
||||
}
|
||||
}
|
||||
|
@ -1040,3 +1040,8 @@ BOOL32 WINAPI GetVolumeInformation32W( LPCWSTR root, LPWSTR label,
|
|||
HeapFree( GetProcessHeap(), 0, xfsname );
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL32 WINAPI SetVolumeLabel32A(LPCSTR rootpath,LPCSTR volname) {
|
||||
FIXME(dosfs,"(%s,%s),stub!\n",rootpath,volname);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
73
files/file.c
73
files/file.c
|
@ -87,6 +87,7 @@ HFILE32 FILE_Alloc( FILE_OBJECT **file )
|
|||
(*file)->unix_handle = -1;
|
||||
(*file)->unix_name = NULL;
|
||||
(*file)->type = FILE_TYPE_DISK;
|
||||
(*file)->pos = 0;
|
||||
|
||||
handle = HANDLE_Alloc( PROCESS_Current(), &(*file)->header,
|
||||
FILE_ALL_ACCESS | GENERIC_READ |
|
||||
|
@ -112,7 +113,8 @@ static BOOL32 FILE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if ((result = read(file->unix_handle, lpBuffer, nNumberOfChars)) == -1)
|
||||
if ( (file->pos < 0) || /* workaround, see SetFilePointer */
|
||||
((result = read(file->unix_handle, lpBuffer, nNumberOfChars)) == -1) )
|
||||
{
|
||||
FILE_SetDosError();
|
||||
return FALSE;
|
||||
|
@ -144,6 +146,11 @@ static BOOL32 FILE_Write(K32OBJ *ptr, LPCVOID lpBuffer, DWORD nNumberOfChars,
|
|||
* win32 doesn't have interrupted system calls
|
||||
*/
|
||||
|
||||
if (file->pos < 0) { /* workaround, see SetFilePointer */
|
||||
FILE_SetDosError();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
result = write(file->unix_handle, lpBuffer, nNumberOfChars);
|
||||
|
@ -871,6 +878,7 @@ error: /* We get here if there was an error opening the file */
|
|||
*/
|
||||
HFILE16 WINAPI OpenFile16( LPCSTR name, OFSTRUCT *ofs, UINT16 mode )
|
||||
{
|
||||
TRACE(file,"OpenFile16(%s,%i)\n", name, mode);
|
||||
return HFILE32_TO_HFILE16(FILE_DoOpenFile( name, ofs, mode, FALSE ));
|
||||
}
|
||||
|
||||
|
@ -999,7 +1007,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
|
|||
DWORD method )
|
||||
{
|
||||
FILE_OBJECT *file;
|
||||
int origin, result;
|
||||
DWORD result = 0xffffffff;
|
||||
|
||||
if (highword && *highword)
|
||||
{
|
||||
|
@ -1008,28 +1016,56 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
|
|||
return 0xffffffff;
|
||||
}
|
||||
TRACE(file, "handle %d offset %ld origin %ld\n",
|
||||
hFile, distance, method );
|
||||
hFile, distance, method );
|
||||
|
||||
if (!(file = FILE_GetFile( hFile ))) return 0xffffffff;
|
||||
|
||||
|
||||
/* the pointer may be positioned before the start of the file;
|
||||
no error is returned in that case,
|
||||
but subsequent attempts at I/O will produce errors.
|
||||
This is not allowed with Unix lseek(),
|
||||
so we'll need some emulation here */
|
||||
switch(method)
|
||||
{
|
||||
case FILE_CURRENT: origin = SEEK_CUR; break;
|
||||
case FILE_END: origin = SEEK_END; break;
|
||||
default: origin = SEEK_SET; break;
|
||||
case FILE_CURRENT:
|
||||
distance += file->pos; /* fall through */
|
||||
case FILE_BEGIN:
|
||||
if ((result = lseek(file->unix_handle, distance, SEEK_SET)) == -1)
|
||||
{
|
||||
if ((INT32)distance < 0)
|
||||
file->pos = result = distance;
|
||||
}
|
||||
else
|
||||
file->pos = result;
|
||||
break;
|
||||
case FILE_END:
|
||||
if ((result = lseek(file->unix_handle, distance, SEEK_END)) == -1)
|
||||
{
|
||||
if ((INT32)distance < 0)
|
||||
{
|
||||
/* get EOF */
|
||||
result = lseek(file->unix_handle, 0, SEEK_END);
|
||||
|
||||
/* return to the old pos, as the first lseek failed */
|
||||
lseek(file->unix_handle, file->pos, SEEK_END);
|
||||
|
||||
file->pos = (result += distance);
|
||||
}
|
||||
else
|
||||
ERR(file, "lseek: unknown error. Please report.\n");
|
||||
}
|
||||
else file->pos = result;
|
||||
break;
|
||||
default:
|
||||
ERR(file, "Unknown origin %ld !\n", method);
|
||||
}
|
||||
|
||||
if ((result = lseek( file->unix_handle, distance, origin )) == -1)
|
||||
{
|
||||
/* care for this pathological case:
|
||||
SetFilePointer(00000006,ffffffff,00000000,00000002)
|
||||
ret=0062ab4a fs=01c7 */
|
||||
if ((distance != -1))
|
||||
if (result == -1)
|
||||
FILE_SetDosError();
|
||||
else
|
||||
result = 0;
|
||||
}
|
||||
|
||||
FILE_ReleaseFile( file );
|
||||
return (DWORD)result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1665,7 +1701,7 @@ BOOL32 WINAPI CopyFile32W( LPCWSTR source, LPCWSTR dest, BOOL32 fail_if_exists)
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* SetFileTime (KERNEL32.493)
|
||||
* SetFileTime (KERNEL32.650)
|
||||
*/
|
||||
BOOL32 WINAPI SetFileTime( HFILE32 hFile,
|
||||
const FILETIME *lpCreationTime,
|
||||
|
@ -1676,7 +1712,7 @@ BOOL32 WINAPI SetFileTime( HFILE32 hFile,
|
|||
struct utimbuf utimbuf;
|
||||
|
||||
if (!file) return FILE_TYPE_UNKNOWN; /* FIXME: correct? */
|
||||
TRACE(file,"(%s,%p,%p,%p)\n",
|
||||
TRACE(file,"('%s',%p,%p,%p)\n",
|
||||
file->unix_name,
|
||||
lpCreationTime,
|
||||
lpLastAccessTime,
|
||||
|
@ -1692,6 +1728,7 @@ BOOL32 WINAPI SetFileTime( HFILE32 hFile,
|
|||
utimbuf.modtime = 0; /* FIXME */
|
||||
if (-1==utime(file->unix_name,&utimbuf))
|
||||
{
|
||||
MSG("Couldn't set the time for file '%s'. Insufficient permissions !?\n", file->unix_name);
|
||||
FILE_ReleaseFile( file );
|
||||
FILE_SetDosError();
|
||||
return FALSE;
|
||||
|
|
152
files/profile.c
152
files/profile.c
|
@ -951,6 +951,19 @@ INT32 WINAPI GetProfileSection32A( LPCSTR section, LPSTR buffer, DWORD len )
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetProfileSection32W (KERNEL32)
|
||||
*/
|
||||
INT32 WINAPI GetProfileSection32W( LPCWSTR section, LPWSTR buffer, DWORD len )
|
||||
{
|
||||
if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini" );
|
||||
return GetPrivateProfileSection32W( section, buffer, len, wininiW );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* WriteProfileString16 (KERNEL.59)
|
||||
*/
|
||||
|
@ -1089,6 +1102,25 @@ INT32 WINAPI GetPrivateProfileSection32A( LPCSTR section, LPSTR buffer,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileSection32W (KERNEL32.256)
|
||||
*/
|
||||
|
||||
INT32 WINAPI GetPrivateProfileSection32W (LPCWSTR section, LPWSTR buffer,
|
||||
DWORD len, LPCWSTR filename )
|
||||
|
||||
{
|
||||
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
|
||||
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
|
||||
LPSTR bufferA = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
INT32 ret = GetPrivateProfileSection32A( sectionA, bufferA, len,
|
||||
filenameA );
|
||||
HeapFree( GetProcessHeap(), 0, sectionA );
|
||||
HeapFree( GetProcessHeap(), 0, filenameA );
|
||||
HeapFree( GetProcessHeap(), 0, bufferA);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WritePrivateProfileString16 (KERNEL.129)
|
||||
*/
|
||||
|
@ -1136,7 +1168,7 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section,
|
|||
{
|
||||
char *p =(char*)string;
|
||||
|
||||
FIXME(profile, "WritePrivateProfileSection32A empty stup\n");
|
||||
FIXME(profile, "WritePrivateProfileSection32A empty stub\n");
|
||||
if (TRACE_ON(profile)) {
|
||||
TRACE(profile, "(%s) => [%s]\n", filename, section);
|
||||
while (*(p+1)) {
|
||||
|
@ -1149,6 +1181,43 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WritePrivateProfileSection32W (KERNEL32)
|
||||
*/
|
||||
BOOL32 WINAPI WritePrivateProfileSection32W( LPCWSTR section,
|
||||
LPCWSTR string, LPCWSTR filename)
|
||||
|
||||
{
|
||||
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
|
||||
LPSTR stringA = HEAP_strdupWtoA( GetProcessHeap(), 0, string );
|
||||
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
|
||||
BOOL32 res = WritePrivateProfileSection32A( sectionA, stringA, filenameA );
|
||||
HeapFree( GetProcessHeap(), 0, sectionA );
|
||||
HeapFree( GetProcessHeap(), 0, stringA );
|
||||
HeapFree( GetProcessHeap(), 0, filenameA );
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* WriteProfileSection32A (KERNEL32.747)
|
||||
*/
|
||||
BOOL32 WINAPI WriteProfileSection32A( LPCSTR section, LPCSTR keys_n_values)
|
||||
|
||||
{
|
||||
return WritePrivateProfileSection32A( section, keys_n_values, "win.ini");
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WriteProfileSection32W (KERNEL32.748)
|
||||
*/
|
||||
BOOL32 WINAPI WriteProfileSection32W( LPCWSTR section, LPCWSTR keys_n_values)
|
||||
{
|
||||
if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");
|
||||
|
||||
return (WritePrivateProfileSection32W (section,keys_n_values, wininiW));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileSectionNames16 (KERNEL.143)
|
||||
*/
|
||||
|
@ -1182,6 +1251,45 @@ WORD WINAPI GetPrivateProfileSectionNames16( LPSTR buffer, WORD size,
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetProfileSectionNames16 (KERNEL.142)
|
||||
*/
|
||||
WORD WINAPI GetProfileSectionNames16( LPSTR buffer, WORD size)
|
||||
|
||||
{
|
||||
return (GetPrivateProfileSectionNames16 (buffer,size,"win.ini"));
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileSectionNames32A (KERNEL32.365)
|
||||
*/
|
||||
DWORD WINAPI GetPrivateProfileSectionNames32A( LPSTR buffer, DWORD size,
|
||||
LPCSTR filename)
|
||||
|
||||
{
|
||||
return (GetPrivateProfileSectionNames16 (buffer,size,filename));
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileSectionNames32W (KERNEL32.366)
|
||||
*/
|
||||
DWORD WINAPI GetPrivateProfileSectionNames32W( LPWSTR buffer, DWORD size,
|
||||
LPCWSTR filename)
|
||||
|
||||
{
|
||||
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
|
||||
LPSTR bufferA = HeapAlloc( GetProcessHeap(), 0, size);
|
||||
|
||||
INT32 ret = GetPrivateProfileSectionNames16 (bufferA, size, filenameA);
|
||||
lstrcpynAtoW( buffer, bufferA, size);
|
||||
HeapFree( GetProcessHeap(), 0, bufferA);
|
||||
HeapFree( GetProcessHeap(), 0, filenameA );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileStruct32A (KERNEL32.370)
|
||||
|
@ -1200,6 +1308,30 @@ BOOL32 WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetPrivateProfileStruct32W (KERNEL32.543)
|
||||
*/
|
||||
BOOL32 WINAPI GetPrivateProfileStruct32W (LPCWSTR section, LPCWSTR key,
|
||||
LPVOID buffer, UINT32 len, LPCWSTR filename)
|
||||
{
|
||||
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
|
||||
LPSTR keyA = HEAP_strdupWtoA( GetProcessHeap(), 0, key);
|
||||
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
|
||||
LPSTR bufferA = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
|
||||
INT32 ret = GetPrivateProfileStruct32A( sectionA, keyA, bufferA,
|
||||
len, filenameA );
|
||||
lstrcpynAtoW( buffer, bufferA, len );
|
||||
HeapFree( GetProcessHeap(), 0, bufferA);
|
||||
HeapFree( GetProcessHeap(), 0, sectionA );
|
||||
HeapFree( GetProcessHeap(), 0, keyA );
|
||||
HeapFree( GetProcessHeap(), 0, filenameA );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* WritePrivateProfileStruct32A (KERNEL32.744)
|
||||
|
@ -1216,6 +1348,24 @@ BOOL32 WINAPI WritePrivateProfileStruct32A (LPCSTR section, LPCSTR key,
|
|||
return PROFILE_SetString( section, key, buf);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WritePrivateProfileStruct32W (KERNEL32.544)
|
||||
*/
|
||||
BOOL32 WINAPI WritePrivateProfileStruct32W (LPCWSTR section, LPCWSTR key,
|
||||
LPVOID buf, UINT32 bufsize, LPCWSTR filename)
|
||||
{
|
||||
LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section );
|
||||
LPSTR keyA = HEAP_strdupWtoA( GetProcessHeap(), 0, key);
|
||||
LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
|
||||
INT32 ret = WritePrivateProfileStruct32A( sectionA, keyA, buf, bufsize,
|
||||
filenameA );
|
||||
HeapFree( GetProcessHeap(), 0, sectionA );
|
||||
HeapFree( GetProcessHeap(), 0, keyA );
|
||||
HeapFree( GetProcessHeap(), 0, filenameA );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* WriteOutProfiles (KERNEL.315)
|
||||
|
|
|
@ -369,6 +369,7 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Unlock(
|
|||
this->t.xlib.image->width,
|
||||
this->t.xlib.image->height
|
||||
);
|
||||
TSXSetWindowColormap(display,this->s.ddraw->e.xlib.drawable,this->s.palette->cm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -995,13 +996,67 @@ static struct IDirectDrawPalette_VTable xlib_ddpalvt = {
|
|||
Xlib_IDirectDrawPalette_SetEntries
|
||||
};
|
||||
|
||||
static HRESULT WINAPI IDirect3D_QueryInterface(
|
||||
LPDIRECT3D this,REFIID refiid,LPVOID *obj
|
||||
) {
|
||||
/* FIXME: Not sure if this is correct */
|
||||
char xrefiid[50];
|
||||
|
||||
WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
|
||||
TRACE(ddraw,"(%p)->(%s,%p)\n",this,xrefiid,obj);
|
||||
if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
|
||||
*obj = this;
|
||||
this->lpvtbl->fnAddRef(this);
|
||||
return 0;
|
||||
}
|
||||
if (!memcmp(&IID_IDirect3D,refiid,sizeof(IID_IDirect3D))) {
|
||||
LPDIRECT3D d3d;
|
||||
|
||||
d3d = HeapAlloc(GetProcessHeap(),0,sizeof(*d3d));
|
||||
d3d->ref = 1;
|
||||
d3d->ddraw = (LPDIRECTDRAW)this;
|
||||
this->lpvtbl->fnAddRef(this);
|
||||
d3d->lpvtbl = &d3dvt;
|
||||
*obj = d3d;
|
||||
return 0;
|
||||
}
|
||||
if (!memcmp(&IID_IDirect3D2,refiid,sizeof(IID_IDirect3D))) {
|
||||
LPDIRECT3D2 d3d;
|
||||
|
||||
d3d = HeapAlloc(GetProcessHeap(),0,sizeof(*d3d));
|
||||
d3d->ref = 1;
|
||||
d3d->ddraw = (LPDIRECTDRAW)this;
|
||||
this->lpvtbl->fnAddRef(this);
|
||||
d3d->lpvtbl = &d3d2vt;
|
||||
*obj = d3d;
|
||||
return 0;
|
||||
}
|
||||
FIXME(ddraw,"(%p):interface for IID %s NOT found!\n",this,xrefiid);
|
||||
return OLE_E_ENUM_NOMORE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirect3D_AddRef(LPDIRECT3D this) {
|
||||
return ++(this->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IDirect3D_Release(LPDIRECT3D this)
|
||||
{
|
||||
TRACE(ddraw,"(%p)->Release()\n",this);
|
||||
if (!--(this->ref)) {
|
||||
this->ddraw->lpvtbl->fnRelease(this->ddraw);
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
return 0;
|
||||
}
|
||||
return this->ref;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* IDirect3D
|
||||
*/
|
||||
static struct IDirect3D_VTable d3dvt = {
|
||||
(void*)1,
|
||||
(void*)2,
|
||||
(void*)3,
|
||||
(void*)IDirect3D_QueryInterface,
|
||||
(void*)IDirect3D_AddRef,
|
||||
(void*)IDirect3D_Release,
|
||||
(void*)4,
|
||||
(void*)5,
|
||||
(void*)6,
|
||||
|
@ -1014,8 +1069,7 @@ static struct IDirect3D_VTable d3dvt = {
|
|||
* IDirect3D2
|
||||
*/
|
||||
static ULONG WINAPI IDirect3D2_Release(LPDIRECT3D2 this) {
|
||||
this->ref--;
|
||||
if (!this->ref) {
|
||||
if (!--(this->ref)) {
|
||||
this->ddraw->lpvtbl->fnRelease(this->ddraw);
|
||||
HeapFree(GetProcessHeap(),0,this);
|
||||
return 0;
|
||||
|
|
|
@ -202,3 +202,23 @@ MFDRV_PaintRgn( DC *dc, HRGN32 hrgn )
|
|||
return MF_MetaParam1( dc, META_PAINTREGION, index );
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* MFDRV_SetBkColor
|
||||
*/
|
||||
COLORREF
|
||||
MFDRV_SetBkColor( DC *dc, COLORREF color )
|
||||
{
|
||||
return MF_MetaParam2(dc, META_SETBKCOLOR, HIWORD(color), LOWORD(color));
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* MFDRV_SetTextColor
|
||||
*/
|
||||
COLORREF
|
||||
MFDRV_SetTextColor( DC *dc, COLORREF color )
|
||||
{
|
||||
return MF_MetaParam2(dc, META_SETTEXTCOLOR, HIWORD(color), LOWORD(color));
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
|||
NULL, /* pSelectClipRgn */
|
||||
MFDRV_SelectObject, /* pSelectObject */
|
||||
NULL, /* pSelectPalette */
|
||||
NULL, /* pSetBkColor */
|
||||
MFDRV_SetBkColor, /* pSetBkColor */
|
||||
NULL, /* pSetBkMode */
|
||||
NULL, /* pSetDeviceClipping */
|
||||
NULL, /* pSetDIBitsToDevice */
|
||||
|
@ -70,7 +70,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
|||
NULL, /* pSetStretchBltMode */
|
||||
NULL, /* pSetTextAlign */
|
||||
NULL, /* pSetTextCharacterExtra */
|
||||
NULL, /* pSetTextColor */
|
||||
MFDRV_SetTextColor, /* pSetTextColor */
|
||||
NULL, /* pSetTextJustification */
|
||||
MFDRV_SetViewportExt, /* pSetViewportExt */
|
||||
MFDRV_SetViewportOrg, /* pSetViewportOrg */
|
||||
|
@ -310,7 +310,7 @@ BOOL32 WINAPI DeleteMetaFile32(
|
|||
/*
|
||||
need wide version as well
|
||||
*/
|
||||
HDC32 CreateEnhMetaFile32A(
|
||||
HDC32 WINAPI CreateEnhMetaFile32A(
|
||||
HDC32 hdc, /* optional reference DC */
|
||||
LPCSTR filename, /* optional filename for disk metafiles */
|
||||
const RECT32 *rect, /* optional bounding rectangle */
|
||||
|
@ -351,7 +351,7 @@ HDC32 CreateEnhMetaFile32A(
|
|||
return 0;
|
||||
}
|
||||
|
||||
HENHMETAFILE32 CloseEnhMetaFile32(
|
||||
HENHMETAFILE32 WINAPI CloseEnhMetaFile32(
|
||||
HDC32 hdc /* metafile DC */
|
||||
)
|
||||
{
|
||||
|
|
|
@ -7,12 +7,15 @@ MODULE = psdrv
|
|||
|
||||
C_SRCS = \
|
||||
afm.c \
|
||||
brush.c \
|
||||
color.c \
|
||||
driver.c \
|
||||
escape.c \
|
||||
font.c \
|
||||
graphics.c \
|
||||
init.c \
|
||||
objects.c \
|
||||
pen.c \
|
||||
ppd.c \
|
||||
ps.c \
|
||||
text.c
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Wine Postscript Driver
|
||||
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
|
||||
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.
|
||||
|
||||
|
||||
|
@ -14,15 +14,15 @@ 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:
|
||||
device=Wine PostScript Driver,WINEPS,LPT1:
|
||||
|
||||
to the [windows] section of win.ini . You may prefer to add
|
||||
|
||||
Wine Postscript Driver=WINEPS,LPT1:
|
||||
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
|
||||
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
|
||||
|
@ -39,13 +39,16 @@ file=/unix/path/name/filename.afm
|
|||
|
||||
for each AFM file that you wish to use. [This might change in the future]
|
||||
|
||||
You also require a ppd file for your printer. This describes certain
|
||||
You also require a PPD file for your printer. This describes certain
|
||||
characteristics of the printer such as which fonts are installed, how to select
|
||||
manual feed etc. Adobe also has many of these on its website, have a look in
|
||||
ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/
|
||||
Put the ppd in the directory from which you start wine and call it default.ppd
|
||||
Put the PPD in the directory from which you start wine and call it default.ppd
|
||||
[this will definitely change soon].
|
||||
|
||||
To enable colour printing you need to have the *ColorDevice entry in the PPD
|
||||
set to true, otherwise the driver will generate greyscale.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -63,21 +66,21 @@ specify whether you have optional extras such as envelope feeders. You will
|
|||
therefore find a larger than normal selection of input bins in the print setup
|
||||
dialog box. I've only really tested ppd parsing on the hp4m6_v1.ppd file.
|
||||
|
||||
Landscape mode probably doesn't quite work yet (this is easy to fix).
|
||||
|
||||
Graphics are basically non-existent. Only MoveTo/LineTo/Rectangle with a thin
|
||||
black pen.
|
||||
|
||||
No colour.
|
||||
|
||||
AFM parsing is not finished (or ideal).
|
||||
Many graphics functions to do.
|
||||
|
||||
No TrueType download.
|
||||
|
||||
AdvancedSetup dialog box.
|
||||
|
||||
Many partially implemented functions.
|
||||
|
||||
ps.c is becoming messy.
|
||||
|
||||
No clipping.
|
||||
|
||||
Notepad often starts text too far to the left depending on the margin
|
||||
settings. However the win3.1 pscript.drv (under wine) also does this.
|
||||
|
||||
Probably many more...
|
||||
|
||||
Since the driver is very alpha, things are likely to change quickly.
|
||||
|
|
|
@ -30,66 +30,81 @@ FONTFAMILY *PSDRV_AFMFontList = NULL;
|
|||
*/
|
||||
static void PSDRV_AFMGetCharMetrics(AFM *afm, FILE *fp)
|
||||
{
|
||||
char buf[256];
|
||||
char *cp, *item, *value;
|
||||
int i, charno;
|
||||
char line[256], valbuf[256];
|
||||
char *cp, *item, *value, *curpos, *endpos;
|
||||
int i;
|
||||
AFMMETRICS **insert = &afm->Metrics, *metric;
|
||||
|
||||
for(i = 0; i < afm->NumofMetrics; i++) {
|
||||
char *name = NULL;
|
||||
|
||||
if(!fgets(buf, sizeof(buf), fp)) {
|
||||
if(!fgets(line, sizeof(line), fp)) {
|
||||
ERR(psdrv, "Unexpected EOF\n");
|
||||
return;
|
||||
}
|
||||
cp = buf + strlen(buf);
|
||||
|
||||
metric = *insert = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY,
|
||||
sizeof(AFMMETRICS) );
|
||||
insert = &metric->next;
|
||||
|
||||
cp = line + strlen(line);
|
||||
do {
|
||||
*cp = '\0';
|
||||
cp--;
|
||||
} while(cp > buf && isspace(*cp));
|
||||
} while(cp > line && 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, ";"))) {
|
||||
curpos = line;
|
||||
while(*curpos) {
|
||||
item = curpos;
|
||||
while(isspace(*item))
|
||||
item++;
|
||||
value = strchr(item, ' ');
|
||||
if(!value) /* last char maybe a ';' but no white space after it */
|
||||
break;
|
||||
value++;
|
||||
value = strpbrk(item, " \t");
|
||||
while(isspace(*value))
|
||||
value++;
|
||||
cp = endpos = strchr(value, ';');
|
||||
while(isspace(*--cp))
|
||||
;
|
||||
memcpy(valbuf, value, cp - value + 1);
|
||||
valbuf[cp - value + 1] = '\0';
|
||||
value = valbuf;
|
||||
|
||||
if(!strncmp("WX ", item, 3) || !strncmp("W0X ", item, 4)) {
|
||||
if(charno >= 0 && charno <= 0xff)
|
||||
sscanf(value, "%f", &(afm->CharWidths[charno]));
|
||||
if(!strncmp(item, "C ", 2)) {
|
||||
value = strchr(item, ' ');
|
||||
sscanf(value, " %d", &metric->C);
|
||||
|
||||
} else if(!strncmp(item, "CH ", 3)) {
|
||||
value = strrchr(item, ' ');
|
||||
sscanf(value, " %x", &metric->C);
|
||||
}
|
||||
/* would carry on here to scan in BBox, name and ligs */
|
||||
|
||||
/* Carry on to find BBox (or actually just ascent) of Aring. This
|
||||
will provide something like the lfHeight value */
|
||||
else if(!strncmp("WX ", item, 3) || !strncmp("W0X ", item, 4)) {
|
||||
sscanf(value, "%f", &metric->WX);
|
||||
if(metric->C >= 0 && metric->C <= 0xff)
|
||||
afm->CharWidths[metric->C] = metric->WX;
|
||||
}
|
||||
|
||||
else if(!strncmp("N ", item, 2)) {
|
||||
name = value; /* may end in space */
|
||||
metric->N = HEAP_strdupA( PSDRV_Heap, 0, value);
|
||||
}
|
||||
|
||||
else if(!strncmp("B ", item, 2)) {
|
||||
if(name && !strncmp("Aring", name, 5)) {
|
||||
float llx, lly, urx, ury;
|
||||
llx = lly = urx = ury = 0.0;
|
||||
sscanf(value, "%f%f%f%f", &llx, &lly, &urx, &ury);
|
||||
afm->FullAscender = ury;
|
||||
}
|
||||
sscanf(value, "%f%f%f%f", &metric->B.llx, &metric->B.lly,
|
||||
&metric->B.urx, &metric->B.ury);
|
||||
|
||||
/* Store height of Aring to use as lfHeight */
|
||||
if(metric->N && !strncmp(metric->N, "Aring", 5))
|
||||
afm->FullAscender = metric->B.ury;
|
||||
}
|
||||
|
||||
/* Ligatures go here... */
|
||||
|
||||
curpos = endpos + 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
TRACE(psdrv, "Metrics for '%s' WX = %f B = %f,%f - %f,%f\n",
|
||||
metric->N, metric->WX, metric->B.llx, metric->B.lly,
|
||||
metric->B.urx, metric->B.ury);
|
||||
#endif
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -113,6 +128,8 @@ static AFM *PSDRV_AFMParse(char const *file)
|
|||
AFM *afm;
|
||||
char *cp;
|
||||
|
||||
TRACE(psdrv, "parsing '%s'\n", file);
|
||||
|
||||
if((fp = fopen(file, "r")) == NULL) {
|
||||
MSG("Can't open AFM file '%s'. Please check wine.conf .\n", file);
|
||||
return NULL;
|
||||
|
@ -133,7 +150,8 @@ static AFM *PSDRV_AFMParse(char const *file)
|
|||
|
||||
value = strchr(buf, ' ');
|
||||
if(value)
|
||||
value++;
|
||||
while(isspace(*value))
|
||||
value++;
|
||||
|
||||
if(!strncmp("FontName", buf, 8)) {
|
||||
afm->FontName = HEAP_strdupA(PSDRV_Heap, 0, value);
|
||||
|
@ -223,8 +241,10 @@ static AFM *PSDRV_AFMParse(char const *file)
|
|||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!strncmp("EncodingScheme", buf, 14)) {
|
||||
afm->EncodingScheme = HEAP_strdupA(PSDRV_Heap, 0, value);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
fclose(fp);
|
||||
|
@ -324,12 +344,49 @@ void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm)
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************
|
||||
*
|
||||
* PSDRV_ReencodeCharWidths
|
||||
*
|
||||
* Re map the CharWidths field of the afm to correspond to an ANSI encoding
|
||||
*
|
||||
*/
|
||||
static void PSDRV_ReencodeCharWidths(AFM *afm)
|
||||
{
|
||||
int i;
|
||||
AFMMETRICS *metric;
|
||||
|
||||
for(i = 0; i < 256; i++) {
|
||||
if(isalnum(i))
|
||||
continue;
|
||||
if(PSDRV_ANSIVector[i] == NULL) {
|
||||
afm->CharWidths[i] = 0.0;
|
||||
continue;
|
||||
}
|
||||
for(metric = afm->Metrics; metric; metric = metric->next) {
|
||||
if(!strcmp(metric->N, PSDRV_ANSIVector[i])) {
|
||||
afm->CharWidths[i] = metric->WX;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!metric) {
|
||||
WARN(psdrv, "Couldn't find glyph '%s' in font '%s'\n",
|
||||
PSDRV_ANSIVector[i], afm->FontName);
|
||||
afm->CharWidths[i] = 0.0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* PSDRV_afmfilesCallback
|
||||
*
|
||||
* Callback for PROFILE_EnumerateWineIniSection
|
||||
* Try to parse AFM file `value', alter the CharWidths field of afm struct if
|
||||
* the font is using AdobeStandardEncoding to correspond to WinANSI, then add
|
||||
* afm to system font list.
|
||||
*/
|
||||
static void PSDRV_afmfilesCallback(char const *key, char const *value,
|
||||
void *user)
|
||||
|
@ -337,8 +394,13 @@ void *user)
|
|||
AFM *afm;
|
||||
|
||||
afm = PSDRV_AFMParse(value);
|
||||
if(afm)
|
||||
if(afm) {
|
||||
if(afm->EncodingScheme &&
|
||||
!strcmp(afm->EncodingScheme, "AdobeStandardEncoding")) {
|
||||
PSDRV_ReencodeCharWidths(afm);
|
||||
}
|
||||
PSDRV_AddAFMtoList(&PSDRV_AFMFontList, afm);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* PostScript brush handling
|
||||
*
|
||||
* Copyright 1998 Huw D M Davies
|
||||
*
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "psdrv.h"
|
||||
#include "brush.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_BRUSH_SelectObject
|
||||
*/
|
||||
HBRUSH32 PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
|
||||
{
|
||||
HBRUSH32 prevbrush = dc->w.hBrush;
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
TRACE(psdrv, "hbrush = %08x\n", hbrush);
|
||||
dc->w.hBrush = hbrush;
|
||||
|
||||
switch(brush->logbrush.lbStyle) {
|
||||
|
||||
case BS_SOLID:
|
||||
physDev->brush.style = BS_SOLID;
|
||||
PSDRV_CreateColor(physDev, &physDev->brush.color,
|
||||
brush->logbrush.lbColor);
|
||||
break;
|
||||
|
||||
case BS_NULL:
|
||||
physDev->brush.style = BS_NULL;
|
||||
break;
|
||||
|
||||
case BS_HATCHED:
|
||||
case BS_PATTERN:
|
||||
FIXME(psdrv, "Unsupported brush style %d\n", brush->logbrush.lbStyle);
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME(psdrv, "Unrecognized brush style %d\n", brush->logbrush.lbStyle);
|
||||
break;
|
||||
}
|
||||
|
||||
physDev->brush.set = FALSE;
|
||||
return prevbrush;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* PSDRV_SetBrush
|
||||
*
|
||||
*/
|
||||
BOOL32 PSDRV_SetBrush(DC *dc)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
switch (physDev->brush.style) {
|
||||
case BS_SOLID:
|
||||
PSDRV_WriteSetColor(dc, &physDev->brush.color);
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
}
|
||||
physDev->brush.set = TRUE;
|
||||
return TRUE;
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* PostScript colour functions
|
||||
*
|
||||
* Copyright 1998 Huw D M Davies
|
||||
*
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "psdrv.h"
|
||||
#include "debug.h"
|
||||
|
||||
/**********************************************************************
|
||||
* PSDRV_CmpColor
|
||||
*
|
||||
* Return TRUE if col1 == col2
|
||||
*/
|
||||
BOOL32 PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2)
|
||||
{
|
||||
if(col1->type != col2->type)
|
||||
return FALSE;
|
||||
|
||||
switch(col1->type) {
|
||||
case PSCOLOR_GRAY:
|
||||
if(col1->value.gray.i == col2->value.gray.i)
|
||||
return TRUE;
|
||||
break;
|
||||
case PSCOLOR_RGB:
|
||||
if( col1->value.rgb.r == col2->value.rgb.r &&
|
||||
col1->value.rgb.g == col2->value.rgb.g &&
|
||||
col1->value.rgb.b == col2->value.rgb.b )
|
||||
return TRUE;
|
||||
break;
|
||||
default:
|
||||
ERR(psdrv, "Unknown colour type %d\n", col1->type);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* PSDRV_CopyColor
|
||||
*
|
||||
* Copies col2 into col1. Return FALSE on error.
|
||||
*/
|
||||
BOOL32 PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2)
|
||||
{
|
||||
|
||||
switch(col2->type) {
|
||||
case PSCOLOR_GRAY:
|
||||
col1->value.gray.i = col2->value.gray.i;
|
||||
break;
|
||||
|
||||
case PSCOLOR_RGB:
|
||||
col1->value.rgb.r = col2->value.rgb.r;
|
||||
col1->value.rgb.g = col2->value.rgb.g;
|
||||
col1->value.rgb.b = col2->value.rgb.b;
|
||||
break;
|
||||
|
||||
default:
|
||||
ERR(psdrv, "Unknown colour type %d\n", col1->type);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
col1->type = col2->type;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* PSDRV_CreateColor
|
||||
*
|
||||
* Creates a PostScript colour from a COLORREF.
|
||||
* Result is grey scale if ColorDevice field of ppd is FALSE else an
|
||||
* rgb colour is produced.
|
||||
*/
|
||||
void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
|
||||
COLORREF wincolor )
|
||||
{
|
||||
int ctype = wincolor >> 24;
|
||||
float r, g, b;
|
||||
|
||||
if(ctype != 0)
|
||||
FIXME(psdrv, "Colour is %08lx\n", wincolor);
|
||||
|
||||
r = (wincolor & 0xff) / 256.0;
|
||||
g = ((wincolor >> 8) & 0xff) / 256.0;
|
||||
b = ((wincolor >> 16) & 0xff) / 256.0;
|
||||
|
||||
if(physDev->pi->ppd->ColorDevice) {
|
||||
pscolor->type = PSCOLOR_RGB;
|
||||
pscolor->value.rgb.r = r;
|
||||
pscolor->value.rgb.g = g;
|
||||
pscolor->value.rgb.b = b;
|
||||
} else {
|
||||
pscolor->type = PSCOLOR_GRAY;
|
||||
/* FIXME configurable */
|
||||
pscolor->value.gray.i = r * 0.3 + g * 0.59 + b * 0.11;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SetBkColor
|
||||
*/
|
||||
COLORREF PSDRV_SetBkColor( DC *dc, COLORREF color )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->w.backgroundColor;
|
||||
dc->w.backgroundColor = color;
|
||||
|
||||
PSDRV_CreateColor(physDev, &physDev->bkColor, color);
|
||||
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_SetTextColor
|
||||
*/
|
||||
COLORREF PSDRV_SetTextColor( DC *dc, COLORREF color )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->w.textColor;
|
||||
dc->w.textColor = color;
|
||||
|
||||
PSDRV_CreateColor(physDev, &physDev->font.color, color);
|
||||
physDev->font.set = FALSE;
|
||||
return oldColor;
|
||||
}
|
||||
|
|
@ -9,13 +9,13 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <psdrv.h>
|
||||
#include <debug.h>
|
||||
#include <resource.h>
|
||||
#include <string.h>
|
||||
#include <win.h>
|
||||
#include <print.h>
|
||||
#include "windows.h"
|
||||
#include "psdrv.h"
|
||||
#include "debug.h"
|
||||
#include "resource.h"
|
||||
#include "win.h"
|
||||
#include "print.h"
|
||||
|
||||
static LONG Resolutions[][2] = { {600,600} };
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
|
|||
it = TRUE;
|
||||
if(lf->lfWeight > 550)
|
||||
bd = TRUE;
|
||||
lstrcpy32A(FaceName, lf->lfFaceName);
|
||||
strcpy(FaceName, lf->lfFaceName);
|
||||
|
||||
if(FaceName[0] == '\0') {
|
||||
switch(lf->lfPitchAndFamily & 0xf0) {
|
||||
|
@ -45,16 +45,16 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
|
|||
break;
|
||||
case FF_ROMAN:
|
||||
case FF_SCRIPT:
|
||||
lstrcpy32A(FaceName, "Times");
|
||||
strcpy(FaceName, "Times");
|
||||
break;
|
||||
case FF_SWISS:
|
||||
lstrcpy32A(FaceName, "Helvetica");
|
||||
strcpy(FaceName, "Helvetica");
|
||||
break;
|
||||
case FF_MODERN:
|
||||
lstrcpy32A(FaceName, "Courier");
|
||||
strcpy(FaceName, "Courier");
|
||||
break;
|
||||
case FF_DECORATIVE:
|
||||
lstrcpy32A(FaceName, "Symbol");
|
||||
strcpy(FaceName, "Symbol");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -62,23 +62,25 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
|
|||
if(FaceName[0] == '\0') {
|
||||
switch(lf->lfPitchAndFamily & 0x0f) {
|
||||
case VARIABLE_PITCH:
|
||||
lstrcpy32A(FaceName, "Times");
|
||||
strcpy(FaceName, "Times");
|
||||
break;
|
||||
default:
|
||||
lstrcpy32A(FaceName, "Courier");
|
||||
strcpy(FaceName, "Courier");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE(psdrv, "Trying to find facename '%s'\n", FaceName);
|
||||
|
||||
for(family = physDev->pi->Fonts; family; family = family->next) {
|
||||
if(!lstrncmp32A(FaceName, family->FamilyName,
|
||||
strlen(family->FamilyName)))
|
||||
if(!strcmp(FaceName, family->FamilyName))
|
||||
break;
|
||||
}
|
||||
if(!family)
|
||||
family = physDev->pi->Fonts;
|
||||
|
||||
|
||||
TRACE(psdrv, "Got family '%s'\n", family->FamilyName);
|
||||
|
||||
for(afmle = family->afmlist; afmle; afmle = afmle->next) {
|
||||
if( (bd == (afmle->afm->Weight == FW_BOLD)) &&
|
||||
(it == (afmle->afm->ItalicAngle != 0.0)) )
|
||||
|
@ -165,8 +167,8 @@ BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
|
|||
width = 0.0;
|
||||
|
||||
for(i = 0; i < count && str[i]; i++) {
|
||||
width += physDev->font.afm->CharWidths[ (UINT32)str[i] ];
|
||||
TRACE(psdrv, "Width after %dth char '%c' = %f\n", i, str[i], width);
|
||||
width += physDev->font.afm->CharWidths[ *((unsigned char *)str + i) ];
|
||||
/* TRACE(psdrv, "Width after %dth char '%c' = %f\n", i, str[i], width);*/
|
||||
}
|
||||
width *= physDev->font.scale;
|
||||
TRACE(psdrv, "Width after scale (%f) is %f\n", physDev->font.scale, width);
|
||||
|
@ -182,11 +184,17 @@ BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
|
|||
BOOL32 PSDRV_SetFont( DC *dc )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
BOOL32 ReEncode = FALSE;
|
||||
|
||||
PSDRV_WriteSetColor(dc, &physDev->font.color);
|
||||
if(physDev->font.set) return TRUE;
|
||||
|
||||
PSDRV_WriteReencodeFont(dc);
|
||||
PSDRV_WriteSetFont(dc);
|
||||
if(physDev->font.afm->EncodingScheme &&
|
||||
!strcmp(physDev->font.afm->EncodingScheme, "AdobeStandardEncoding"))
|
||||
ReEncode = TRUE;
|
||||
if(ReEncode)
|
||||
PSDRV_WriteReencodeFont(dc);
|
||||
PSDRV_WriteSetFont(dc, ReEncode);
|
||||
physDev->font.set = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -218,7 +226,7 @@ static UINT32 PSDRV_GetFontMetric(DC *dc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
|
|||
pTM->tmPitchAndFamily |= TMPF_DEVICE;
|
||||
plf->lfPitchAndFamily = 0;
|
||||
|
||||
lstrcpyn32A( plf->lfFaceName, pafm->FamilyName, LF_FACESIZE );
|
||||
strncpy( plf->lfFaceName, pafm->FamilyName, LF_FACESIZE );
|
||||
#undef plf
|
||||
|
||||
pTM->tmAscent = pafm->FullAscender * scale;
|
||||
|
@ -252,7 +260,7 @@ BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
|
|||
if( plf->lfFaceName[0] ) {
|
||||
TRACE(psdrv, "lfFaceName = '%s'\n", plf->lfFaceName);
|
||||
for(family = physDev->pi->Fonts; family; family = family->next) {
|
||||
if(!lstrncmp32A(plf->lfFaceName, family->FamilyName,
|
||||
if(!strncmp(plf->lfFaceName, family->FamilyName,
|
||||
strlen(family->FamilyName)))
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* Copyright 1998 Huw D M Davies
|
||||
*
|
||||
* Not much here yet...
|
||||
*/
|
||||
#include <string.h>
|
||||
#include "windows.h"
|
||||
|
@ -25,7 +24,7 @@ BOOL32 PSDRV_MoveToEx(DC *dc, INT32 x, INT32 y, LPPOINT32 pt)
|
|||
dc->w.CursPosX = x;
|
||||
dc->w.CursPosY = y;
|
||||
|
||||
return PSDRV_WriteMoveTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -35,6 +34,9 @@ BOOL32 PSDRV_LineTo(DC *dc, INT32 x, INT32 y)
|
|||
{
|
||||
TRACE(psdrv, "%d %d\n", x, y);
|
||||
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteMoveTo(dc, XLPTODP(dc, dc->w.CursPosX),
|
||||
YLPTODP(dc, dc->w.CursPosY));
|
||||
PSDRV_WriteLineTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
|
||||
PSDRV_WriteStroke(dc);
|
||||
|
||||
|
@ -56,7 +58,13 @@ BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,
|
|||
TRACE(psdrv, "%d %d - %d %d\n", left, top, right, bottom);
|
||||
|
||||
PSDRV_WriteRectangle(dc, XLPTODP(dc, left), YLPTODP(dc, top),
|
||||
width, height);
|
||||
width, height);
|
||||
|
||||
PSDRV_SetBrush(dc);
|
||||
PSDRV_Writegsave(dc);
|
||||
PSDRV_WriteFill(dc);
|
||||
PSDRV_Writegrestore(dc);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -65,10 +73,25 @@ BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,
|
|||
/***********************************************************************
|
||||
* PSDRV_Ellipse
|
||||
*/
|
||||
BOOL32 PSDRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom )
|
||||
BOOL32 PSDRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
|
||||
{
|
||||
INT32 x, y, a, b;
|
||||
|
||||
TRACE(psdrv, "%d %d - %d %d\n", left, top, right, bottom);
|
||||
|
||||
|
||||
x = XLPTODP(dc, (left + right)/2);
|
||||
y = YLPTODP(dc, (top + bottom)/2);
|
||||
|
||||
a = XLSTODS(dc, (right - left)/2);
|
||||
b = YLSTODS(dc, (bottom - top)/2);
|
||||
|
||||
PSDRV_WriteEllispe(dc, x, y, a, b);
|
||||
PSDRV_SetBrush(dc);
|
||||
PSDRV_Writegsave(dc);
|
||||
PSDRV_WriteFill(dc);
|
||||
PSDRV_Writegrestore(dc);
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteStroke(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -81,6 +104,7 @@ BOOL32 PSDRV_Polyline( DC *dc, const LPPOINT32 pt, INT32 count )
|
|||
INT32 i;
|
||||
TRACE(psdrv, "count = %d\n", count);
|
||||
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteMoveTo(dc, XLPTODP(dc, pt[0].x), YLPTODP(dc, pt[0].y));
|
||||
for(i = 1; i < count; i++)
|
||||
PSDRV_WriteLineTo(dc, XLPTODP(dc, pt[i].x), YLPTODP(dc, pt[i].y));
|
||||
|
@ -97,6 +121,8 @@ BOOL32 PSDRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count )
|
|||
INT32 i;
|
||||
TRACE(psdrv, "count = %d\n", count);
|
||||
FIXME(psdrv, "Hack!\n");
|
||||
|
||||
PSDRV_SetPen(dc);
|
||||
PSDRV_WriteMoveTo(dc, XLPTODP(dc, pt[0].x), YLPTODP(dc, pt[0].y));
|
||||
for(i = 1; i < count; i++)
|
||||
PSDRV_WriteLineTo(dc, XLPTODP(dc, pt[i].x), YLPTODP(dc, pt[i].y));
|
||||
|
@ -108,4 +134,3 @@ BOOL32 PSDRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <gdi.h>
|
||||
#include <psdrv.h>
|
||||
#include <debug.h>
|
||||
#include <heap.h>
|
||||
#include <winreg.h>
|
||||
#include <print.h>
|
||||
#include <winerror.h>
|
||||
#include "windows.h"
|
||||
#include "gdi.h"
|
||||
#include "psdrv.h"
|
||||
#include "debug.h"
|
||||
#include "heap.h"
|
||||
#include "winreg.h"
|
||||
#include "print.h"
|
||||
#include "winerror.h"
|
||||
|
||||
static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
||||
LPCSTR output, const DEVMODE16* initData );
|
||||
|
@ -62,7 +62,7 @@ static const DC_FUNCTIONS PSDRV_Funcs =
|
|||
NULL, /* pSelectClipRgn */
|
||||
PSDRV_SelectObject, /* pSelectObject */
|
||||
NULL, /* pSelectPalette */
|
||||
NULL, /* pSetBkColor */
|
||||
PSDRV_SetBkColor, /* pSetBkColor */
|
||||
NULL, /* pSetBkMode */
|
||||
NULL, /* pSetDeviceClipping */
|
||||
NULL, /* pSetDIBitsToDevice */
|
||||
|
@ -75,7 +75,7 @@ static const DC_FUNCTIONS PSDRV_Funcs =
|
|||
NULL, /* pSetStretchBltMode */
|
||||
NULL, /* pSetTextAlign */
|
||||
NULL, /* pSetTextCharacterExtra */
|
||||
NULL, /* pSetTextColor */
|
||||
PSDRV_SetTextColor, /* pSetTextColor */
|
||||
NULL, /* pSetTextJustification */
|
||||
NULL, /* pSetViewportExt (optional) */
|
||||
NULL, /* pSetViewportOrg (optional) */
|
||||
|
@ -202,6 +202,8 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|||
|
||||
TRACE(psdrv, "(%s %s %s %p)\n", driver, device, output, initData);
|
||||
|
||||
if(!pi) return FALSE;
|
||||
|
||||
if(!pi->Fonts) {
|
||||
MSG("To use WINEPS you need to install some AFM files.\n");
|
||||
return FALSE;
|
||||
|
@ -252,6 +254,13 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|||
physDev->pi->ppd->DefaultResolution;
|
||||
devCaps->aspectXY = (int)hypot( (double)devCaps->aspectX,
|
||||
(double)devCaps->aspectY );
|
||||
|
||||
if(physDev->pi->ppd->ColorDevice) {
|
||||
devCaps->bitsPixel = 8;
|
||||
devCaps->numColors = 256;
|
||||
/* FIXME are these values OK? */
|
||||
}
|
||||
|
||||
/* etc */
|
||||
|
||||
dc->w.devCaps = devCaps;
|
||||
|
@ -324,6 +333,14 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
|
|||
}
|
||||
|
||||
pi->ppd = PSDRV_ParsePPD(pi->Devmode->dmDrvPrivate.ppdFileName);
|
||||
if(!pi->ppd) {
|
||||
HeapFree(PSDRV_Heap, 0, pi->FriendlyName);
|
||||
HeapFree(PSDRV_Heap, 0, pi->Devmode);
|
||||
HeapFree(PSDRV_Heap, 0, pi);
|
||||
*last = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pi->next = NULL;
|
||||
pi->Fonts = NULL;
|
||||
|
||||
|
|
|
@ -24,27 +24,6 @@ static HBITMAP16 PSDRV_BITMAP_SelectObject( DC * dc, HBITMAP16 hbitmap,
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* 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
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* PostScript pen handling
|
||||
*
|
||||
* Copyright 1998 Huw D M Davies
|
||||
*
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "pen.h"
|
||||
#include "psdrv.h"
|
||||
#include "debug.h"
|
||||
|
||||
static char PEN_dash[] = "50 30"; /* ----- ----- ----- */
|
||||
static char PEN_dot[] = "20"; /* -- -- -- -- -- -- */
|
||||
static char PEN_dashdot[] = "40 30 20 30"; /* ---- -- ---- -- */
|
||||
static char PEN_dashdotdot[] = "40 20 20 20 20 20"; /* ---- -- -- ---- */
|
||||
static char PEN_alternate[] = "1";
|
||||
|
||||
/***********************************************************************
|
||||
* PSDRV_PEN_SelectObject
|
||||
*/
|
||||
extern HPEN32 PSDRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
|
||||
{
|
||||
HPEN32 prevpen = dc->w.hPen;
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
TRACE(psdrv, "hpen = %08x colour = %08lx\n", hpen, pen->logpen.lopnColor);
|
||||
dc->w.hPen = hpen;
|
||||
|
||||
physDev->pen.width = XLSTODS(dc, pen->logpen.lopnWidth.x);
|
||||
if(physDev->pen.width < 0)
|
||||
physDev->pen.width = -physDev->pen.width;
|
||||
|
||||
PSDRV_CreateColor(physDev, &physDev->pen.color, pen->logpen.lopnColor);
|
||||
|
||||
if(physDev->pen.width > 1) { /* dashes only for 0 or 1 pixel pens */
|
||||
physDev->pen.dash = NULL;
|
||||
} else {
|
||||
switch(pen->logpen.lopnStyle & PS_STYLE_MASK) {
|
||||
case PS_DASH:
|
||||
physDev->pen.dash = PEN_dash;
|
||||
break;
|
||||
|
||||
case PS_DOT:
|
||||
physDev->pen.dash = PEN_dot;
|
||||
break;
|
||||
|
||||
case PS_DASHDOT:
|
||||
physDev->pen.dash = PEN_dashdot;
|
||||
break;
|
||||
|
||||
case PS_DASHDOTDOT:
|
||||
physDev->pen.dash = PEN_dashdotdot;
|
||||
break;
|
||||
|
||||
case PS_ALTERNATE:
|
||||
physDev->pen.dash = PEN_alternate;
|
||||
break;
|
||||
|
||||
default:
|
||||
physDev->pen.dash = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
physDev->pen.set = FALSE;
|
||||
return prevpen;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* PSDRV_SetPen
|
||||
*
|
||||
*/
|
||||
BOOL32 PSDRV_SetPen(DC *dc)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
||||
PSDRV_WriteSetColor(dc, &physDev->pen.color);
|
||||
|
||||
if(!physDev->pen.set) {
|
||||
PSDRV_WriteSetPen(dc);
|
||||
physDev->pen.set = TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -5,14 +5,14 @@
|
|||
* Copyright 1998 Huw D M Davies
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <winnt.h> /* HEAP_ZERO_MEMORY */
|
||||
#include <heap.h>
|
||||
#include <debug.h>
|
||||
#include <psdrv.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <print.h>
|
||||
#include "windows.h"
|
||||
#include "winnt.h" /* HEAP_ZERO_MEMORY */
|
||||
#include "heap.h"
|
||||
#include "debug.h"
|
||||
#include "psdrv.h"
|
||||
#include "print.h"
|
||||
|
||||
typedef struct {
|
||||
char *key;
|
||||
|
@ -400,8 +400,10 @@ PPD *PSDRV_ParsePPD(char *fname)
|
|||
|
||||
TRACE(psdrv, "%s\n", fname);
|
||||
|
||||
if((fp = fopen(fname, "r")) == NULL)
|
||||
if((fp = fopen(fname, "r")) == NULL) {
|
||||
WARN(psdrv, "Couldn't open ppd file '%s'\n", fname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ppd = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(*ppd));
|
||||
if(!ppd) {
|
||||
|
@ -551,7 +553,7 @@ PPD *PSDRV_ParsePPD(char *fname)
|
|||
if(!strcmp(tuple.value, "Plus90"))
|
||||
ppd->LandscapeOrientation = 90;
|
||||
else if(!strcmp(tuple.value, "Minus90"))
|
||||
ppd->LandscapeOrientation = 270;
|
||||
ppd->LandscapeOrientation = -90;
|
||||
|
||||
/* anything else, namely 'any', leaves value at 0 */
|
||||
|
||||
|
|
|
@ -5,92 +5,197 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <psdrv.h>
|
||||
#include <print.h>
|
||||
#include <debug.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "windows.h"
|
||||
#include "psdrv.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
|
||||
char psheader[] = /* title llx lly urx ury */
|
||||
"%%!PS-Adobe-3.0 (not quite)\n"
|
||||
static char psheader[] = /* title llx lly urx ury orientation */
|
||||
"%%!PS-Adobe-3.0\n"
|
||||
"%%%%Creator: Wine PostScript Driver\n"
|
||||
"%%%%Title: %s\n"
|
||||
"%%%%BoundingBox: %d %d %d %d\n"
|
||||
"%%%%Pages: (atend)\n"
|
||||
"%%%%EndComments\n"
|
||||
"%%%%BeginProlog\n"
|
||||
"%%%%Orientation: %s\n"
|
||||
"%%%%EndComments\n";
|
||||
|
||||
static char psbeginprolog[] =
|
||||
"%%BeginProlog\n";
|
||||
|
||||
static char psendprolog[] =
|
||||
"%%EndProlog\n";
|
||||
|
||||
static char psvectorstart[] =
|
||||
"/ANSIEncoding [\n";
|
||||
|
||||
static char psvectorend[] =
|
||||
"] def\n";
|
||||
|
||||
static char psprolog[] = /* output ANSIEncoding vector first */
|
||||
"/reencodefont {\n"
|
||||
"findfont\n"
|
||||
"dup length dict begin\n"
|
||||
"{1 index /FID ne {def} {pop pop} ifelse} forall\n"
|
||||
"/Encoding ISOLatin1Encoding def\n"
|
||||
"/Encoding ANSIEncoding def\n"
|
||||
"currentdict\n"
|
||||
"end\n"
|
||||
"definefont pop\n"
|
||||
"} bind def\n"
|
||||
"%%%%EndProlog\n";
|
||||
"/tmpmtrx matrix def\n";
|
||||
|
||||
char psbeginsetup[] =
|
||||
static char psbeginsetup[] =
|
||||
"%%BeginSetup\n";
|
||||
|
||||
char psendsetup[] =
|
||||
static char psendsetup[] =
|
||||
"%%EndSetup\n";
|
||||
|
||||
char psbeginfeature[] = /* feature, value */
|
||||
static char psbeginfeature[] = /* feature, value */
|
||||
"mark {\n"
|
||||
"%%%%BeginFeature: %s %s\n";
|
||||
|
||||
char psendfeature[] =
|
||||
static char psendfeature[] =
|
||||
"\n%%EndFeature\n"
|
||||
"} stopped cleartomark\n";
|
||||
|
||||
char psnewpage[] = /* name, number */
|
||||
static char psnewpage[] = /* name, number, xres, yres, xtrans, ytrans, rot */
|
||||
"%%%%Page: %s %d\n"
|
||||
"%%%%BeginPageSetup\n"
|
||||
"/pgsave save def\n"
|
||||
"72 600 div dup scale\n"
|
||||
"0 7014 translate\n"
|
||||
"72 %d div 72 %d div scale\n"
|
||||
"%d %d translate\n"
|
||||
"1 -1 scale\n"
|
||||
"%d rotate\n"
|
||||
"%%%%EndPageSetup\n";
|
||||
|
||||
char psendpage[] =
|
||||
static char psendpage[] =
|
||||
"pgsave restore\n"
|
||||
"showpage\n";
|
||||
|
||||
char psfooter[] = /* pages */
|
||||
static char psfooter[] = /* pages */
|
||||
"%%%%Trailer\n"
|
||||
"%%%%Pages: %d\n"
|
||||
"%%%%EOF\n";
|
||||
|
||||
char psmoveto[] = /* x, y */
|
||||
static char psmoveto[] = /* x, y */
|
||||
"%d %d moveto\n";
|
||||
|
||||
char pslineto[] = /* x, y */
|
||||
static char pslineto[] = /* x, y */
|
||||
"%d %d lineto\n";
|
||||
|
||||
char psrlineto[] = /* dx, dy */
|
||||
"%d %d rlineto\n";
|
||||
|
||||
char psstroke[] =
|
||||
static char psstroke[] =
|
||||
"stroke\n";
|
||||
|
||||
char psrectangle[] = /* x, y, width, height, -width */
|
||||
static 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 */
|
||||
static char psshow[] = /* string */
|
||||
"(%s) show\n";
|
||||
|
||||
char pssetfont[] = /* fontname, xscale, yscale, ascent, escapement */
|
||||
static char pssetfont[] = /* fontname, xscale, yscale, ascent, escapement */
|
||||
"/%s findfont\n"
|
||||
"[%d 0 0 %d 0 0]\n"
|
||||
"%d 10 div matrix rotate\n"
|
||||
"matrix concatmatrix\n"
|
||||
"makefont setfont\n";
|
||||
|
||||
static char pssetlinewidth[] = /* width */
|
||||
"%d setlinewidth\n";
|
||||
|
||||
static char pssetdash[] = /* dash, offset */
|
||||
"[%s] %d setdash\n";
|
||||
|
||||
static char pssetgray[] = /* gray */
|
||||
"%.2f setgray\n";
|
||||
|
||||
static char pssetrgbcolor[] = /* r, g, b */
|
||||
"%.2f %.2f %.2f setrgbcolor\n";
|
||||
|
||||
static char psellipse[] = /* x, y, a, b */
|
||||
"tmpmtrx currentmatrix pop\n"
|
||||
"%d %d translate\n"
|
||||
"%d %d scale\n"
|
||||
"0 0 1 0 360 arc\n"
|
||||
"tmpmtrx setmatrix\n";
|
||||
|
||||
static char psgsave[] =
|
||||
"gsave\n";
|
||||
|
||||
static char psgrestore[] =
|
||||
"grestore\n";
|
||||
|
||||
static char psfill[] =
|
||||
"fill\n";
|
||||
|
||||
char *PSDRV_ANSIVector[256] = {
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
"space", "exclam", "quotedbl", "numbersign",
|
||||
"dollar", "percent", "ampersand", "quotesingle",
|
||||
"parenleft", "parenright", "asterisk", "plus",
|
||||
"comma", "hyphen", "period", "slash",
|
||||
"zero", "one", "two", "three",
|
||||
"four", "five", "six", "seven",
|
||||
"eight", "nine", "colon", "semicolon",
|
||||
"less", "equal", "greater", "question",
|
||||
"at", "A", "B", "C",
|
||||
"D", "E", "F", "G",
|
||||
"H", "I", "J", "K",
|
||||
"L", "M", "N", "O",
|
||||
"P", "Q", "R", "S",
|
||||
"T", "U", "V", "W",
|
||||
"X", "Y", "Z", "bracketleft",
|
||||
"backslash", "bracketright", "asciicircum", "underscore",
|
||||
"grave", "a", "b", "c",
|
||||
"d", "e", "f", "g",
|
||||
"h", "i", "j", "k",
|
||||
"l", "m", "n", "o",
|
||||
"p", "q", "r", "s",
|
||||
"t", "u", "v", "w",
|
||||
"x", "y", "z", "braceleft",
|
||||
"bar", "braceright", "asciitilde", NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, "quoteleft", "quoteright", NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
NULL, "exclamdown", "cent", "sterling",
|
||||
"currency", "yen", "brokenbar", "section",
|
||||
"dieresis", "copyright", "ordfeminine", "guillemotleft",
|
||||
"logicalnot", "hyphen", "registered", "macron",
|
||||
"degree", "plusminus", "twosuperior", "threesuperior",
|
||||
"acute", "mu", "paragraph", "periodcentered",
|
||||
"cedilla", "onesuperior", "ordmasculine", "guillemotright",
|
||||
"onequarter", "onehalf", "threequarters","questiondown",
|
||||
"Agrave", "Aacute", "Acircumflex", "Atilde",
|
||||
"Adieresis", "Aring", "AE", "Ccedilla",
|
||||
"Egrave", "Eacute", "Ecircumflex", "Edieresis",
|
||||
"Igrave", "Iacute", "Icircumflex", "Idieresis",
|
||||
"Eth", "Ntilde", "Ograve", "Oacute",
|
||||
"Ocircumflex", "Otilde", "Odieresis", "multiply",
|
||||
"Oslash", "Ugrave", "Uacute", "Ucircumflex",
|
||||
"Udieresis", "Yacute", "Thorn", "germandbls",
|
||||
"agrave", "aacute", "acircumflex", "atilde",
|
||||
"adieresis", "aring", "ae", "ccedilla",
|
||||
"egrave", "eacute", "ecircumflex", "edieresis",
|
||||
"igrave", "iacute", "icircumflex", "idieresis",
|
||||
"eth", "ntilde", "ograve", "oacute",
|
||||
"ocircumflex", "otilde", "odieresis", "divide",
|
||||
"oslash", "ugrave", "uacute", "ucircumflex",
|
||||
"udieresis", "yacute", "thorn", "ydieresis"
|
||||
};
|
||||
|
||||
|
||||
char psreencodefont[] = /* newfontname basefontname*/
|
||||
"/%s /%s reencodefont\n";
|
||||
|
||||
|
@ -117,7 +222,7 @@ INT32 PSDRV_WriteFeature(HANDLE16 hJob, char *feature, char *value,
|
|||
strlen(feature) + strlen(value));
|
||||
|
||||
|
||||
wsprintf32A(buf, psbeginfeature, feature, value);
|
||||
sprintf(buf, psbeginfeature, feature, value);
|
||||
WriteSpool( hJob, buf, strlen(buf) );
|
||||
|
||||
WriteSpool( hJob, invocation, strlen(invocation) );
|
||||
|
@ -133,9 +238,10 @@ INT32 PSDRV_WriteFeature(HANDLE16 hJob, char *feature, char *value,
|
|||
INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char *buf, *titlebuf;
|
||||
char *buf, *titlebuf, *orient, vectbuf[256];
|
||||
INPUTSLOT *slot;
|
||||
PAGESIZE *page;
|
||||
int urx, ury, i, j;
|
||||
|
||||
titlebuf = (char *)HeapAlloc( PSDRV_Heap, 0, len+1 );
|
||||
if(!titlebuf) {
|
||||
|
@ -145,16 +251,28 @@ INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
|
|||
memcpy(titlebuf, title, len);
|
||||
titlebuf[len] = '\0';
|
||||
|
||||
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psheader) + len + 20);
|
||||
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psheader) + len + 30);
|
||||
if(!buf) {
|
||||
WARN(psdrv, "HeapAlloc failed\n");
|
||||
HeapFree( PSDRV_Heap, 0, titlebuf );
|
||||
return 0;
|
||||
}
|
||||
|
||||
wsprintf32A(buf, psheader, title, 0, 0,
|
||||
(int) (dc->w.devCaps->horzSize * 72.0 / 25.4),
|
||||
(int) (dc->w.devCaps->vertSize * 72.0 / 25.4) );
|
||||
if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_LANDSCAPE) {
|
||||
/* BBox co-ords are in default user co-ord system so urx < ury even in
|
||||
landscape mode */
|
||||
urx = (int) (dc->w.devCaps->vertSize * 72.0 / 25.4);
|
||||
ury = (int) (dc->w.devCaps->horzSize * 72.0 / 25.4);
|
||||
orient = "Landscape";
|
||||
} else {
|
||||
urx = (int) (dc->w.devCaps->horzSize * 72.0 / 25.4);
|
||||
ury = (int) (dc->w.devCaps->vertSize * 72.0 / 25.4);
|
||||
orient = "Portrait";
|
||||
}
|
||||
|
||||
/* FIXME should do something better with BBox */
|
||||
|
||||
sprintf(buf, psheader, title, 0, 0, urx, ury, orient);
|
||||
|
||||
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
|
||||
strlen(buf) ) {
|
||||
|
@ -166,6 +284,28 @@ INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
|
|||
HeapFree( PSDRV_Heap, 0, titlebuf );
|
||||
HeapFree( PSDRV_Heap, 0, buf );
|
||||
|
||||
WriteSpool( physDev->job.hJob, psbeginprolog, strlen(psbeginprolog) );
|
||||
WriteSpool( physDev->job.hJob, psvectorstart, strlen(psvectorstart) );
|
||||
|
||||
for(i = 0; i < 256; i += 8) {
|
||||
vectbuf[0] = '\0';
|
||||
for(j = 0; j < 8; j++) {
|
||||
strcat(vectbuf, "/");
|
||||
if(PSDRV_ANSIVector[i+j]) {
|
||||
strcat(vectbuf, PSDRV_ANSIVector[i+j]);
|
||||
strcat(vectbuf, " ");
|
||||
} else {
|
||||
strcat(vectbuf, ".notdef ");
|
||||
}
|
||||
}
|
||||
strcat(vectbuf, "\n");
|
||||
WriteSpool( physDev->job.hJob, vectbuf, strlen(vectbuf) );
|
||||
}
|
||||
|
||||
WriteSpool( physDev->job.hJob, psvectorend, strlen(psvectorend) );
|
||||
WriteSpool( physDev->job.hJob, psprolog, strlen(psprolog) );
|
||||
WriteSpool( physDev->job.hJob, psendprolog, strlen(psendprolog) );
|
||||
|
||||
|
||||
WriteSpool( physDev->job.hJob, psbeginsetup, strlen(psbeginsetup) );
|
||||
|
||||
|
@ -189,7 +329,6 @@ INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
WriteSpool( physDev->job.hJob, psendsetup, strlen(psendsetup) );
|
||||
|
||||
|
||||
|
@ -208,7 +347,7 @@ INT32 PSDRV_WriteFooter( DC *dc )
|
|||
return 0;
|
||||
}
|
||||
|
||||
wsprintf32A(buf, psfooter, physDev->job.PageNo);
|
||||
sprintf(buf, psfooter, physDev->job.PageNo);
|
||||
|
||||
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
|
||||
strlen(buf) ) {
|
||||
|
@ -242,16 +381,35 @@ INT32 PSDRV_WriteNewPage( DC *dc )
|
|||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char *buf;
|
||||
char name[100];
|
||||
|
||||
wsprintf32A(name, "%d", physDev->job.PageNo);
|
||||
signed int xtrans, ytrans, rotation;
|
||||
|
||||
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psnewpage) + 100 );
|
||||
sprintf(name, "%d", physDev->job.PageNo);
|
||||
|
||||
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psnewpage) + 200 );
|
||||
if(!buf) {
|
||||
WARN(psdrv, "HeapAlloc failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
wsprintf32A(buf, psnewpage, name, physDev->job.PageNo);
|
||||
if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_LANDSCAPE) {
|
||||
if(physDev->pi->ppd->LandscapeOrientation == -90) {
|
||||
xtrans = dc->w.devCaps->vertRes;
|
||||
ytrans = dc->w.devCaps->horzRes;
|
||||
rotation = 90;
|
||||
} else {
|
||||
xtrans = ytrans = 0;
|
||||
rotation = -90;
|
||||
}
|
||||
} else {
|
||||
xtrans = 0;
|
||||
ytrans = dc->w.devCaps->vertRes;
|
||||
rotation = 0;
|
||||
}
|
||||
|
||||
sprintf(buf, psnewpage, name, physDev->job.PageNo,
|
||||
dc->w.devCaps->logPixelsX, dc->w.devCaps->logPixelsY,
|
||||
xtrans, ytrans, rotation);
|
||||
|
||||
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
|
||||
strlen(buf) ) {
|
||||
WARN(psdrv, "WriteSpool error\n");
|
||||
|
@ -267,7 +425,7 @@ BOOL32 PSDRV_WriteMoveTo(DC *dc, INT32 x, INT32 y)
|
|||
{
|
||||
char buf[100];
|
||||
|
||||
wsprintf32A(buf, psmoveto, x, y);
|
||||
sprintf(buf, psmoveto, x, y);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
|
@ -275,7 +433,7 @@ BOOL32 PSDRV_WriteLineTo(DC *dc, INT32 x, INT32 y)
|
|||
{
|
||||
char buf[100];
|
||||
|
||||
wsprintf32A(buf, pslineto, x, y);
|
||||
sprintf(buf, pslineto, x, y);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
|
@ -292,13 +450,21 @@ BOOL32 PSDRV_WriteRectangle(DC *dc, INT32 x, INT32 y, INT32 width,
|
|||
{
|
||||
char buf[100];
|
||||
|
||||
wsprintf32A(buf, psrectangle, x, y, width, height, -width);
|
||||
sprintf(buf, psrectangle, x, y, width, height, -width);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
static char encodingext[] = "-ISOLatin1";
|
||||
BOOL32 PSDRV_WriteEllispe(DC *dc, INT32 x, INT32 y, INT32 a, INT32 b)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
BOOL32 PSDRV_WriteSetFont(DC *dc)
|
||||
sprintf(buf, psellipse, x, y, a, b);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
static char encodingext[] = "-ANSI";
|
||||
|
||||
BOOL32 PSDRV_WriteSetFont(DC *dc, BOOL32 UseANSI)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char *buf, *newbuf;
|
||||
|
@ -320,9 +486,12 @@ BOOL32 PSDRV_WriteSetFont(DC *dc)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
wsprintf32A(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
|
||||
if(UseANSI)
|
||||
sprintf(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
|
||||
else
|
||||
strcpy(newbuf, physDev->font.afm->FontName);
|
||||
|
||||
wsprintf32A(buf, pssetfont, newbuf,
|
||||
sprintf(buf, pssetfont, newbuf,
|
||||
physDev->font.size, -physDev->font.size,
|
||||
-physDev->font.escapement);
|
||||
|
||||
|
@ -331,6 +500,49 @@ BOOL32 PSDRV_WriteSetFont(DC *dc)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL32 PSDRV_WriteSetColor(DC *dc, PSCOLOR *color)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char buf[256];
|
||||
|
||||
if(PSDRV_CmpColor(&physDev->inkColor, color))
|
||||
return TRUE;
|
||||
|
||||
PSDRV_CopyColor(&physDev->inkColor, color);
|
||||
switch(color->type) {
|
||||
case PSCOLOR_RGB:
|
||||
sprintf(buf, pssetrgbcolor, color->value.rgb.r, color->value.rgb.g,
|
||||
color->value.rgb.b);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
|
||||
case PSCOLOR_GRAY:
|
||||
sprintf(buf, pssetgray, color->value.gray.i);
|
||||
return PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
|
||||
default:
|
||||
ERR(psdrv, "Unkonwn colour type %d\n", color->type);
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL32 PSDRV_WriteSetPen(DC *dc)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
char buf[256];
|
||||
|
||||
sprintf(buf, pssetlinewidth, physDev->pen.width);
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
|
||||
if(physDev->pen.dash) {
|
||||
sprintf(buf, pssetdash, physDev->pen.dash, 0);
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL32 PSDRV_WriteReencodeFont(DC *dc)
|
||||
{
|
||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||
|
@ -354,8 +566,8 @@ BOOL32 PSDRV_WriteReencodeFont(DC *dc)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
wsprintf32A(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
|
||||
wsprintf32A(buf, psreencodefont, newbuf, physDev->font.afm->FontName);
|
||||
sprintf(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
|
||||
sprintf(buf, psreencodefont, newbuf, physDev->font.afm->FontName);
|
||||
|
||||
PSDRV_WriteSpool(dc, buf, strlen(buf));
|
||||
|
||||
|
@ -392,7 +604,7 @@ BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count)
|
|||
|
||||
buf1 = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psshow) + done);
|
||||
|
||||
wsprintf32A(buf1, psshow, buf);
|
||||
sprintf(buf1, psshow, buf);
|
||||
|
||||
PSDRV_WriteSpool(dc, buf1, strlen(buf1));
|
||||
HeapFree(PSDRV_Heap, 0, buf);
|
||||
|
@ -401,6 +613,21 @@ BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL32 PSDRV_WriteFill(DC *dc)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psfill, sizeof(psfill)-1);
|
||||
}
|
||||
|
||||
BOOL32 PSDRV_Writegsave(DC *dc)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psgsave, sizeof(psgsave)-1);
|
||||
}
|
||||
|
||||
BOOL32 PSDRV_Writegrestore(DC *dc)
|
||||
{
|
||||
return PSDRV_WriteSpool(dc, psgrestore, sizeof(psgrestore)-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -660,9 +660,8 @@ int WINAPI WriteSpool(HANDLE16 hJob, LPSTR lpData, WORD cch)
|
|||
nRet = cch;
|
||||
if (pPrintJob->hDC == 0) {
|
||||
ERR(print, "hDC == 0 !\n");
|
||||
return SP_ERROR;
|
||||
}
|
||||
if (!(QueryAbort(pPrintJob->hDC, (nRet == SP_OUTOFDISK) ? nRet : 0 )))
|
||||
else if (!(QueryAbort(pPrintJob->hDC, (nRet == SP_OUTOFDISK) ? nRet : 0 )))
|
||||
{
|
||||
CloseJob(hJob); /* printing aborted */
|
||||
nRet = SP_APPABORT;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* WingG support
|
||||
* WinG support
|
||||
*
|
||||
* Started by Robert Pouliot <krynos@clic.net>
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@ static void __initWinG(void)
|
|||
return;
|
||||
}
|
||||
}
|
||||
FIXME(wing,"WinG: no joy.\n");
|
||||
FIXME(wing,"WinG: incorrect depth or unsupported card.\n");
|
||||
__WinGOK = False;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -837,8 +837,9 @@ static void BITBLT_GetSrcAreaStretch( DC *dcSrc, DC *dcDst,
|
|||
rectDst.bottom - rectDst.top, dcDst->w.bitsPerPixel );
|
||||
BITBLT_StretchImage( imageSrc, imageDst, widthSrc, heightSrc,
|
||||
widthDst, heightDst, &rectSrc, &rectDst,
|
||||
dcDst->w.textPixel, dcDst->w.bitsPerPixel != 1 ?
|
||||
dcDst->w.backgroundPixel : dcSrc->w.backgroundPixel,
|
||||
dcDst->u.x.textPixel, dcDst->w.bitsPerPixel != 1 ?
|
||||
dcDst->u.x.backgroundPixel :
|
||||
dcSrc->u.x.backgroundPixel,
|
||||
dcDst->w.stretchBltMode );
|
||||
XPutImage( display, pixmap, gc, imageDst, 0, 0, 0, 0,
|
||||
rectDst.right - rectDst.left, rectDst.bottom - rectDst.top );
|
||||
|
@ -900,14 +901,14 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
|
|||
if (COLOR_PixelToPalette)
|
||||
{
|
||||
XSetBackground( display, gc,
|
||||
COLOR_PixelToPalette[dcDst->w.textPixel] );
|
||||
COLOR_PixelToPalette[dcDst->u.x.textPixel] );
|
||||
XSetForeground( display, gc,
|
||||
COLOR_PixelToPalette[dcDst->w.backgroundPixel]);
|
||||
COLOR_PixelToPalette[dcDst->u.x.backgroundPixel]);
|
||||
}
|
||||
else
|
||||
{
|
||||
XSetBackground( display, gc, dcDst->w.textPixel );
|
||||
XSetForeground( display, gc, dcDst->w.backgroundPixel );
|
||||
XSetBackground( display, gc, dcDst->u.x.textPixel );
|
||||
XSetForeground( display, gc, dcDst->u.x.backgroundPixel );
|
||||
}
|
||||
XCopyPlane( display, dcSrc->u.x.drawable, pixmap, gc,
|
||||
visRectSrc->left, visRectSrc->top,
|
||||
|
@ -923,7 +924,7 @@ static void BITBLT_GetSrcArea( DC *dcSrc, DC *dcDst, Pixmap pixmap, GC gc,
|
|||
for (y = 0; y < height; y++)
|
||||
for (x = 0; x < width; x++)
|
||||
XPutPixel(imageDst, x, y, (XGetPixel(imageSrc,x,y) ==
|
||||
dcSrc->w.backgroundPixel) );
|
||||
dcSrc->u.x.backgroundPixel) );
|
||||
XPutImage( display, pixmap, gc, imageDst,
|
||||
0, 0, 0, 0, width, height );
|
||||
XDestroyImage( imageSrc );
|
||||
|
@ -1239,8 +1240,8 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
|
|||
}
|
||||
if (dcSrc->w.bitsPerPixel == 1)
|
||||
{
|
||||
XSetBackground( display, dcDst->u.x.gc, dcDst->w.textPixel );
|
||||
XSetForeground( display, dcDst->u.x.gc, dcDst->w.backgroundPixel );
|
||||
XSetBackground( display, dcDst->u.x.gc, dcDst->u.x.textPixel );
|
||||
XSetForeground( display, dcDst->u.x.gc, dcDst->u.x.backgroundPixel );
|
||||
XSetFunction( display, dcDst->u.x.gc, GXcopy );
|
||||
XSetGraphicsExposures( display, dcDst->u.x.gc, True );
|
||||
XCopyPlane( display, dcSrc->u.x.drawable,
|
||||
|
|
|
@ -1099,3 +1099,37 @@ X11DRV_PolyBezier(DC *dc, POINT32 start, POINT32 *BezierPoints, DWORD count)
|
|||
free(xpoints);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* X11DRV_SetBkColor
|
||||
*/
|
||||
COLORREF
|
||||
X11DRV_SetBkColor( DC *dc, COLORREF color )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->w.backgroundColor;
|
||||
dc->w.backgroundColor = color;
|
||||
|
||||
physDev->backgroundPixel = COLOR_ToPhysical( dc, color );
|
||||
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* X11DRV_SetTextColor
|
||||
*/
|
||||
COLORREF
|
||||
X11DRV_SetTextColor( DC *dc, COLORREF color )
|
||||
{
|
||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||
COLORREF oldColor;
|
||||
|
||||
oldColor = dc->w.textColor;
|
||||
dc->w.textColor = color;
|
||||
|
||||
physDev->textPixel = COLOR_ToPhysical( dc, color );
|
||||
|
||||
return oldColor;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ static const DC_FUNCTIONS X11DRV_Funcs =
|
|||
NULL, /* pSelectClipRgn */
|
||||
X11DRV_SelectObject, /* pSelectObject */
|
||||
NULL, /* pSelectPalette */
|
||||
NULL, /* pSetBkColor */
|
||||
X11DRV_SetBkColor, /* pSetBkColor */
|
||||
NULL, /* pSetBkMode */
|
||||
X11DRV_SetDeviceClipping, /* pSetDeviceClipping */
|
||||
NULL, /* pSetDIBitsToDevice */
|
||||
|
@ -74,7 +74,7 @@ static const DC_FUNCTIONS X11DRV_Funcs =
|
|||
NULL, /* pSetStretchBltMode */
|
||||
NULL, /* pSetTextAlign */
|
||||
NULL, /* pSetTextCharacterExtra */
|
||||
NULL, /* pSetTextColor */
|
||||
X11DRV_SetTextColor, /* pSetTextColor */
|
||||
NULL, /* pSetTextJustification */
|
||||
NULL, /* pSetViewportExt (optional) */
|
||||
NULL, /* pSetViewportOrg (optional) */
|
||||
|
|
|
@ -103,7 +103,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
|
|||
|
||||
if (flags & ETO_OPAQUE)
|
||||
{
|
||||
TSXSetForeground( display, dc->u.x.gc, dc->w.backgroundPixel );
|
||||
TSXSetForeground( display, dc->u.x.gc, dc->u.x.backgroundPixel );
|
||||
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
|
||||
dc->w.DCOrgX + rect.left, dc->w.DCOrgY + rect.top,
|
||||
rect.right-rect.left, rect.bottom-rect.top );
|
||||
|
@ -196,7 +196,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
|
|||
(y - ascent < rect.top) ||
|
||||
(y + descent >= rect.bottom))
|
||||
{
|
||||
TSXSetForeground( display, dc->u.x.gc, dc->w.backgroundPixel );
|
||||
TSXSetForeground( display, dc->u.x.gc, dc->u.x.backgroundPixel );
|
||||
TSXFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
|
||||
dc->w.DCOrgX + x,
|
||||
dc->w.DCOrgY + y - ascent,
|
||||
|
@ -208,7 +208,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
|
|||
|
||||
/* Draw the text (count > 0 verified) */
|
||||
|
||||
TSXSetForeground( display, dc->u.x.gc, dc->w.textPixel );
|
||||
TSXSetForeground( display, dc->u.x.gc, dc->u.x.textPixel );
|
||||
if (!dc->w.charExtra && !dc->w.breakExtra && !lpDx)
|
||||
{
|
||||
if(!rotated)
|
||||
|
|
|
@ -7,7 +7,7 @@ type win16
|
|||
4 pascal CoGetMalloc(long ptr) CoGetMalloc16
|
||||
5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16
|
||||
6 stub COREVOKECLASSOBJECT
|
||||
7 stub COGETCLASSOBJECT
|
||||
7 pascal CoGetClassObject(ptr long ptr ptr ptr) CoGetClassObject
|
||||
8 stub COMARSHALINTERFACE
|
||||
9 stub COUNMARSHALINTERFACE
|
||||
10 stub COLOADLIBRARY
|
||||
|
@ -29,13 +29,13 @@ type win16
|
|||
26 stub GETSCODE
|
||||
27 pascal CoRegisterMessageFilter(ptr ptr) CoRegisterMessageFilter16
|
||||
28 stub COISHANDLERCONNECTED
|
||||
#29 WEP
|
||||
29 stub SHRADDREF
|
||||
30 pascal CoFileTimeToDosDateTime(ptr ptr ptr) FileTimeToDosDateTime
|
||||
31 pascal CoDosDateTimeToFileTime(word word ptr) DosDateTimeToFileTime
|
||||
32 stub COMARSHALHRESULT
|
||||
33 stub COUNMARSHALHRESULT
|
||||
34 pascal CoGetCurrentProcess() CoGetCurrentProcess
|
||||
#35 ___EXPORTEDSTUB
|
||||
35 stub SHRCREATE
|
||||
36 stub COISOLE1CLASS
|
||||
37 stub _GUID_NULL
|
||||
38 stub _IID_IUNKNOWN
|
||||
|
@ -71,7 +71,7 @@ type win16
|
|||
68 stub PROPAGATERESULT
|
||||
69 stub IIDFROMSTRING
|
||||
70 stub _IID_ISTDMARSHALINFO
|
||||
71 stub COCREATESTANDARDMALLOC
|
||||
71 pascal CoCreateStandardMalloc(long ptr) CoCreateStandardMalloc16
|
||||
72 stub _IID_IEXTERNALCONNECTION
|
||||
73 stub COCREATEGUID
|
||||
75 stub FNASSERT
|
||||
|
@ -94,21 +94,31 @@ type win16
|
|||
92 stub LRPCGETTHREADWINDOW
|
||||
93 stub TIMERCALLBACKPROC
|
||||
94 pascal LookupETask(ptr ptr) LookupETask
|
||||
95 stub SETETASK
|
||||
95 pascal16 SetETask(word ptr) SetETask
|
||||
96 stub LRPCFREEMONITORDATA
|
||||
97 stub REMLOOKUPSHUNK
|
||||
98 stub SHRGETSIZE
|
||||
99 stub CALLTHKMGRUNINITIALIZE
|
||||
100 stub ??0CARRAYFVALUE@@REC@KI@Z
|
||||
101 stub ??1CARRAYFVALUE@@REC@XZ
|
||||
102 stub ?ASSERTVALID@CARRAYFVALUE@@RFCXXZ
|
||||
103 stub ?FREEEXTRA@CARRAYFVALUE@@RECXXZ
|
||||
104 stub ?_GETAT@CARRAYFVALUE@@RFCPEXH@Z
|
||||
105 stub ?GETSIZE@CARRAYFVALUE@@RFCHXZ
|
||||
106 stub ?REMOVEALL@CARRAYFVALUE@@RECXXZ
|
||||
107 stub SHRDESTROY
|
||||
108 stub ?INDEXOF@CARRAYFVALUE@@RECHPEXII@Z
|
||||
109 stub ?INSERTAT@CARRAYFVALUE@@RECHHPEXH@Z
|
||||
110 stub COSETSTATE
|
||||
111 stub ?REMOVEAT@CARRAYFVALUE@@RECXHH@Z
|
||||
112 stub ?SETAT@CARRAYFVALUE@@RECXHPEX@Z
|
||||
113 stub ?SETATGROW@CARRAYFVALUE@@RECHHPEX@Z
|
||||
114 stub ?SETSIZE@CARRAYFVALUE@@RECHHH@Z
|
||||
115 pascal CoGetState(ptr) CoGetState16
|
||||
116 stub DLLENTRYPOINT
|
||||
117 stub ?RELEASE@CSTDMALLOC@@VEAKXZ
|
||||
118 stub ?ALLOC@CSTDMALLOC@@VEAPEXK@Z
|
||||
119 stub SHRRELEASE
|
||||
120 stub ?GETASSOCAT@CMAPKEYTOVALUE@@BFCPEUCASSOC@1@PEXIAEI@Z
|
||||
121 stub ?SETASSOCKEY@CMAPKEYTOVALUE@@BFCHPEUCASSOC@1@PEXI@Z
|
||||
122 stub ??1CMAPKEYTOVALUE@@REC@XZ
|
||||
|
@ -126,6 +136,7 @@ type win16
|
|||
134 stub ?GETASSOCVALUE@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEX@Z
|
||||
135 stub ?REMOVEKEY@CMAPKEYTOVALUE@@RECHPEXI@Z
|
||||
136 stub ?REMOVEALL@CMAPKEYTOVALUE@@RECXXZ
|
||||
137 stub SHRALLOC
|
||||
138 stub ?FREEASSOCKEY@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@@Z
|
||||
139 stub ?SETAT@CMAPKEYTOVALUE@@RECHPEXI0@Z
|
||||
140 stub ?LOOKUPHKEY@CMAPKEYTOVALUE@@RFCHKPEX@Z
|
||||
|
@ -137,16 +148,64 @@ type win16
|
|||
146 stub ?GETASSOCVALUEPTR@CMAPKEYTOVALUE@@BFCXPEUCASSOC@1@PEPEX@Z
|
||||
147 stub ?LOOKUPADD@CMAPKEYTOVALUE@@RFCHPEXI0@Z
|
||||
148 stub MKVDEFAULTHASHKEY
|
||||
149 stub DELETE16
|
||||
150 stub COMEMCTXOF
|
||||
151 stub COMEMALLOC
|
||||
152 stub COMEMFREE
|
||||
153 stub SHRREALLOC
|
||||
154 stub ___EXPORTEDSTUB
|
||||
155 stub LRPCREGISTERWIN32SMONITOR
|
||||
156 stub MYREMGETINFOFORCID
|
||||
157 stub SHRFREE
|
||||
158 stub OPNEW16
|
||||
159 stub ADDCOINFO
|
||||
160 stub CORUNMODALLOOP
|
||||
161 stub COHANDLEINCOMINGCALL
|
||||
162 stub COSETACKSTATE
|
||||
|
||||
163 stub SHRDIDALLOC
|
||||
164 stub ?GETAT@CARRAYFVALUE@@RFCPEXH@Z
|
||||
165 stub ?GETUPPERBOUND@CARRAYFVALUE@@RFCHXZ
|
||||
166 stub OPDELETE16
|
||||
167 stub ?GETSIZEVALUE@CARRAYFVALUE@@RFCHXZ
|
||||
168 stub ?PROXY1632ADDREF@@ZAKPEVCPROXY1632@@@Z
|
||||
169 stub REMLOOKUPSHUNK
|
||||
170 stub ?ISEMPTY@CMAPKEYTOVALUE@@RFCHXZ
|
||||
171 stub ?FREE@CSTDMALLOC@@VEAXPEX@Z
|
||||
172 stub CALLTHKMGRINITIALIZE
|
||||
173 stub ?REALLOC@CSTDMALLOC@@VEAPEXPEXK@Z
|
||||
174 stub ?SM16RHQI@@ZAPEXPEVCSM16RELEASEHANDLER@@AFUGUID@@PEPEX@Z
|
||||
175 stub ?PROXY1632METHOD10@@ZAKPEVCPROXY1632@@@Z
|
||||
176 stub ___EXPORTEDSTUB
|
||||
177 stub ?PROXY1632METHOD20@@ZAKPEVCPROXY1632@@@Z
|
||||
178 stub ?PROXY1632METHOD11@@ZAKPEVCPROXY1632@@@Z
|
||||
179 stub ?PROXY1632METHOD30@@ZAKPEVCPROXY1632@@@Z
|
||||
180 stub ?PROXY1632METHOD21@@ZAKPEVCPROXY1632@@@Z
|
||||
181 stub ?PROXY1632METHOD12@@ZAKPEVCPROXY1632@@@Z
|
||||
182 stub ?PROXY1632METHOD31@@ZAKPEVCPROXY1632@@@Z
|
||||
183 stub ?PROXY1632METHOD22@@ZAKPEVCPROXY1632@@@Z
|
||||
184 stub ?PROXY1632METHOD13@@ZAKPEVCPROXY1632@@@Z
|
||||
185 stub ?GETSIZE@CSTDMALLOC@@VEAKPEX@Z
|
||||
186 stub ?PROXY1632METHOD23@@ZAKPEVCPROXY1632@@@Z
|
||||
187 stub ?PROXY1632METHOD14@@ZAKPEVCPROXY1632@@@Z
|
||||
188 stub ?PROXY1632METHOD24@@ZAKPEVCPROXY1632@@@Z
|
||||
189 stub ?PROXY1632METHOD15@@ZAKPEVCPROXY1632@@@Z
|
||||
190 stub ?PROXY1632METHOD25@@ZAKPEVCPROXY1632@@@Z
|
||||
191 stub ?PROXY1632METHOD16@@ZAKPEVCPROXY1632@@@Z
|
||||
192 stub ?PROXY1632METHOD26@@ZAKPEVCPROXY1632@@@Z
|
||||
193 stub ?PROXY1632METHOD17@@ZAKPEVCPROXY1632@@@Z
|
||||
194 stub ?PROXY1632METHOD27@@ZAKPEVCPROXY1632@@@Z
|
||||
195 stub ?PROXY1632METHOD18@@ZAKPEVCPROXY1632@@@Z
|
||||
196 stub ?PROXY1632METHOD28@@ZAKPEVCPROXY1632@@@Z
|
||||
197 stub ?ADDREF@CSTDMALLOC@@VEAKXZ
|
||||
198 stub ?PROXY1632METHOD19@@ZAKPEVCPROXY1632@@@Z
|
||||
199 stub ?PROXY1632METHOD29@@ZAKPEVCPROXY1632@@@Z
|
||||
200 stub CALL32INITIALIZE
|
||||
201 pascal CALLOBJECTINWOW(ptr ptr) CallObjectInWOW
|
||||
204 stub COMPOBJ_204
|
||||
207 stub COMPOBJ_207
|
||||
203 stub CALLOBJECTINWOWCHECKINIT
|
||||
204 stub CALLOBJECTINWOWCHECKTHKMGR
|
||||
205 stub CONVERTHR1632
|
||||
206 stub CONVERTHR3216
|
||||
207 stub ADDAPPCOMPATFLAG
|
||||
|
||||
# WINE internal relays (for Win16 interfaces)
|
||||
500 cdecl IMalloc16_QueryInterface(ptr ptr ptr) IMalloc16_QueryInterface
|
||||
|
|
|
@ -142,7 +142,7 @@ file krnl386.exe
|
|||
139 stub DoSignal
|
||||
140 pascal16 SetSigHandler(segptr ptr ptr word word) SetSigHandler
|
||||
141 stub InitTask1
|
||||
142 stub GetProfileSectionNames
|
||||
142 pascal16 GetProfileSectionNames(ptr word) GetProfileSectionNames16
|
||||
143 pascal16 GetPrivateProfileSectionNames(ptr word str) GetPrivateProfileSectionNames16
|
||||
144 pascal16 CreateDirectory(ptr ptr) CreateDirectory16
|
||||
145 pascal16 RemoveDirectory(ptr) RemoveDirectory16
|
||||
|
@ -325,25 +325,46 @@ file krnl386.exe
|
|||
485 pascal GetProcessDWORD(long s_word) GetProcessDword
|
||||
486 stub KERNEL_486
|
||||
491 stub RegisterServiceProcess
|
||||
500 stub KERNEL_500
|
||||
502 stub KERNEL_502
|
||||
503 stub KERNEL_503
|
||||
511 stub KERNEL_511
|
||||
|
||||
# Those stubs can be found in WindowNT3.51 krnl386.exe. Some are used by Win95
|
||||
# too, some seem to specify different functions in Win95... Ugh.
|
||||
500 pascal WOW16Call(word word word) WOW16Call
|
||||
501 stub KDDBGOUT
|
||||
502 stub WOWGETNEXTVDMCOMMAND
|
||||
503 stub WOWREGISTERSHELLWINDOWHANDLE
|
||||
504 stub WOWLOADMODULE
|
||||
505 stub WOWQUERYPERFORMANCECOUNTER
|
||||
506 stub WOWCURSORICONOP
|
||||
507 stub WOWFAILEDEXEC
|
||||
508 stub WOWCLOSECOMPORT
|
||||
509 stub WOWKILLREMOTETASK
|
||||
511 stub WOWKILLREMOTETASK
|
||||
512 stub WOWQUERYDEBUG
|
||||
513 pascal LoadLibraryEx32W(ptr long long) LoadLibraryEx32W16
|
||||
514 pascal16 FreeLibrary32W(long) FreeLibrary32
|
||||
515 pascal GetProcAddress32W(long str) GetProcAddress32
|
||||
516 pascal GetVDMPointer32W(segptr long) GetVDMPointer32W
|
||||
517 pascal CallProc32W() WIN16_CallProc32W
|
||||
518 pascal CallProcEx32W() WIN16_CallProcEx32W
|
||||
519 stub KERNEL_519
|
||||
522 stub KERNEL_522
|
||||
523 stub KERNEL_523
|
||||
525 stub KERNEL_525
|
||||
531 stub KERNEL_531
|
||||
532 stub KERNEL_532
|
||||
519 stub EXITKERNELTHUNK
|
||||
# the __MOD_ variables are WORD datareferences.
|
||||
520 equate __MOD_KERNEL 4200
|
||||
521 equate __MOD_DKERNEL 4201
|
||||
522 equate __MOD_USER 4203
|
||||
523 equate __MOD_DUSER 4204
|
||||
524 equate __MOD_GDI 4205
|
||||
525 equate __MOD_DGDI 4206
|
||||
526 equate __MOD_KEYBOARD 4207
|
||||
527 equate __MOD_SOUND 4208
|
||||
528 equate __MOD_SHELL 4209
|
||||
529 equate __MOD_WINSOCK 4210
|
||||
530 equate __MOD_TOOLHELP 4211
|
||||
531 equate __MOD_MMEDIA 4212
|
||||
532 equate __MOD_COMMDLG 4213
|
||||
540 stub KERNEL_540
|
||||
541 stub KERNEL_541
|
||||
544 stub KERNEL_544
|
||||
541 stub WOWSETEXITONLASTAPP
|
||||
544 stub WOWSETCOMPATHANDLE
|
||||
|
||||
600 stub KERNEL_600
|
||||
601 stub KERNEL_601
|
||||
604 stub KERNEL_604
|
||||
|
|
|
@ -36,7 +36,7 @@ type win16
|
|||
33 stub READSTRINGSTREAM
|
||||
34 stub WRITESTRINGSTREAM
|
||||
35 pascal RegisterDragDrop(word segptr) RegisterDragDrop16
|
||||
36 stub REVOKEDRAGDROP
|
||||
36 pascal RevokeDragDrop(word) RevokeDragDrop16
|
||||
37 stub DODRAGDROP
|
||||
38 stub CREATEOLEADVISEHOLDER
|
||||
39 stub CREATEDATAADVISEHOLDER
|
||||
|
|
|
@ -229,18 +229,6 @@ void WINAPI SNOOP16_Entry(CONTEXT *context) {
|
|||
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)
|
||||
|
@ -273,7 +261,8 @@ void WINAPI SNOOP16_Entry(CONTEXT *context) {
|
|||
if(!ret->show) return;
|
||||
DPRINTF("Call %s.%ld: %s(",dll->name,ordinal,fun->name);
|
||||
if (fun->nrofargs>0) {
|
||||
max = fun->nrofargs; if (max>16) max=16;
|
||||
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)
|
||||
|
@ -294,8 +283,9 @@ void WINAPI SNOOP16_Return(CONTEXT *context) {
|
|||
* will be the difference between orig and current SP
|
||||
* If pascal -> everything ok.
|
||||
*/
|
||||
if (ret->dll->funs[ret->ordinal].nrofargs<0)
|
||||
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->show) {
|
||||
|
@ -305,10 +295,15 @@ void WINAPI SNOOP16_Return(CONTEXT *context) {
|
|||
|
||||
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;
|
||||
if (max>16)
|
||||
max=16;
|
||||
if (max<0)
|
||||
max=0;
|
||||
|
||||
for (i=max;i--;)
|
||||
DPRINTF("%04x%s",ret->args[i],i?",":"");
|
||||
if (max!=ret->dll->funs[ret->ordinal].nrofargs)
|
||||
DPRINTF(" ...");
|
||||
DPRINTF(") retval = %04x:%04x ret=%04x:%04x\n",
|
||||
DX_reg(context),AX_reg(context),HIWORD(ret->origreturn),LOWORD(ret->origreturn)
|
||||
);
|
||||
|
|
|
@ -898,3 +898,18 @@ void WINAPI C16ThkSL01(CONTEXT *context)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
WOW16Call(WORD x,WORD y,WORD z) {
|
||||
int i;
|
||||
DWORD calladdr;
|
||||
FIXME(thunk,"(0x%04x,0x%04x,%d),calling (",x,y,z);
|
||||
|
||||
for (i=0;i<x/2;i++) {
|
||||
WORD a = STACK16_POP(THREAD_Current(),2);
|
||||
DPRINTF("%04x ",a);
|
||||
}
|
||||
calladdr = STACK16_POP(THREAD_Current(),4);
|
||||
DPRINTF(") calling address was 0x%08lx\n",calladdr);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -509,7 +509,7 @@ file user.exe
|
|||
665 pascal16 GetMenuItemRect(word word word ptr) GetMenuItemRect16
|
||||
666 stub CheckMenuRadioItem
|
||||
667 stub TrackPopupMenuEx
|
||||
668 stub SetWindowRgn
|
||||
668 pascal16 SetWindowRgn(word word word) SetWindowRgn16
|
||||
669 stub GetWindowRgn
|
||||
800 stub CHOOSEFONT_CALLBACK16
|
||||
801 stub FINDREPLACE_CALLBACK16
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Animation class extra info
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*/
|
||||
|
||||
#ifndef __WINE_ANIMATE_H
|
||||
#define __WINE_ANIMATE_H
|
||||
|
||||
|
||||
typedef struct tagANIMATE_INFO
|
||||
{
|
||||
DWORD dwDummy;
|
||||
} ANIMATE_INFO;
|
||||
|
||||
|
||||
extern void ANIMATE_Register (void);
|
||||
|
||||
#endif /* __WINE_ANIMATE_H */
|
|
@ -111,6 +111,7 @@ static const char * const SHELL_People[] =
|
|||
"Rick Sladkey",
|
||||
"William Smith",
|
||||
"Dominik Strasser",
|
||||
"Patrik Stridvall",
|
||||
"Vadim Strizhevsky",
|
||||
"Bertho Stultiens",
|
||||
"Erik Svendsen",
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* ComboBoxEx class extra info
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*/
|
||||
|
||||
#ifndef __WINE_COMBOEX_H
|
||||
#define __WINE_COMBOEX_H
|
||||
|
||||
|
||||
typedef struct tagCOMBOEX_INFO
|
||||
{
|
||||
HIMAGELIST himl;
|
||||
HWND32 hwndCombo;
|
||||
DWORD dwExtStyle;
|
||||
|
||||
|
||||
} COMBOEX_INFO;
|
||||
|
||||
|
||||
extern void COMBOEX_Register (void);
|
||||
|
||||
#endif /* __WINE_COMBOEX_H */
|
File diff suppressed because it is too large
Load Diff
248
include/debug.h
248
include/debug.h
|
@ -13,133 +13,137 @@
|
|||
#define dbch_6 5
|
||||
#define dbch_accel 6
|
||||
#define dbch_advapi 7
|
||||
#define dbch_aspi 8
|
||||
#define dbch_atom 9
|
||||
#define dbch_bitblt 10
|
||||
#define dbch_bitmap 11
|
||||
#define dbch_caret 12
|
||||
#define dbch_cd 13
|
||||
#define dbch_animate 8
|
||||
#define dbch_aspi 9
|
||||
#define dbch_atom 10
|
||||
#define dbch_bitblt 11
|
||||
#define dbch_bitmap 12
|
||||
#define dbch_caret 13
|
||||
#define dbch_cdaudio 14
|
||||
#define dbch_class 15
|
||||
#define dbch_clipboard 16
|
||||
#define dbch_clipping 17
|
||||
#define dbch_combo 18
|
||||
#define dbch_comm 19
|
||||
#define dbch_commctrl 20
|
||||
#define dbch_commdlg 21
|
||||
#define dbch_console 22
|
||||
#define dbch_crtdll 23
|
||||
#define dbch_cursor 24
|
||||
#define dbch_dc 25
|
||||
#define dbch_dde 26
|
||||
#define dbch_ddeml 27
|
||||
#define dbch_ddraw 28
|
||||
#define dbch_debug 29
|
||||
#define dbch_dialog 30
|
||||
#define dbch_dinput 31
|
||||
#define dbch_dll 32
|
||||
#define dbch_dosfs 33
|
||||
#define dbch_dosmem 34
|
||||
#define dbch_dplay 35
|
||||
#define dbch_driver 36
|
||||
#define dbch_dsound 37
|
||||
#define dbch_edit 38
|
||||
#define dbch_event 39
|
||||
#define dbch_exec 40
|
||||
#define dbch_file 41
|
||||
#define dbch_fixup 42
|
||||
#define dbch_font 43
|
||||
#define dbch_gdi 44
|
||||
#define dbch_global 45
|
||||
#define dbch_graphics 46
|
||||
#define dbch_header 47
|
||||
#define dbch_heap 48
|
||||
#define dbch_hook 49
|
||||
#define dbch_icon 50
|
||||
#define dbch_imagelist 51
|
||||
#define dbch_int 52
|
||||
#define dbch_int21 53
|
||||
#define dbch_int31 54
|
||||
#define dbch_key 55
|
||||
#define dbch_keyboard 56
|
||||
#define dbch_ldt 57
|
||||
#define dbch_listbox 58
|
||||
#define dbch_listview 59
|
||||
#define dbch_local 60
|
||||
#define dbch_mci 61
|
||||
#define dbch_mcianim 62
|
||||
#define dbch_mciwave 63
|
||||
#define dbch_mdi 64
|
||||
#define dbch_menu 65
|
||||
#define dbch_message 66
|
||||
#define dbch_metafile 67
|
||||
#define dbch_midi 68
|
||||
#define dbch_mmaux 69
|
||||
#define dbch_mmio 70
|
||||
#define dbch_mmsys 71
|
||||
#define dbch_mmtime 72
|
||||
#define dbch_module 73
|
||||
#define dbch_mpr 74
|
||||
#define dbch_msg 75
|
||||
#define dbch_msvideo 76
|
||||
#define dbch_nonclient 77
|
||||
#define dbch_ntdll 78
|
||||
#define dbch_ole 79
|
||||
#define dbch_pager 80
|
||||
#define dbch_palette 81
|
||||
#define dbch_pidl 82
|
||||
#define dbch_print 83
|
||||
#define dbch_process 84
|
||||
#define dbch_profile 85
|
||||
#define dbch_progress 86
|
||||
#define dbch_prop 87
|
||||
#define dbch_psdrv 88
|
||||
#define dbch_rebar 89
|
||||
#define dbch_reg 90
|
||||
#define dbch_region 91
|
||||
#define dbch_relay 92
|
||||
#define dbch_resource 93
|
||||
#define dbch_s 94
|
||||
#define dbch_scroll 95
|
||||
#define dbch_security 96
|
||||
#define dbch_segment 97
|
||||
#define dbch_selector 98
|
||||
#define dbch_sem 99
|
||||
#define dbch_sendmsg 100
|
||||
#define dbch_shell 101
|
||||
#define dbch_shm 102
|
||||
#define dbch_snoop 103
|
||||
#define dbch_sound 104
|
||||
#define dbch_static 105
|
||||
#define dbch_statusbar 106
|
||||
#define dbch_stress 107
|
||||
#define dbch_string 108
|
||||
#define dbch_syscolor 109
|
||||
#define dbch_system 110
|
||||
#define dbch_task 111
|
||||
#define dbch_text 112
|
||||
#define dbch_thread 113
|
||||
#define dbch_thunk 114
|
||||
#define dbch_timer 115
|
||||
#define dbch_toolbar 116
|
||||
#define dbch_toolhelp 117
|
||||
#define dbch_tooltips 118
|
||||
#define dbch_trackbar 119
|
||||
#define dbch_treeview 120
|
||||
#define dbch_tweak 121
|
||||
#define dbch_uitools 122
|
||||
#define dbch_updown 123
|
||||
#define dbch_ver 124
|
||||
#define dbch_virtual 125
|
||||
#define dbch_vxd 126
|
||||
#define dbch_win 127
|
||||
#define dbch_win16drv 128
|
||||
#define dbch_win32 129
|
||||
#define dbch_wing 130
|
||||
#define dbch_winsock 131
|
||||
#define dbch_wnet 132
|
||||
#define dbch_x11 133
|
||||
#define dbch_x11drv 134
|
||||
#define dbch_comboex 19
|
||||
#define dbch_comm 20
|
||||
#define dbch_commctrl 21
|
||||
#define dbch_commdlg 22
|
||||
#define dbch_console 23
|
||||
#define dbch_crtdll 24
|
||||
#define dbch_cursor 25
|
||||
#define dbch_dc 26
|
||||
#define dbch_dde 27
|
||||
#define dbch_ddeml 28
|
||||
#define dbch_ddraw 29
|
||||
#define dbch_debug 30
|
||||
#define dbch_dialog 31
|
||||
#define dbch_dinput 32
|
||||
#define dbch_dll 33
|
||||
#define dbch_dosfs 34
|
||||
#define dbch_dosmem 35
|
||||
#define dbch_dplay 36
|
||||
#define dbch_driver 37
|
||||
#define dbch_dsound 38
|
||||
#define dbch_edit 39
|
||||
#define dbch_event 40
|
||||
#define dbch_exec 41
|
||||
#define dbch_file 42
|
||||
#define dbch_fixup 43
|
||||
#define dbch_font 44
|
||||
#define dbch_gdi 45
|
||||
#define dbch_global 46
|
||||
#define dbch_graphics 47
|
||||
#define dbch_header 48
|
||||
#define dbch_heap 49
|
||||
#define dbch_hook 50
|
||||
#define dbch_hotkey 51
|
||||
#define dbch_icon 52
|
||||
#define dbch_imagelist 53
|
||||
#define dbch_int 54
|
||||
#define dbch_int10 55
|
||||
#define dbch_int21 56
|
||||
#define dbch_int31 57
|
||||
#define dbch_key 58
|
||||
#define dbch_keyboard 59
|
||||
#define dbch_ldt 60
|
||||
#define dbch_listbox 61
|
||||
#define dbch_listview 62
|
||||
#define dbch_local 63
|
||||
#define dbch_mci 64
|
||||
#define dbch_mcianim 65
|
||||
#define dbch_mciwave 66
|
||||
#define dbch_mdi 67
|
||||
#define dbch_menu 68
|
||||
#define dbch_message 69
|
||||
#define dbch_metafile 70
|
||||
#define dbch_midi 71
|
||||
#define dbch_mmaux 72
|
||||
#define dbch_mmio 73
|
||||
#define dbch_mmsys 74
|
||||
#define dbch_mmtime 75
|
||||
#define dbch_module 76
|
||||
#define dbch_mpr 77
|
||||
#define dbch_msg 78
|
||||
#define dbch_msvideo 79
|
||||
#define dbch_nonclient 80
|
||||
#define dbch_ntdll 81
|
||||
#define dbch_ole 82
|
||||
#define dbch_pager 83
|
||||
#define dbch_palette 84
|
||||
#define dbch_pidl 85
|
||||
#define dbch_print 86
|
||||
#define dbch_process 87
|
||||
#define dbch_profile 88
|
||||
#define dbch_progress 89
|
||||
#define dbch_prop 90
|
||||
#define dbch_psdrv 91
|
||||
#define dbch_rebar 92
|
||||
#define dbch_reg 93
|
||||
#define dbch_region 94
|
||||
#define dbch_relay 95
|
||||
#define dbch_resource 96
|
||||
#define dbch_s 97
|
||||
#define dbch_scroll 98
|
||||
#define dbch_security 99
|
||||
#define dbch_segment 100
|
||||
#define dbch_selector 101
|
||||
#define dbch_sem 102
|
||||
#define dbch_sendmsg 103
|
||||
#define dbch_shell 104
|
||||
#define dbch_shm 105
|
||||
#define dbch_snoop 106
|
||||
#define dbch_sound 107
|
||||
#define dbch_static 108
|
||||
#define dbch_statusbar 109
|
||||
#define dbch_stress 110
|
||||
#define dbch_string 111
|
||||
#define dbch_syscolor 112
|
||||
#define dbch_system 113
|
||||
#define dbch_tab 114
|
||||
#define dbch_task 115
|
||||
#define dbch_text 116
|
||||
#define dbch_thread 117
|
||||
#define dbch_thunk 118
|
||||
#define dbch_timer 119
|
||||
#define dbch_toolbar 120
|
||||
#define dbch_toolhelp 121
|
||||
#define dbch_tooltips 122
|
||||
#define dbch_trackbar 123
|
||||
#define dbch_treeview 124
|
||||
#define dbch_tweak 125
|
||||
#define dbch_uitools 126
|
||||
#define dbch_updown 127
|
||||
#define dbch_ver 128
|
||||
#define dbch_virtual 129
|
||||
#define dbch_vxd 130
|
||||
#define dbch_win 131
|
||||
#define dbch_win16drv 132
|
||||
#define dbch_win32 133
|
||||
#define dbch_wing 134
|
||||
#define dbch_winsock 135
|
||||
#define dbch_wnet 136
|
||||
#define dbch_x11 137
|
||||
#define dbch_x11drv 138
|
||||
/* Definitions for classes identifiers */
|
||||
#define dbcl_fixme 0
|
||||
#define dbcl_err 1
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "debugtools.h"
|
||||
#endif
|
||||
|
||||
#define DEBUG_CHANNEL_COUNT 135
|
||||
#define DEBUG_CHANNEL_COUNT 139
|
||||
#ifdef DEBUG_RUNTIME
|
||||
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
|
||||
{1, 1, 0, 0},
|
||||
|
@ -142,6 +142,10 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
|
|||
{1, 1, 0, 0},
|
||||
{1, 1, 0, 0},
|
||||
{1, 1, 0, 0},
|
||||
{1, 1, 0, 0},
|
||||
{1, 1, 0, 0},
|
||||
{1, 1, 0, 0},
|
||||
{1, 1, 0, 0},
|
||||
};
|
||||
const char* debug_ch_name[] = {
|
||||
"1",
|
||||
|
@ -152,17 +156,18 @@ const char* debug_ch_name[] = {
|
|||
"6",
|
||||
"accel",
|
||||
"advapi",
|
||||
"animate",
|
||||
"aspi",
|
||||
"atom",
|
||||
"bitblt",
|
||||
"bitmap",
|
||||
"caret",
|
||||
"cd",
|
||||
"cdaudio",
|
||||
"class",
|
||||
"clipboard",
|
||||
"clipping",
|
||||
"combo",
|
||||
"comboex",
|
||||
"comm",
|
||||
"commctrl",
|
||||
"commdlg",
|
||||
|
@ -194,9 +199,11 @@ const char* debug_ch_name[] = {
|
|||
"header",
|
||||
"heap",
|
||||
"hook",
|
||||
"hotkey",
|
||||
"icon",
|
||||
"imagelist",
|
||||
"int",
|
||||
"int10",
|
||||
"int21",
|
||||
"int31",
|
||||
"key",
|
||||
|
@ -255,6 +262,7 @@ const char* debug_ch_name[] = {
|
|||
"string",
|
||||
"syscolor",
|
||||
"system",
|
||||
"tab",
|
||||
"task",
|
||||
"text",
|
||||
"thread",
|
||||
|
|
|
@ -28,6 +28,7 @@ typedef struct _DOSTASK {
|
|||
#define MZ_SUPPORTED
|
||||
|
||||
extern int MZ_InitTask( LPDOSTASK lpDosTask );
|
||||
extern int MZ_InitMemory( LPDOSTASK lpDosTask, NE_MODULE *pModule );
|
||||
extern int MZ_RunModule( LPDOSTASK lpDosTask );
|
||||
extern void MZ_KillModule( LPDOSTASK lpDosTask );
|
||||
extern int DOSVM_Process( LPDOSTASK lpDosTask );
|
||||
|
|
|
@ -21,6 +21,7 @@ typedef struct
|
|||
int mode;
|
||||
char *unix_name;
|
||||
DWORD type; /* Type for win32 apps */
|
||||
DWORD pos; /* workaround to emulate weird DOS error handling */
|
||||
} FILE_OBJECT;
|
||||
|
||||
/* Definition of a full DOS file name */
|
||||
|
@ -41,14 +42,17 @@ typedef struct
|
|||
} DOS_DEVICE;
|
||||
|
||||
/* Macros to convert 16 bit to 32 bit file handles and back */
|
||||
/* LZW handles are exempt as if not, could go below 0x400 */
|
||||
#define HFILE16_TO_HFILE32(handle) \
|
||||
(((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
|
||||
((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
|
||||
((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
|
||||
((handle)>=0x400) ? handle : \
|
||||
(handle)-5)
|
||||
|
||||
#define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
|
||||
((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
|
||||
((hnd)>=0x400) ? hnd : \
|
||||
(HFILE16)hnd+5); })
|
||||
|
||||
|
||||
|
|
|
@ -112,8 +112,6 @@ typedef struct
|
|||
WORD backgroundMode;
|
||||
COLORREF backgroundColor;
|
||||
COLORREF textColor;
|
||||
int backgroundPixel;
|
||||
int textPixel;
|
||||
short brushOrgX;
|
||||
short brushOrgY;
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Hotkey class extra info
|
||||
*
|
||||
* Copyright 1998 Eric Kohl
|
||||
*/
|
||||
|
||||
#ifndef __WINE_HOTKEY_H
|
||||
#define __WINE_HOTKEY_H
|
||||
|
||||
|
||||
typedef struct tagHOTKEY_INFO
|
||||
{
|
||||
HFONT32 hFont;
|
||||
BOOL32 bFocus;
|
||||
INT32 nHeight;
|
||||
|
||||
} HOTKEY_INFO;
|
||||
|
||||
|
||||
extern void HOTKEY_Register (void);
|
||||
|
||||
#endif /* __WINE_HOTKEY_H */
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* imm.h - Declarations for IMM32
|
||||
*/
|
||||
|
||||
#ifndef __WINE_IMM_H
|
||||
#define __WINE_IMM_H
|
||||
|
||||
typedef DWORD HIMC32;
|
||||
typedef DWORD HIMCC32;
|
||||
|
||||
typedef HKL32 *LPHKL32;
|
||||
|
||||
typedef int (CALLBACK *REGISTERWORDENUMPROCA)(LPCSTR, DWORD, LPCSTR, LPVOID);
|
||||
typedef int (CALLBACK *REGISTERWORDENUMPROCW)(LPCWSTR, DWORD, LPCWSTR, LPVOID);
|
||||
|
||||
typedef void *LPCANDIDATELIST;
|
||||
typedef void *LPCANDIDATEFORM;
|
||||
|
||||
typedef void *LPSTYLEBUFA;
|
||||
typedef void *LPSTYLEBUFW;
|
||||
|
||||
typedef void *LPCOMPOSITIONFORM;
|
||||
|
||||
#endif /* __WINE_IMM_H */
|
|
@ -8,10 +8,31 @@
|
|||
#define __WINE_LISTVIEW_H
|
||||
|
||||
|
||||
typedef struct tagLISTVIEW_ITEM
|
||||
{
|
||||
UINT32 state;
|
||||
LPSTR pszText;
|
||||
INT32 iImage;
|
||||
LPARAM lParam;
|
||||
INT32 iIndent;
|
||||
|
||||
HDSA hdsaItem;
|
||||
} LISTVIEW_ITEM;
|
||||
|
||||
|
||||
typedef struct tagLISTVIEW_INFO
|
||||
{
|
||||
COLORREF clrBk;
|
||||
HIMAGELIST himlNormal;
|
||||
HIMAGELIST himlSmall;
|
||||
HIMAGELIST himlState;
|
||||
INT32 nItemCount;
|
||||
HWND32 hwndHeader;
|
||||
HFONT32 hDefaultFont;
|
||||
HFONT32 hFont;
|
||||
RECT32 rcList; /* "client" area of the list (without header) */
|
||||
|
||||
HDSA hdsaItems;
|
||||
|
||||
} LISTVIEW_INFO;
|
||||
|
||||
|
|
|
@ -68,6 +68,8 @@ extern BOOL32 MFDRV_Polygon( struct tagDC *dc, LPPOINT32 pt, INT32 count );
|
|||
extern BOOL32 MFDRV_PolyPolygon( struct tagDC *dc, LPPOINT32 pt, LPINT32 counts,
|
||||
UINT32 polygons);
|
||||
extern HGDIOBJ32 MFDRV_SelectObject( DC *dc, HGDIOBJ32 handle );
|
||||
extern COLORREF MFDRV_SetBkColor( DC *dc, COLORREF color );
|
||||
extern COLORREF MFDRV_SetTextColor( DC *dc, COLORREF color );
|
||||
extern BOOL32 MFDRV_ExtFloodFill( struct tagDC *dc, INT32 x, INT32 y,
|
||||
COLORREF color, UINT32 fillType );
|
||||
extern BOOL32 MFDRV_ExtTextOut( struct tagDC *dc, INT32 x, INT32 y,
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
extern HANDLE16 DOSMEM_BiosSeg;
|
||||
extern DWORD DOSMEM_CollateTable;
|
||||
|
||||
extern DWORD DOSMEM_ErrorCall;
|
||||
extern DWORD DOSMEM_ErrorBuffer;
|
||||
|
||||
extern BOOL32 DOSMEM_Init(HMODULE16 hModule);
|
||||
extern void DOSMEM_Tick(void);
|
||||
extern WORD DOSMEM_AllocSelector(WORD);
|
||||
|
@ -29,6 +32,7 @@ extern UINT32 DOSMEM_MapLinearToDos(LPVOID); /* linear Wine to DOS */
|
|||
/* msdos/interrupts.c */
|
||||
extern FARPROC16 INT_GetHandler( BYTE intnum );
|
||||
extern void INT_SetHandler( BYTE intnum, FARPROC16 handler );
|
||||
extern int INT_RealModeInterrupt( BYTE intnum, PCONTEXT context );
|
||||
|
||||
/* msdos/ioports.c */
|
||||
extern void IO_port_init (void);
|
||||
|
@ -39,6 +43,9 @@ extern void IO_outport( int port, int count, DWORD value );
|
|||
extern DWORD INT1A_GetTicksSinceMidnight(void);
|
||||
extern void WINAPI INT_Int1aHandler(CONTEXT*);
|
||||
|
||||
/* msdos/int20.c */
|
||||
extern void WINAPI INT_Int20Handler(CONTEXT*);
|
||||
|
||||
/* msdos/int2f.c */
|
||||
extern void WINAPI INT_Int2fHandler(CONTEXT*);
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@ BOOL32 WINAPI PlaySound32W(LPCWSTR pszSound, HMODULE32 hmod, DWORD fdwSound);
|
|||
#define SND_ALIAS_ID 0x00110000L /* alias is a predefined ID */
|
||||
#define SND_FILENAME 0x00020000L /* name is file name */
|
||||
#define SND_RESOURCE 0x00040004L /* name is resource name or atom */
|
||||
#define SND_PURGE 0x00000040L /* purge all sounds */
|
||||
|
||||
/* waveform audio error return values */
|
||||
#define WAVERR_BADFORMAT (WAVERR_BASE + 0) /* unsupported wave format */
|
||||
|
|
|
@ -193,7 +193,7 @@ extern BYTE DOS_ErrorClass, DOS_ErrorAction, DOS_ErrorLocus;
|
|||
#define EL_Memory 0x05
|
||||
|
||||
void WINAPI DOS3Call( CONTEXT *context );
|
||||
void do_mscdex( CONTEXT *context, int dorealmode );
|
||||
void do_mscdex( CONTEXT *context );
|
||||
void do_mscdex_dd (CONTEXT * context, int dorealmode);
|
||||
|
||||
#endif /* __WINE_MSDOS_H */
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* oledlg.h - Declarations for OLEDLG
|
||||
*/
|
||||
|
||||
#ifndef __WINE_OLEDLG_H
|
||||
#define __WINE_OLEDLG_H
|
||||
|
||||
#define OLEUI_FALSE 0
|
||||
#define OLEUI_SUCCESS 1 /* Same as OLEUI_OK */
|
||||
#define OLEUI_OK 1 /* OK button pressed */
|
||||
#define OLEUI_CANCEL 2 /* Cancel button pressed */
|
||||
|
||||
typedef void *LPOLEUIINSERTOBJECTA; /* FIXME: stub */
|
||||
typedef void *LPOLEUIINSERTOBJECTW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUIPASTESPECIALA; /* FIXME: stub */
|
||||
typedef void *LPOLEUIPASTESPECIALW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUIEDITLINKSA; /* FIXME: stub */
|
||||
typedef void *LPOLEUIEDITLINKSW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUICHANGEICONA; /* FIXME: stub */
|
||||
typedef void *LPOLEUICHANGEICONW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUICONVERTA; /* FIXME: stub */
|
||||
typedef void *LPOLEUICONVERTW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUIBUSYA; /* FIXME: stub */
|
||||
typedef void *LPOLEUIBUSYW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUILINKCONTAINERA; /* FIXME: stub */
|
||||
typedef void *LPOLEUILINKCONTAINERW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUIOBJECTPROPSA; /* FIXME: stub */
|
||||
typedef void *LPOLEUIOBJECTPROPSW; /* FIXME: stub */
|
||||
|
||||
typedef void *LPOLEUICHANGESOURCEA; /* FIXME: stub */
|
||||
typedef void *LPOLEUICHANGESOURCEW; /* FIXME: stub */
|
||||
|
||||
#endif /* __WINE_OLEDLG_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue