From 1084a8ba93101fccd2e0e3d8be558010b665d076 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 17 Sep 2003 04:31:27 +0000 Subject: [PATCH] Moved out of windef.h a few definitions that don't belong there (reported by Filip Navara). --- controls/combo.c | 5 +++-- dlls/comctl32/trackbar.c | 4 +--- dlls/oleaut32/parsedt.h | 1 + include/windef.h | 13 ------------- include/wine/windef16.h | 5 +++++ include/winuser.h | 5 +++++ include/wtypes.h | 8 ++++---- include/wtypes.idl | 6 ++++-- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/controls/combo.c b/controls/combo.c index 3a2d0004bf0..29cf11fa934 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -2100,8 +2100,9 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, if (wParam & (MK_SHIFT | MK_CONTROL)) return unicode ? DefWindowProcW(hwnd, message, wParam, lParam) : DefWindowProcA(hwnd, message, wParam, lParam); - if (SHIWORD(wParam) > 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_UP, 0); - if (SHIWORD(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0); + + if (GET_WHEEL_DELTA_WPARAM(wParam) > 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_UP, 0); + if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) return SendMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0); return TRUE; /* Combo messages */ diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 009b981b2ce..d27d9532d8f 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1488,7 +1488,7 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) { DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE); INT clickPlace = (dwStyle & TBS_VERT) ? pts.y : pts.x; - DOUBLE dragPos, oldPos = infoPtr->lPos; + LONG dragPos, oldPos = infoPtr->lPos; TRACE("(x=%d. y=%d)\n", pts.x, pts.y); @@ -1503,8 +1503,6 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, POINTS pts) dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, dwStyle & TBS_VERT); - if (dragPos > ((INT)dragPos) + 0.5) dragPos++; - if (dragPos == oldPos) return TRUE; infoPtr->lPos = dragPos; diff --git a/dlls/oleaut32/parsedt.h b/dlls/oleaut32/parsedt.h index 8c8c7bc12a7..7a3b6730c07 100644 --- a/dlls/oleaut32/parsedt.h +++ b/dlls/oleaut32/parsedt.h @@ -48,6 +48,7 @@ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include #include "windef.h" #include "winbase.h" +#include "wtypes.h" /* ---------------------------------------------------------------- * Section 1: bool, true, false, TRUE, FALSE diff --git a/include/windef.h b/include/windef.h index 974761f2c56..4841843ab0c 100644 --- a/include/windef.h +++ b/include/windef.h @@ -176,8 +176,6 @@ typedef long *LPLONG; typedef unsigned long DWORD, *PDWORD, *LPDWORD; typedef unsigned long ULONG, *PULONG; typedef float FLOAT, *PFLOAT; -typedef double DOUBLE; -typedef double DATE; #include @@ -212,8 +210,6 @@ typedef LONG_PTR LRESULT; /* Integer types */ typedef WORD ATOM; -typedef WORD CATCHBUF[9]; -typedef WORD *LPCATCHBUF; typedef DWORD COLORREF, *LPCOLORREF; @@ -270,17 +266,8 @@ typedef INT (CALLBACK *PROC)(); #define LOWORD(l) ((WORD)(DWORD)(l)) #define HIWORD(l) ((WORD)((DWORD)(l) >> 16)) -#define SLOWORD(l) ((SHORT)(LONG)(l)) -#define SHIWORD(l) ((SHORT)((LONG)(l) >> 16)) - #define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8)) #define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16))) -#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high)) -#define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high)) -#define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high)) - -#define SELECTOROF(ptr) (HIWORD(ptr)) -#define OFFSETOF(ptr) (LOWORD(ptr)) /* min and max macros */ #ifndef NOMINMAX diff --git a/include/wine/windef16.h b/include/wine/windef16.h index d869793d63c..aa2ccd55751 100644 --- a/include/wine/windef16.h +++ b/include/wine/windef16.h @@ -41,7 +41,12 @@ typedef UINT16 WPARAM16; typedef INT16 *LPINT16; typedef UINT16 *LPUINT16; +typedef WORD CATCHBUF[9]; +typedef WORD *LPCATCHBUF; + #define MAKESEGPTR(seg,off) ((SEGPTR)MAKELONG(off,seg)) +#define SELECTOROF(ptr) (HIWORD(ptr)) +#define OFFSETOF(ptr) (LOWORD(ptr)) typedef WORD *VA_LIST16; diff --git a/include/winuser.h b/include/winuser.h index df0554069ab..bb8bf04239a 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -1097,6 +1097,8 @@ BOOL WINAPI SetSysColors(INT,const INT*,const COLORREF*); #define WHEEL_DELTA 120 #define WHEEL_PAGESCROLL (UINT_MAX) +#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam)) + #define WM_PARENTNOTIFY 0x0210 #define WM_ENTERMENULOOP 0x0211 #define WM_EXITMENULOOP 0x0212 @@ -1785,6 +1787,9 @@ typedef struct tagMSG #define POINTTOPOINTS(pt) (MAKELONG((short)((pt).x), (short)((pt).y))) +#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high)) +#define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high)) +#define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high)) /* Cursors / Icons */ diff --git a/include/wtypes.h b/include/wtypes.h index 4a1950ba3a5..bd500ddcc54 100644 --- a/include/wtypes.h +++ b/include/wtypes.h @@ -34,8 +34,6 @@ typedef unsigned long ULONG; typedef float FLOAT; -typedef double DOUBLE; - typedef void *PVOID, *LPVOID; typedef char CHAR; @@ -80,8 +78,6 @@ typedef void *HICON; typedef LONG_PTR LRESULT; -typedef double DATE; - typedef LONG HRESULT; typedef DWORD LCID; @@ -188,6 +184,8 @@ typedef struct tagMSG { } MSG, *PMSG, *NPMSG, *LPMSG; #endif /* winnt.h */ +typedef double DOUBLE; + #ifndef _PALETTEENTRY_DEFINED #define _PALETTEENTRY_DEFINED typedef struct tagPALETTEENTRY { @@ -620,6 +618,8 @@ typedef enum tagSTATFLAG { STATFLAG_NOOPEN = 2 } STATFLAG; +typedef double DATE; + #if 0 typedef struct tagCY { LONGLONG int64; diff --git a/include/wtypes.idl b/include/wtypes.idl index a4c000bce00..ade2dc4b532 100644 --- a/include/wtypes.idl +++ b/include/wtypes.idl @@ -45,7 +45,6 @@ typedef unsigned short USHORT; typedef long LONG; typedef unsigned long ULONG; typedef float FLOAT; -typedef double DOUBLE; typedef void *PVOID, *LPVOID; @@ -79,7 +78,6 @@ DECLARE_HANDLE(HICON); typedef LONG_PTR LRESULT; -typedef double DATE; typedef LONG HRESULT; typedef DWORD LCID; @@ -186,6 +184,8 @@ typedef struct tagMSG cpp_quote("#endif /* winnt.h */") +typedef double DOUBLE; + cpp_quote("#ifndef _PALETTEENTRY_DEFINED") cpp_quote("#define _PALETTEENTRY_DEFINED") typedef struct tagPALETTEENTRY { @@ -575,6 +575,8 @@ typedef enum tagSTATFLAG { /******************** OLE Automation ********************/ +typedef double DATE; + cpp_quote("#if 0") /* for IDL only */ typedef struct tagCY { LONGLONG int64;