Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This one is used in a lot of code so it makes sense to be just like the others.
include/winuser.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/winuser.h b/include/winuser.h index 6300cc9..3cffaa1 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -4052,7 +4052,6 @@ WINUSERAPI UINT WINAPI PrivateExtractIconExA(LPCSTR,int,HICON*,HICON*,UIN WINUSERAPI UINT WINAPI PrivateExtractIconExW(LPCWSTR,int,HICON*,HICON*,UINT); WINUSERAPI UINT WINAPI PrivateExtractIconsA(LPCSTR,int,int,int,HICON*,UINT*,UINT,UINT); WINUSERAPI UINT WINAPI PrivateExtractIconsW(LPCWSTR,int,int,int,HICON*,UINT*,UINT,UINT); -WINUSERAPI BOOL WINAPI PtInRect(const RECT*,POINT); WINUSERAPI HWND WINAPI RealChildWindowFromPoint(HWND,POINT); WINUSERAPI UINT WINAPI RealGetWindowClassA(HWND,LPSTR,UINT); WINUSERAPI UINT WINAPI RealGetWindowClassW(HWND,LPWSTR,UINT); @@ -4281,6 +4280,7 @@ WINUSERAPI BOOL WINAPI EqualRect(const RECT*,const RECT*); WINUSERAPI BOOL WINAPI InflateRect(LPRECT,INT,INT); WINUSERAPI BOOL WINAPI IsRectEmpty(const RECT*); WINUSERAPI BOOL WINAPI OffsetRect(LPRECT,INT,INT); +WINUSERAPI BOOL WINAPI PtInRect(const RECT*,POINT); WINUSERAPI BOOL WINAPI SetRect(LPRECT,INT,INT,INT,INT); WINUSERAPI BOOL WINAPI SetRectEmpty(LPRECT);
@@ -4321,6 +4321,13 @@ static inline BOOL WINAPI OffsetRect(LPRECT rect, INT x, INT y) return TRUE; }
+static inline BOOL WINAPI PtInRect(const RECT *rect, POINT pt) +{ + if (!rect) return FALSE; + return ((pt.x >= rect->left) && (pt.x < rect->right) && + (pt.y >= rect->top) && (pt.y < rect->bottom)); +} + static inline BOOL WINAPI SetRect(LPRECT rect, INT left, INT top, INT right, INT bottom) { if (!rect) return FALSE;
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
Apparently, there are some places in the Wine code where it helps to keep CopyRect, so this does have uses after all. (see replies to patch series from 156204)
include/winuser.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/winuser.h b/include/winuser.h index 3cffaa1..40017ae 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3552,7 +3552,6 @@ WINUSERAPI INT WINAPI CopyAcceleratorTableW(HACCEL,LPACCEL,INT); #define CopyCursor(cur) ((HCURSOR)CopyIcon((HICON)(cur))) WINUSERAPI HICON WINAPI CopyIcon(HICON); WINUSERAPI HANDLE WINAPI CopyImage(HANDLE,UINT,INT,INT,UINT); -WINUSERAPI BOOL WINAPI CopyRect(RECT*,const RECT*); WINUSERAPI INT WINAPI CountClipboardFormats(void); WINUSERAPI HACCEL WINAPI CreateAcceleratorTableA(LPACCEL,INT); WINUSERAPI HACCEL WINAPI CreateAcceleratorTableW(LPACCEL,INT); @@ -4276,6 +4275,7 @@ WINUSERAPI INT WINAPI wvsprintfW(LPWSTR,LPCWSTR,__ms_va_list);
#if !defined(__WINESRC__) || defined(WINE_NO_INLINE_RECT)
+WINUSERAPI BOOL WINAPI CopyRect(RECT*,const RECT*); WINUSERAPI BOOL WINAPI EqualRect(const RECT*,const RECT*); WINUSERAPI BOOL WINAPI InflateRect(LPRECT,INT,INT); WINUSERAPI BOOL WINAPI IsRectEmpty(const RECT*); @@ -4288,6 +4288,13 @@ WINUSERAPI BOOL WINAPI SetRectEmpty(LPRECT);
/* Inline versions of common RECT helpers */
+static inline BOOL WINAPI CopyRect(RECT *dest, const RECT *src) +{ + if (!dest || !src) return FALSE; + *dest = *src; + return TRUE; +} + static inline BOOL WINAPI EqualRect(const RECT *rect1, const RECT *rect2) { if (!rect1 || !rect2) return FALSE;
Gabriel Ivăncescu gabrielopcode@gmail.com writes:
CopyRect() may be useful in a couple of places, but not enough to justify adding an inline version. It's treated differently because we actually want to encourage using the open-coded variant, unlike for the other functions.