Commit 9c507303 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Get rid of generic notification support in comctrl32. The MS docs were

misleading in that all controls send these notifications. They don't.
parent 57200073
...@@ -132,134 +132,6 @@ BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc); ...@@ -132,134 +132,6 @@ BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc);
#define WINE_FILEVERSION 5, COMCTL32_VERSION_MINOR, 0, 0 #define WINE_FILEVERSION 5, COMCTL32_VERSION_MINOR, 0, 0
#define WINE_FILEVERSIONSTR "5.00" #define WINE_FILEVERSIONSTR "5.00"
/* Notification support */
inline static LRESULT send_notify(HWND hwnd, UINT code, NMHDR *hdr)
{
hdr->hwndFrom = hwnd;
hdr->idFrom = GetWindowLongW (hwnd, GWL_ID);
hdr->code = code;
return SendMessageW (GetParent(hwnd), WM_NOTIFY, hdr->idFrom, (LPARAM)hdr);
}
inline static LRESULT hwnd_notify(HWND hwnd, UINT code)
{
NMHDR hdr;
return send_notify(hwnd, code, &hdr);
}
inline static BOOL hwnd_notify_char(HWND hwnd, UINT ch, DWORD prev, DWORD next)
{
NMCHAR nmch;
nmch.ch = ch;
nmch.dwItemPrev = prev;
nmch.dwItemNext = next;
return (BOOL)send_notify(hwnd, NM_CHAR, &nmch.hdr);
}
inline static BOOL hwnd_notify_keydown(HWND hwnd, UINT nVKey, UINT uFlags)
{
NMKEY nmk;
nmk.nVKey = nVKey;
nmk.uFlags = uFlags;
return (BOOL)send_notify(hwnd, NM_KEYDOWN, &nmk.hdr);
}
inline static DWORD hwnd_notify_mouse(HWND hwnd, UINT code, DWORD spec, DWORD data, POINT *pt, LPARAM dwHitInfo)
{
NMMOUSE nmm;
nmm.dwItemSpec = spec;
nmm.dwItemData = data;
nmm.pt.x = pt->x;
nmm.pt.y = pt->y;
nmm.dwHitInfo = dwHitInfo;
return send_notify(hwnd, code, &nmm.hdr);
}
#define DEFINE_CHAR_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static BOOL notify_char(CTRLINFO *infoPtr, UINT ch, DWORD prev, DWORD next) \
{ return hwnd_notify_char(infoPtr->hwndSelf, ch, prev, next); }
#define DEFINE_CLICK_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_click(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_CLICK); }
#define DEFINE_DBLCLK_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_dblclk(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_DBLCLK); }
#define DEFINE_HOVER_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static BOOL notify_hover(CTRLINFO *infoPtr) \
{ return hwnd_notify(infoPtr->hwndSelf, NM_HOVER); }
#define DEFINE_KEYDOWN_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static BOOL notify_keydown(CTRLINFO *infoPtr, UINT nVKey, UINT uFlags) \
{ return hwnd_notify_keydown(infoPtr->hwndSelf, nVKey, uFlags); }
#define DEFINE_KILLFOCUS_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_killfocus(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_KILLFOCUS); }
#define DEFINE_NCHITTEST_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static DWORD notify_nchittest(CTRLINFO *infoPtr, DWORD spec, DWORD data, POINT *pt, LPARAM dwHitInfo) \
{ return hwnd_notify_mouse(infoPtr->hwndSelf, NM_NCHITTEST, spec, data, pt, dwHitInfo); }
#define DEFINE_OUTOFMEMORY_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_outofmemory(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_OUTOFMEMORY); }
#define DEFINE_RCLICK_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static BOOL notify_rclick(CTRLINFO *infoPtr) \
{ return hwnd_notify(infoPtr->hwndSelf, NM_RCLICK); }
#define DEFINE_RDBLCLK_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_rdblclk(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_RDBLCLK); }
#define DEFINE_RELEASEDCAPTURE_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_releasedcapture(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_RELEASEDCAPTURE); }
#define DEFINE_RETURN_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_return(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_RETURN); }
#define DEFINE_SETCURSOR_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static BOOL notify_setcursor(CTRLINFO *infoPtr, DWORD spec, DWORD data, POINT *pt, LPARAM dwHitInfo) \
{ return hwnd_notify_mouse(infoPtr->hwndSelf, NM_SETCURSOR, spec, data, pt, dwHitInfo); }
#define DEFINE_SETFOCUS_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_setfocus(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_SETFOCUS); }
#define DEFINE_TOOLTIPSCREATED_NOTIFICATION(CTRLINFO, hwndSelf) \
inline static void notify_tooltipscreated(CTRLINFO *infoPtr) \
{ hwnd_notify(infoPtr->hwndSelf, NM_TOOLTIPSCREATED); }
#define DEFINE_COMMON_NOTIFICATIONS(CTRLINFO, hwndSelf) \
DEFINE_CHAR_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_CLICK_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_DBLCLK_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_HOVER_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_KEYDOWN_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_KILLFOCUS_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_NCHITTEST_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_OUTOFMEMORY_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_RCLICK_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_RDBLCLK_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_RELEASEDCAPTURE_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_RETURN_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_SETCURSOR_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_SETFOCUS_NOTIFICATION(CTRLINFO, hwndSelf) \
DEFINE_TOOLTIPSCREATED_NOTIFICATION(CTRLINFO, hwndSelf) \
struct __forward_dummy_struc_dec_to_catch_missing_semicolon
/* Our internal stack structure of the window procedures to subclass */ /* Our internal stack structure of the window procedures to subclass */
typedef struct typedef struct
{ {
......
...@@ -68,8 +68,6 @@ typedef struct ...@@ -68,8 +68,6 @@ typedef struct
LPLONG tics; LPLONG tics;
} TRACKBAR_INFO; } TRACKBAR_INFO;
DEFINE_COMMON_NOTIFICATIONS(TRACKBAR_INFO, hwndSelf);
#define TB_REFRESH_TIMER 1 #define TB_REFRESH_TIMER 1
#define TB_REFRESH_DELAY 500 #define TB_REFRESH_DELAY 500
...@@ -122,7 +120,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr) ...@@ -122,7 +120,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
(nrTics+1)*sizeof (DWORD)); (nrTics+1)*sizeof (DWORD));
if (!infoPtr->tics) { if (!infoPtr->tics) {
infoPtr->uNumTics = 0; infoPtr->uNumTics = 0;
notify_outofmemory(infoPtr); TRACKBAR_SendNotify(infoPtr, NM_OUTOFMEMORY);
return; return;
} }
infoPtr->uNumTics = nrTics; infoPtr->uNumTics = nrTics;
...@@ -1152,7 +1150,7 @@ TRACKBAR_SetTic (TRACKBAR_INFO *infoPtr, LONG lPos) ...@@ -1152,7 +1150,7 @@ TRACKBAR_SetTic (TRACKBAR_INFO *infoPtr, LONG lPos)
(infoPtr->uNumTics)*sizeof (DWORD)); (infoPtr->uNumTics)*sizeof (DWORD));
if (!infoPtr->tics) { if (!infoPtr->tics) {
infoPtr->uNumTics = 0; infoPtr->uNumTics = 0;
notify_outofmemory(infoPtr); TRACKBAR_SendNotify(infoPtr, NM_OUTOFMEMORY);
return FALSE; return FALSE;
} }
infoPtr->tics[infoPtr->uNumTics-1] = lPos; infoPtr->tics[infoPtr->uNumTics-1] = lPos;
...@@ -1269,7 +1267,7 @@ TRACKBAR_Create (HWND hwnd, LPCREATESTRUCTW lpcs) ...@@ -1269,7 +1267,7 @@ TRACKBAR_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
if (infoPtr->hwndToolTip) { if (infoPtr->hwndToolTip) {
TTTOOLINFOW ti; TTTOOLINFOW ti;
notify_tooltipscreated(infoPtr); TRACKBAR_SendNotify(infoPtr, NM_TOOLTIPSCREATED);
ZeroMemory (&ti, sizeof(ti)); ZeroMemory (&ti, sizeof(ti));
ti.cbSize = sizeof(ti); ti.cbSize = sizeof(ti);
...@@ -1340,7 +1338,7 @@ TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) ...@@ -1340,7 +1338,7 @@ TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts)
TRACKBAR_SendNotify (infoPtr, TB_ENDTRACK); TRACKBAR_SendNotify (infoPtr, TB_ENDTRACK);
infoPtr->flags &= ~TB_DRAG_MODE; infoPtr->flags &= ~TB_DRAG_MODE;
ReleaseCapture (); ReleaseCapture ();
notify_releasedcapture(infoPtr); TRACKBAR_SendNotify(infoPtr, NM_RELEASEDCAPTURE);
TRACKBAR_ActivateToolTip(infoPtr, FALSE); TRACKBAR_ActivateToolTip(infoPtr, FALSE);
TRACKBAR_InvalidateThumb(infoPtr, infoPtr->lPos); TRACKBAR_InvalidateThumb(infoPtr, infoPtr->lPos);
} }
...@@ -1348,7 +1346,7 @@ TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) ...@@ -1348,7 +1346,7 @@ TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts)
KillTimer (infoPtr->hwndSelf, TB_REFRESH_TIMER); KillTimer (infoPtr->hwndSelf, TB_REFRESH_TIMER);
infoPtr->flags &= ~TB_AUTO_PAGE; infoPtr->flags &= ~TB_AUTO_PAGE;
ReleaseCapture (); ReleaseCapture ();
notify_releasedcapture(infoPtr); TRACKBAR_SendNotify(infoPtr, NM_RELEASEDCAPTURE);
} }
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment