From b406c7d42ac6817485c3c8a6d1bb5ba748655b28 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 24 Jan 1999 19:12:34 +0000 Subject: [PATCH] New drag list control. --- dlls/comctl32/Makefile.in | 1 + dlls/comctl32/draglist.c | 46 +++++++ include/commctrl.h | 266 ++++++++++++++++++++------------------ relay32/comctl32.spec | 16 +-- 4 files changed, 192 insertions(+), 137 deletions(-) create mode 100644 dlls/comctl32/draglist.c diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in index a753752cb8..1e74ac801c 100644 --- a/dlls/comctl32/Makefile.in +++ b/dlls/comctl32/Makefile.in @@ -11,6 +11,7 @@ C_SRCS = \ comctl32undoc.c \ commctrl.c \ datetime.c \ + draglist.c \ flatsb.c \ header.c \ hotkey.c \ diff --git a/dlls/comctl32/draglist.c b/dlls/comctl32/draglist.c new file mode 100644 index 0000000000..e6fe542663 --- /dev/null +++ b/dlls/comctl32/draglist.c @@ -0,0 +1,46 @@ +/* + * Drag List control + * + * Copyright 1999 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 + * + * TODO: + * - Everything. + */ + +#include "windows.h" +#include "commctrl.h" + +#include "debug.h" + + +BOOL32 MakeDragList (HWND32 hwndLB) +{ + FIXME (commctrl, "(0x%x)\n", hwndLB); + + + return FALSE; +} + + +VOID DrawInsert (HWND32 hwndParent, HWND32 hwndLB, INT32 nItem) +{ + FIXME (commctrl, "(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem); + + +} + + +INT32 LBItemFromPt (HWND32 hwndLB, POINT32 pt, BOOL32 bAutoScroll) +{ + FIXME (commctrl, "(0x%x %dx %d %s)\n", + hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE"); + + + return -1; +} + diff --git a/include/commctrl.h b/include/commctrl.h index 7ecd9cef69..8513c6b8f9 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -115,6 +115,8 @@ typedef struct tagNMTOOLTIPSCREATED sizeof(((name*)0)->member)) #endif + +/* This is only for Winelib applications. DON't use it wine itself!!! */ #define SNDMSG WINELIB_NAME_AW(SendMessage) @@ -171,8 +173,8 @@ typedef struct tagNMCUSTOMDRAWINFO typedef struct tagNMTTCUSTOMDRAW { - NMCUSTOMDRAW nmcd; - UINT32 uDrawFlags; + NMCUSTOMDRAW nmcd; + UINT32 uDrawFlags; } NMTTCUSTOMDRAW, *LPNMTTCUSTOMDRAW; @@ -234,12 +236,15 @@ VOID WINAPI DrawStatusText32W (HDC32, LPRECT32, LPCWSTR, UINT32); VOID WINAPI MenuHelp (UINT32, WPARAM32, LPARAM, HMENU32, HINSTANCE32, HWND32, LPUINT32); -/* Drag List */ +/************************************************************************** + * Drag List control + */ -typedef struct tagDRAGLISTINFO { - UINT32 uNotification; - HWND32 hWnd; - POINT32 ptCursor; +typedef struct tagDRAGLISTINFO +{ + UINT32 uNotification; + HWND32 hWnd; + POINT32 ptCursor; } DRAGLISTINFO, *LPDRAGLISTINFO; #define DL_BEGINDRAG (WM_USER+133) @@ -254,9 +259,10 @@ typedef struct tagDRAGLISTINFO { #define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg") -BOOL32 WINAPI MakeDragList(HWND32 hLB); -void WINAPI DrawInsert(HWND32 handParent, HWND32 hLB, int nItem); -int WINAPI LBItemFromPt(HWND32 hLB, POINT32 pt, BOOL32 bAutoScroll); +BOOL32 WINAPI MakeDragList (HWND32); +VOID WINAPI DrawInsert (HWND32, HWND32, INT32); +INT32 WINAPI LBItemFromPt (HWND32, POINT32, BOOL32); + /* UpDown */ @@ -477,7 +483,6 @@ BOOL32 WINAPI InitializeFlatSB(HWND32); HRESULT WINAPI UninitializeFlatSB(HWND32); - /* Header control */ #define WC_HEADER16 "SysHeader" @@ -1200,6 +1205,7 @@ typedef struct tagNMTTDISPINFOW #define LPTOOLTIPTEXTA LPNMTTDISPINFOA #define LPTOOLTIPTEXT LPNMTTDISPINFO + /* Rebar control */ #define REBARCLASSNAME16 "ReBarWindow" @@ -1283,7 +1289,7 @@ typedef struct tagNMTTDISPINFOW #define RB_GETBANDINFO WINELIB_NAME_AW(RB_GETBANDINFO) #define RB_MINIMIZEBAND (WM_USER+30) #define RB_MAXIMIZEBAND (WM_USER+31) -#define RB_GETBANDORDERS (WM_USER+34) +#define RB_GETBANDBORDERS (WM_USER+34) #define RB_SHOWBAND (WM_USER+35) #define RB_SETPALETTE (WM_USER+37) #define RB_GETPALETTE (WM_USER+38) @@ -1613,6 +1619,8 @@ typedef struct #define TVM_GETTEXTCOLOR (TV_FIRST+32) #define TVM_SETSCROLLTIME (TV_FIRST+33) #define TVM_GETSCROLLTIME (TV_FIRST+34) +#define TVM_UNKNOWN35 (TV_FIRST+35) +#define TVM_UNKNOWN36 (TV_FIRST+36) #define TVM_SETINSERTMARKCOLOR (TV_FIRST+37) #define TVM_GETINSERTMARKCOLOR (TV_FIRST+38) #define TVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT @@ -1741,11 +1749,11 @@ typedef struct { HTREEITEM hItem; UINT32 state; UINT32 stateMask; - LPSTR pszText; - int cchTextMax; - int iImage; - int iSelectedImage; - int cChildren; + LPSTR pszText; + INT32 cchTextMax; + INT32 iImage; + INT32 iSelectedImage; + INT32 cChildren; LPARAM lParam; } TV_ITEM, *LPTVITEM; @@ -1754,13 +1762,13 @@ typedef struct { HTREEITEM hItem; UINT32 state; UINT32 stateMask; - LPSTR pszText; - int cchTextMax; - int iImage; - int iSelectedImage; - int cChildren; + LPSTR pszText; + INT32 cchTextMax; + INT32 iImage; + INT32 iSelectedImage; + INT32 cChildren; LPARAM lParam; - int iIntegral; + INT32 iIntegral; } TV_ITEMEX, *LPTVITEMEX; #define TVITEM TV_ITEM @@ -2437,8 +2445,8 @@ typedef struct tagTCITEM32A { UINT32 dwState; UINT32 dwStateMask; LPSTR pszText; - int cchTextMax; - int iImage; + INT32 cchTextMax; + INT32 iImage; LPARAM lParam; } TCITEM32A, *LPTCITEM32A; @@ -2667,114 +2675,14 @@ typedef struct tagNMIPADDRESS -/************************************************************************** - * UNDOCUMENTED functions - */ - -/* private heap memory functions */ - -LPVOID WINAPI COMCTL32_Alloc (DWORD); -LPVOID WINAPI COMCTL32_ReAlloc (LPVOID, DWORD); -BOOL32 WINAPI COMCTL32_Free (LPVOID); -DWORD WINAPI COMCTL32_GetSize (LPVOID); - - -INT32 WINAPI Str_GetPtr32A (LPCSTR, LPSTR, INT32); -BOOL32 WINAPI Str_SetPtr32A (LPSTR *, LPCSTR); -INT32 WINAPI Str_GetPtr32W (LPCWSTR, LPWSTR, INT32); -BOOL32 WINAPI Str_SetPtr32W (LPWSTR *, LPCWSTR); -#define Str_GetPtr WINELIB_NAME_AW(Str_GetPtr) -#define Str_SetPtr WINELIB_NAME_AW(Str_SetPtr) - - -/* Dynamic Storage Array */ - -typedef struct _DSA -{ - INT32 nItemCount; - LPVOID pData; - INT32 nMaxCount; - INT32 nItemSize; - INT32 nGrow; -} DSA, *HDSA; - -HDSA WINAPI DSA_Create (INT32, INT32); -BOOL32 WINAPI DSA_DeleteAllItems (const HDSA); -INT32 WINAPI DSA_DeleteItem (const HDSA, INT32); -BOOL32 WINAPI DSA_Destroy (const HDSA); -BOOL32 WINAPI DSA_GetItem (const HDSA, INT32, LPVOID); -LPVOID WINAPI DSA_GetItemPtr (const HDSA, INT32); -INT32 WINAPI DSA_InsertItem (const HDSA, INT32, LPVOID); -BOOL32 WINAPI DSA_SetItem (const HDSA, INT32, LPVOID); - -typedef INT32 (CALLBACK *DSAENUMPROC)(LPVOID, DWORD); -VOID WINAPI DSA_EnumCallback (const HDSA, DSAENUMPROC, LPARAM); -BOOL32 WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM); - - -/* Dynamic Pointer Array */ - -typedef struct _DPA -{ - INT32 nItemCount; - LPVOID *ptrs; - HANDLE32 hHeap; - INT32 nGrow; - INT32 nMaxCount; -} DPA, *HDPA; - -HDPA WINAPI DPA_Create (INT32); -HDPA WINAPI DPA_CreateEx (INT32, HANDLE32); -BOOL32 WINAPI DPA_Destroy (const HDPA); -HDPA WINAPI DPA_Clone (const HDPA, const HDPA); -LPVOID WINAPI DPA_GetPtr (const HDPA, INT32); -INT32 WINAPI DPA_GetPtrIndex (const HDPA, LPVOID); -BOOL32 WINAPI DPA_Grow (const HDPA, INT32); -BOOL32 WINAPI DPA_SetPtr (const HDPA, INT32, LPVOID); -INT32 WINAPI DPA_InsertPtr (const HDPA, INT32, LPVOID); -LPVOID WINAPI DPA_DeletePtr (const HDPA, INT32); -BOOL32 WINAPI DPA_DeleteAllPtrs (const HDPA); - -typedef INT32 (CALLBACK *PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM); -BOOL32 WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM); - -#define DPAS_SORTED 0x0001 -#define DPAS_INSERTBEFORE 0x0002 -#define DPAS_INSERTAFTER 0x0004 - -INT32 WINAPI DPA_Search (const HDPA, LPVOID, INT32, PFNDPACOMPARE, LPARAM, UINT32); - -#define DPAM_SORT 0x0001 - -BOOL32 WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, LPVOID, LPARAM); - -typedef INT32 (CALLBACK *DPAENUMPROC)(LPVOID, DWORD); -VOID WINAPI DPA_EnumCallback (const HDPA, DPAENUMPROC, LPARAM); -BOOL32 WINAPI DPA_DestroyCallback (const HDPA, DPAENUMPROC, LPARAM); - - -#define DPA_GetPtrCount(hdpa) (*(INT32*)(hdpa)) -#define DPA_GetPtrPtr(hdpa) (*((LPVOID**)((BYTE*)(hdpa)+sizeof(INT32)))) -#define DPA_FastGetPtr(hdpa,i) (DPA_GetPtrPtr(hdpa)[i]) - - -/* notification helper functions */ - -LRESULT WINAPI COMCTL32_SendNotify (HWND32, HWND32, UINT32, LPNMHDR); - -/* type and functionality of last parameter is still unknown */ -LRESULT WINAPI COMCTL32_SendNotifyEx (HWND32, HWND32, UINT32, LPNMHDR, DWORD); - /* * Property sheet support (callback procs) */ - -#define WC_PROPSHEET32A "SysPager" -#define WC_PROPSHEET32W L"SysPager" +#define WC_PROPSHEET32A "SysPropertySheet" +#define WC_PROPSHEET32W L"SysPropertySheet" #define WC_PROPSHEET WINELIB_NAME_AW(WC_PROPSHEET) - struct _PROPSHEETPAGE32A; /** need to forward declare those structs **/ struct _PROPSHEETPAGE32W; struct _PSP; @@ -2945,7 +2853,7 @@ INT32 WINAPI PropertySheet32A(LPCPROPSHEETHEADER32A); INT32 WINAPI PropertySheet32W(LPCPROPSHEETHEADER32W); #define PropertySheet WINELIB_NAME_AW(PropertySheet) HPROPSHEETPAGE WINAPI CreatePropertySheetPage32A(LPCPROPSHEETPAGE32A); -HPROPSHEETPAGE WINAPI CreatePropertySheetPage32W(LPCPROPSHEETPAGE32W); +HPROPSHEETPAGE WINAPI CreatePropertySheetPage32W(LPCPROPSHEETPAGE32W); #define CreatePropertySheetPage WINELIB_NAME_AW(CreatePropertySheetPage) BOOL32 WINAPI DestroyPropertySheetPage32(HPROPSHEETPAGE hPropPage); #define DestroyPropertySheetPage WINELIB_NAME(DestroyPropertySheetPage) @@ -2953,6 +2861,7 @@ BOOL32 WINAPI DestroyPropertySheetPage32(HPROPSHEETPAGE hPropPage); /* * Property sheet support (UNICODE-WineLib) */ + DECL_WINELIB_TYPE_AW(PROPSHEETPAGE) DECL_WINELIB_TYPE_AW(LPPROPSHEETPAGE) DECL_WINELIB_TYPE_AW(LPCPROPSHEETPAGE) @@ -2962,6 +2871,7 @@ DECL_WINELIB_TYPE_AW(LPCPROPSHEETHEADER) DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK) DECL_WINELIB_TYPE(PFNPROPSHEETCALLBACK) + /* * Property sheet support (defines) */ @@ -3080,7 +2990,7 @@ DECL_WINELIB_TYPE(PFNPROPSHEETCALLBACK) */ #define PropSheet_SetCurSel(hDlg, hpage, index) \ - SNDMSG(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage) + SeandMessage32A(hDlg, PSM_SETCURSEL, (WPARAM32)index, (LPARAM)hpage) #define PropSheet_RemovePage(hDlg, index, hpage) \ SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage) @@ -3134,6 +3044,104 @@ DECL_WINELIB_TYPE(PFNPROPSHEETCALLBACK) (HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L) +/************************************************************************** + * UNDOCUMENTED functions + */ + +/* private heap memory functions */ + +LPVOID WINAPI COMCTL32_Alloc (DWORD); +LPVOID WINAPI COMCTL32_ReAlloc (LPVOID, DWORD); +BOOL32 WINAPI COMCTL32_Free (LPVOID); +DWORD WINAPI COMCTL32_GetSize (LPVOID); + + +INT32 WINAPI Str_GetPtr32A (LPCSTR, LPSTR, INT32); +BOOL32 WINAPI Str_SetPtr32A (LPSTR *, LPCSTR); +INT32 WINAPI Str_GetPtr32W (LPCWSTR, LPWSTR, INT32); +BOOL32 WINAPI Str_SetPtr32W (LPWSTR *, LPCWSTR); +#define Str_GetPtr WINELIB_NAME_AW(Str_GetPtr) +#define Str_SetPtr WINELIB_NAME_AW(Str_SetPtr) + + +/* Dynamic Storage Array */ + +typedef struct _DSA +{ + INT32 nItemCount; + LPVOID pData; + INT32 nMaxCount; + INT32 nItemSize; + INT32 nGrow; +} DSA, *HDSA; + +HDSA WINAPI DSA_Create (INT32, INT32); +BOOL32 WINAPI DSA_DeleteAllItems (const HDSA); +INT32 WINAPI DSA_DeleteItem (const HDSA, INT32); +BOOL32 WINAPI DSA_Destroy (const HDSA); +BOOL32 WINAPI DSA_GetItem (const HDSA, INT32, LPVOID); +LPVOID WINAPI DSA_GetItemPtr (const HDSA, INT32); +INT32 WINAPI DSA_InsertItem (const HDSA, INT32, LPVOID); +BOOL32 WINAPI DSA_SetItem (const HDSA, INT32, LPVOID); + +typedef INT32 (CALLBACK *DSAENUMPROC)(LPVOID, DWORD); +VOID WINAPI DSA_EnumCallback (const HDSA, DSAENUMPROC, LPARAM); +BOOL32 WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM); + + +/* Dynamic Pointer Array */ + +typedef struct _DPA +{ + INT32 nItemCount; + LPVOID *ptrs; + HANDLE32 hHeap; + INT32 nGrow; + INT32 nMaxCount; +} DPA, *HDPA; + +HDPA WINAPI DPA_Create (INT32); +HDPA WINAPI DPA_CreateEx (INT32, HANDLE32); +BOOL32 WINAPI DPA_Destroy (const HDPA); +HDPA WINAPI DPA_Clone (const HDPA, const HDPA); +LPVOID WINAPI DPA_GetPtr (const HDPA, INT32); +INT32 WINAPI DPA_GetPtrIndex (const HDPA, LPVOID); +BOOL32 WINAPI DPA_Grow (const HDPA, INT32); +BOOL32 WINAPI DPA_SetPtr (const HDPA, INT32, LPVOID); +INT32 WINAPI DPA_InsertPtr (const HDPA, INT32, LPVOID); +LPVOID WINAPI DPA_DeletePtr (const HDPA, INT32); +BOOL32 WINAPI DPA_DeleteAllPtrs (const HDPA); + +typedef INT32 (CALLBACK *PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM); +BOOL32 WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM); + +#define DPAS_SORTED 0x0001 +#define DPAS_INSERTBEFORE 0x0002 +#define DPAS_INSERTAFTER 0x0004 + +INT32 WINAPI DPA_Search (const HDPA, LPVOID, INT32, PFNDPACOMPARE, LPARAM, UINT32); + +#define DPAM_SORT 0x0001 + +BOOL32 WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, LPVOID, LPARAM); + +typedef INT32 (CALLBACK *DPAENUMPROC)(LPVOID, DWORD); +VOID WINAPI DPA_EnumCallback (const HDPA, DPAENUMPROC, LPARAM); +BOOL32 WINAPI DPA_DestroyCallback (const HDPA, DPAENUMPROC, LPARAM); + + +#define DPA_GetPtrCount(hdpa) (*(INT32*)(hdpa)) +#define DPA_GetPtrPtr(hdpa) (*((LPVOID**)((BYTE*)(hdpa)+sizeof(INT32)))) +#define DPA_FastGetPtr(hdpa,i) (DPA_GetPtrPtr(hdpa)[i]) + + +/* notification helper functions */ + +LRESULT WINAPI COMCTL32_SendNotify (HWND32, HWND32, UINT32, LPNMHDR); + +/* type and functionality of last parameter is still unknown */ +LRESULT WINAPI COMCTL32_SendNotifyEx (HWND32, HWND32, UINT32, LPNMHDR, DWORD); + #ifdef __cplusplus } #endif diff --git a/relay32/comctl32.spec b/relay32/comctl32.spec index 6eabd41bb5..69d45bba52 100644 --- a/relay32/comctl32.spec +++ b/relay32/comctl32.spec @@ -18,21 +18,21 @@ init COMCTL32_LibMain 10 stub COMCTL32_10 11 stdcall DPA_Merge(ptr ptr long ptr ptr long) DPA_Merge #12 stub Cctl1632_ThunkData32 - 13 stub MakeDragList - 14 stub LBItemFromPt - 15 stub DrawInsert + 13 stdcall MakeDragList(long) MakeDragList + 14 stdcall LBItemFromPt(long long long) LBItemFromPt + 15 stdcall DrawInsert(long long long) DrawInsert 16 stdcall CreateUpDownControl(long long long long long long long long long long long long) CreateUpDownControl 17 stdcall InitCommonControls() InitCommonControls - 18 stdcall CreatePropertySheetPage(ptr) CreatePropertySheetPage32AW + 18 stdcall CreatePropertySheetPage(ptr) CreatePropertySheetPage32A 19 stdcall CreatePropertySheetPageA(ptr) CreatePropertySheetPage32A 20 stdcall CreatePropertySheetPageW(ptr) CreatePropertySheetPage32W - 21 stdcall CreateStatusWindow(long str long long) CreateStatusWindow32AW + 21 stdcall CreateStatusWindow(long str long long) CreateStatusWindow32A 22 stdcall CreateStatusWindowW(long wstr long long) CreateStatusWindow32W 23 stdcall CreateToolbarEx(long long long long long long ptr long long long long long long) CreateToolbarEx 24 stdcall DestroyPropertySheetPage(long) DestroyPropertySheetPage32 25 stdcall DllGetVersion(ptr) COMCTL32_DllGetVersion 26 stub DllInstall - 27 stdcall DrawStatusText(long ptr ptr long) DrawStatusText32AW + 27 stdcall DrawStatusText(long ptr ptr long) DrawStatusText32A 28 stdcall DrawStatusTextW(long ptr wstr long) DrawStatusText32W 29 stdcall FlatSB_EnableScrollBar (long long long) FlatSB_EnableScrollBar 30 stdcall FlatSB_GetScrollInfo (long long ptr) FlatSB_GetScrollInfo @@ -67,7 +67,7 @@ init COMCTL32_LibMain 59 stdcall ImageList_GetImageCount(ptr) ImageList_GetImageCount 60 stdcall ImageList_GetImageInfo(ptr long ptr) ImageList_GetImageInfo 61 stdcall ImageList_GetImageRect(ptr long ptr) ImageList_GetImageRect - 62 stdcall ImageList_LoadImage(long str long long long long long) ImageList_LoadImage32AW + 62 stdcall ImageList_LoadImage(long str long long long long long) ImageList_LoadImage32A 63 stdcall ImageList_LoadImageA(long str long long long long long) ImageList_LoadImage32A 64 stdcall ImageList_LoadImageW(long wstr long long long long long) ImageList_LoadImage32W 65 stdcall ImageList_Merge(ptr long ptr long long long) ImageList_Merge @@ -88,7 +88,7 @@ init COMCTL32_LibMain 80 stdcall ImageList_Write(ptr ptr) ImageList_Write 81 stdcall InitCommonControlsEx(ptr) InitCommonControlsEx 82 stdcall InitializeFlatSB(long) InitializeFlatSB - 83 stdcall PropertySheet(ptr) PropertySheet32AW + 83 stdcall PropertySheet(ptr) PropertySheet32A 84 stdcall PropertySheetA(ptr) PropertySheet32A 85 stdcall PropertySheetW(ptr) PropertySheet32W 86 stdcall UninitializeFlatSB(long) UninitializeFlatSB -- 2.32.0.93.g670b81a890