Commit 62e51da2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use winuser.h inline rect helpers.

parent 949edcec
......@@ -48,18 +48,18 @@ BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords *
if ((src->width == dst->width) && (src->height == dst->height)) /* no stretching */
{
offset_rect( &src->visrect, dst->x - src->x, dst->y - src->y );
OffsetRect( &src->visrect, dst->x - src->x, dst->y - src->y );
if (!intersect_rect( &rect, &src->visrect, &dst->visrect )) return FALSE;
src->visrect = dst->visrect = rect;
offset_rect( &src->visrect, src->x - dst->x, src->y - dst->y );
OffsetRect( &src->visrect, src->x - dst->x, src->y - dst->y );
}
else /* stretching */
{
/* map source rectangle into destination coordinates */
rect = src->visrect;
offset_rect( &rect,
-src->x - (src->width < 0 ? 1 : 0),
-src->y - (src->height < 0 ? 1 : 0));
OffsetRect( &rect,
-src->x - (src->width < 0 ? 1 : 0),
-src->y - (src->height < 0 ? 1 : 0) );
rect.left = rect.left * dst->width / src->width;
rect.top = rect.top * dst->height / src->height;
rect.right = rect.right * dst->width / src->width;
......@@ -82,7 +82,7 @@ BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords *
(src->y < src->visrect.top || src->y + src->height > src->visrect.bottom))
dst->y -= rect.bottom - (dst->height - rect.top);
offset_rect( &rect, dst->x, dst->y );
OffsetRect( &rect, dst->x, dst->y );
/* avoid rounding errors */
rect.left--;
......@@ -93,9 +93,9 @@ BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords *
/* map destination rectangle back to source coordinates */
rect = dst->visrect;
offset_rect( &rect,
-dst->x - (dst->width < 0 ? 1 : 0),
-dst->y - (dst->height < 0 ? 1 : 0));
OffsetRect( &rect,
-dst->x - (dst->width < 0 ? 1 : 0),
-dst->y - (dst->height < 0 ? 1 : 0) );
rect.left = src->x + rect.left * src->width / dst->width;
rect.top = src->y + rect.top * src->height / dst->height;
rect.right = src->x + rect.right * src->width / dst->width;
......@@ -139,7 +139,7 @@ static BOOL get_vis_rectangles( DC *dc_dst, struct bitblt_coords *dst,
/* get the source visible rectangle */
if (!src) return !is_rect_empty( &dst->visrect );
if (!src) return !IsRectEmpty( &dst->visrect );
rect.left = src->log_x;
rect.top = src->log_y;
......@@ -158,7 +158,7 @@ static BOOL get_vis_rectangles( DC *dc_dst, struct bitblt_coords *dst,
get_bounding_rect( &rect, src->x, src->y, src->width, src->height );
if (!clip_device_rect( dc_src, &src->visrect, &rect )) return FALSE;
if (is_rect_empty( &dst->visrect )) return FALSE;
if (IsRectEmpty( &dst->visrect )) return FALSE;
return intersect_vis_rectangles( dst, src );
}
......@@ -479,7 +479,7 @@ BOOL CDECL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert
src = dst;
src.x -= dst.visrect.left;
src.y -= dst.visrect.top;
offset_rect( &src.visrect, -dst.visrect.left, -dst.visrect.top );
OffsetRect( &src.visrect, -dst.visrect.left, -dst.visrect.top );
for (i = 0; i < nvert; i++)
{
pts[i].x -= dst.visrect.left;
......@@ -992,7 +992,7 @@ BOOL WINAPI NtGdiAlphaBlend( HDC hdcDst, int xDst, int yDst, int widthDst, int h
if (src.x < 0 || src.y < 0 || src.width < 0 || src.height < 0 ||
src.log_width < 0 || src.log_height < 0 ||
(!is_rect_empty( &dcSrc->device_rect ) &&
(!IsRectEmpty( &dcSrc->device_rect ) &&
(src.width > dcSrc->device_rect.right - dcSrc->attr->vis_rect.left - src.x ||
src.height > dcSrc->device_rect.bottom - dcSrc->attr->vis_rect.top - src.y)))
{
......
......@@ -37,8 +37,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipping);
static inline BOOL get_dc_device_rect( DC *dc, RECT *rect )
{
*rect = dc->device_rect;
offset_rect( rect, -dc->attr->vis_rect.left, -dc->attr->vis_rect.top );
return !is_rect_empty( rect );
OffsetRect( rect, -dc->attr->vis_rect.left, -dc->attr->vis_rect.top );
return !IsRectEmpty( rect );
}
/***********************************************************************
......@@ -377,7 +377,7 @@ INT WINAPI NtGdiGetAppClipBox( HDC hdc, RECT *rect )
}
else
{
ret = is_rect_empty( &dc->attr->vis_rect ) ? ERROR : SIMPLEREGION;
ret = IsRectEmpty( &dc->attr->vis_rect ) ? ERROR : SIMPLEREGION;
*rect = dc->attr->vis_rect;
}
......@@ -442,7 +442,7 @@ INT WINAPI NtGdiGetRandomRgn( HDC hDC, HRGN hRgn, INT iCode )
if (NtCurrentTeb()->Peb->OSPlatformId != VER_PLATFORM_WIN32s)
NtGdiOffsetRgn( hRgn, dc->attr->vis_rect.left, dc->attr->vis_rect.top );
}
else if (!is_rect_empty( &dc->device_rect ))
else if (!IsRectEmpty( &dc->device_rect ))
NtGdiSetRectRgn( hRgn, dc->device_rect.left, dc->device_rect.top,
dc->device_rect.right, dc->device_rect.bottom );
else
......
......@@ -1340,7 +1340,7 @@ UINT WINAPI NtGdiGetBoundsRect( HDC hdc, RECT *rect, UINT flags )
if (rect)
{
if (is_rect_empty( &dc->bounds ))
if (IsRectEmpty( &dc->bounds ))
{
rect->left = rect->top = rect->right = rect->bottom = 0;
ret = DCB_RESET;
......@@ -1385,7 +1385,7 @@ UINT WINAPI NtGdiSetBoundsRect( HDC hdc, const RECT *rect, UINT flags )
}
ret = (dc->bounds_enabled ? DCB_ENABLE : DCB_DISABLE) |
(is_rect_empty( &dc->bounds ) ? ret & DCB_SET : DCB_SET);
(IsRectEmpty( &dc->bounds ) ? ret & DCB_SET : DCB_SET);
if (flags & DCB_RESET) reset_bounds( &dc->bounds );
......
......@@ -202,7 +202,7 @@ void create_offscreen_window_surface( const RECT *visible_rect, struct window_su
TRACE( "visible_rect %s, surface %p.\n", wine_dbgstr_rect( visible_rect ), surface );
offset_rect( &surface_rect, -surface_rect.left, -surface_rect.top );
OffsetRect( &surface_rect, -surface_rect.left, -surface_rect.top );
surface_rect.right = (surface_rect.right + 0x1f) & ~0x1f;
surface_rect.bottom = (surface_rect.bottom + 0x1f) & ~0x1f;
......@@ -1319,9 +1319,9 @@ void move_window_bits_parent( HWND hwnd, HWND parent, const RECT *window_rect, c
TRACE( "copying %s -> %s\n", wine_dbgstr_rect( &src ), wine_dbgstr_rect( &dst ));
map_window_points( NtUserGetAncestor( hwnd, GA_PARENT ), parent, (POINT *)&src, 2, get_thread_dpi() );
offset_rect( &src, win->client_rect.left - win->visible_rect.left,
win->client_rect.top - win->visible_rect.top );
offset_rect( &dst, -window_rect->left, -window_rect->top );
OffsetRect( &src, win->client_rect.left - win->visible_rect.left,
win->client_rect.top - win->visible_rect.top );
OffsetRect( &dst, -window_rect->left, -window_rect->top );
window_surface_add_ref( surface );
release_win_ptr( win );
......
......@@ -733,10 +733,10 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
result = lines;
offset_rect( &src.visrect, 0, src_to_dst_offset );
OffsetRect( &src.visrect, 0, src_to_dst_offset );
if (!intersect_rect( &dst.visrect, &src.visrect, &dst.visrect )) goto done;
src.visrect = dst.visrect;
offset_rect( &src.visrect, 0, -src_to_dst_offset );
OffsetRect( &src.visrect, 0, -src_to_dst_offset );
src.x = src.visrect.left;
src.y = src.visrect.top;
......@@ -859,11 +859,11 @@ INT CDECL nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx
rect.bottom = dst.y + cy;
if (!clip_visrect( dc, &dst.visrect, &rect )) goto done;
offset_rect( &src.visrect, dst.x - src.x, dst.y - src.y );
OffsetRect( &src.visrect, dst.x - src.x, dst.y - src.y );
intersect_rect( &rect, &src.visrect, &dst.visrect );
src.visrect = dst.visrect = rect;
offset_rect( &src.visrect, src.x - dst.x, src.y - dst.y );
if (is_rect_empty( &dst.visrect )) goto done;
OffsetRect( &src.visrect, src.x - dst.x, src.y - dst.y );
if (IsRectEmpty( &dst.visrect )) goto done;
if (clip) NtGdiOffsetRgn( clip, dst.x - src.x, dst.y - src.y );
dev = GET_DC_PHYSDEV( dc, pPutImage );
......@@ -1308,10 +1308,10 @@ INT WINAPI NtGdiGetDIBitsInternal( HDC hdc, HBITMAP hbitmap, UINT startscan, UIN
if (lines < dst.visrect.bottom) dst.visrect.bottom = lines;
}
offset_rect( &dst.visrect, 0, dst_to_src_offset );
OffsetRect( &dst.visrect, 0, dst_to_src_offset );
empty_rect = !intersect_rect( &src.visrect, &src.visrect, &dst.visrect );
dst.visrect = src.visrect;
offset_rect( &dst.visrect, 0, -dst_to_src_offset );
OffsetRect( &dst.visrect, 0, -dst_to_src_offset );
if (dst_info->bmiHeader.biHeight > 0)
{
......
......@@ -716,7 +716,7 @@ static DWORD copy_src_bits( dib_info *src, RECT *src_rect )
src->bits.free = free_heap_bits;
src->bits.param = NULL;
offset_rect( src_rect, 0, -src_rect->top );
OffsetRect( src_rect, 0, -src_rect->top );
return ERROR_SUCCESS;
}
......@@ -757,7 +757,7 @@ static DWORD execute_rop( dibdrv_physdev *pdev, const RECT *dst_rect, dib_info *
rects[SRC] = *src_rect;
rects[DST] = *dst_rect;
rects[TMP] = *dst_rect;
offset_rect( &rects[TMP], -rects[TMP].left, -rects[TMP].top );
OffsetRect( &rects[TMP], -rects[TMP].left, -rects[TMP].top );
for ( ; *opcode; opcode++)
{
......@@ -868,7 +868,7 @@ static DWORD get_image_dib_info( dib_info *dib, BITMAPINFO *info,
if (dib->stride < 0) bits->ptr = (char *)bits->ptr + (dib->height - 1) * dib->stride;
src->x += dib->rect.left;
src->y += dib->rect.top;
offset_rect( &src->visrect, dib->rect.left, dib->rect.top );
OffsetRect( &src->visrect, dib->rect.left, dib->rect.top );
}
return ERROR_SUCCESS;
}
......@@ -1275,7 +1275,7 @@ DWORD stretch_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
last_row.top = dst_start.y - v_params.dst_inc;
last_row.bottom = last_row.top + 1;
this_row = last_row;
offset_rect( &this_row, 0, v_params.dst_inc );
OffsetRect( &this_row, 0, v_params.dst_inc );
copy_rect( &dst_dib, &this_row, &dst_dib, &last_row, NULL, R2_COPYPEN );
}
......@@ -1315,7 +1315,7 @@ done:
*src = *dst;
src->x -= src->visrect.left;
src->y -= src->visrect.top;
offset_rect( &src->visrect, -src->visrect.left, -src->visrect.top );
OffsetRect( &src->visrect, -src->visrect.left, -src->visrect.top );
return ERROR_SUCCESS;
}
......
......@@ -244,7 +244,7 @@ DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
/* update coordinates, the destination rectangle is always stored at 0,0 */
src->x -= src->visrect.left;
src->y -= src->visrect.top;
offset_rect( &src->visrect, -src->visrect.left, -src->visrect.top );
OffsetRect( &src->visrect, -src->visrect.left, -src->visrect.top );
return ERROR_SUCCESS;
}
......@@ -254,7 +254,7 @@ int get_dib_rect( const dib_info *dib, RECT *rc )
rc->top = max( 0, -dib->rect.top );
rc->right = min( dib->rect.right, dib->width ) - dib->rect.left;
rc->bottom = min( dib->rect.bottom, dib->height ) - dib->rect.top;
return !is_rect_empty( rc );
return !IsRectEmpty( rc );
}
int clip_rect_to_dib( const dib_info *dib, RECT *rc )
......@@ -317,8 +317,8 @@ void add_clipped_bounds( dibdrv_physdev *dev, const RECT *rect, HRGN clip )
}
else rc = *rect;
if (is_rect_empty( &rc )) return;
offset_rect( &rc, dev->dib.rect.left, dev->dib.rect.top );
if (IsRectEmpty( &rc )) return;
OffsetRect( &rc, dev->dib.rect.left, dev->dib.rect.top );
add_bounds_rect( dev->bounds, &rc );
}
......@@ -742,7 +742,7 @@ static inline void lock_surface( struct windrv_physdev *dev )
{
/* gdi_lock should not be locked */
dev->surface->funcs->lock( dev->surface );
if (is_rect_empty( dev->dibdrv->bounds )) dev->start_ticks = NtGetTickCount();
if (IsRectEmpty( dev->dibdrv->bounds )) dev->start_ticks = NtGetTickCount();
}
static inline void unlock_surface( struct windrv_physdev *dev )
......@@ -788,7 +788,7 @@ void dibdrv_set_window_surface( DC *dc, struct window_surface *surface )
bits = surface->funcs->get_info( surface, info );
init_dib_info_from_bitmapinfo( &dibdrv->dib, info, bits );
dibdrv->dib.rect = dc->attr->vis_rect;
offset_rect( &dibdrv->dib.rect, -dc->device_rect.left, -dc->device_rect.top );
OffsetRect( &dibdrv->dib.rect, -dc->device_rect.left, -dc->device_rect.top );
dibdrv->bounds = surface->funcs->get_bounds( surface );
DC_InitDC( dc );
}
......
......@@ -1351,7 +1351,7 @@ static void add_join( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const P
/* fall through */
case PS_JOIN_ROUND:
NtGdiGetRgnBox( round_cap, &rect );
offset_rect( &rect, pt->x, pt->y );
OffsetRect( &rect, pt->x, pt->y );
if (clip_rect_to_dib( &pdev->dib, &rect ))
{
NtGdiOffsetRgn( round_cap, pt->x, pt->y );
......@@ -1497,13 +1497,13 @@ static BOOL wide_line_segment( dibdrv_physdev *pdev, HRGN total,
}
if (dx > 0 && dy > 0)
set_rect( &clip_rect, seg_pts[0].x, seg_pts[1].y, seg_pts[2].x, seg_pts[3].y );
SetRect( &clip_rect, seg_pts[0].x, seg_pts[1].y, seg_pts[2].x, seg_pts[3].y );
else if (dx > 0 && dy < 0)
set_rect( &clip_rect, seg_pts[1].x, seg_pts[2].y, seg_pts[3].x, seg_pts[0].y );
SetRect( &clip_rect, seg_pts[1].x, seg_pts[2].y, seg_pts[3].x, seg_pts[0].y );
else if (dx < 0 && dy > 0)
set_rect( &clip_rect, seg_pts[3].x, seg_pts[0].y, seg_pts[1].x, seg_pts[2].y );
SetRect( &clip_rect, seg_pts[3].x, seg_pts[0].y, seg_pts[1].x, seg_pts[2].y );
else
set_rect( &clip_rect, seg_pts[2].x, seg_pts[3].y, seg_pts[0].x, seg_pts[1].y );
SetRect( &clip_rect, seg_pts[2].x, seg_pts[3].y, seg_pts[0].x, seg_pts[1].y );
if (clip_rect_to_dib( &pdev->dib, &clip_rect ))
{
segment = create_polygon_region( seg_pts, 4, ALTERNATE );
......
......@@ -275,7 +275,7 @@ static void solid_rects_32(const dib_info *dib, int num, const RECT *rc, DWORD a
for(i = 0; i < num; i++, rc++)
{
assert( !is_rect_empty( rc ));
assert( !IsRectEmpty( rc ));
start = get_pixel_ptr_32(dib, rc->left, rc->top);
if (and)
......@@ -307,7 +307,7 @@ static void solid_rects_24(const dib_info *dib, int num, const RECT *rc, DWORD a
int left = dib->rect.left + rc->left;
int right = dib->rect.left + rc->right;
assert( !is_rect_empty( rc ));
assert( !IsRectEmpty( rc ));
if ((left & ~3) == (right & ~3)) /* Special case for lines that start and end in the same DWORD triplet */
{
......@@ -426,7 +426,7 @@ static void solid_rects_16(const dib_info *dib, int num, const RECT *rc, DWORD a
for(i = 0; i < num; i++, rc++)
{
assert( !is_rect_empty( rc ));
assert( !IsRectEmpty( rc ));
start = get_pixel_ptr_16(dib, rc->left, rc->top);
if (and)
......@@ -446,7 +446,7 @@ static void solid_rects_8(const dib_info *dib, int num, const RECT *rc, DWORD an
for(i = 0; i < num; i++, rc++)
{
assert( !is_rect_empty( rc ));
assert( !IsRectEmpty( rc ));
start = get_pixel_ptr_8(dib, rc->left, rc->top);
if (and)
......@@ -471,7 +471,7 @@ static void solid_rects_4(const dib_info *dib, int num, const RECT *rc, DWORD an
int left = dib->rect.left + rc->left;
int right = dib->rect.left + rc->right;
assert( !is_rect_empty( rc ));
assert( !IsRectEmpty( rc ));
start = get_pixel_ptr_4(dib, rc->left, rc->top);
if (and)
......@@ -520,7 +520,7 @@ static void solid_rects_1(const dib_info *dib, int num, const RECT *rc, DWORD an
int left = dib->rect.left + rc->left;
int right = dib->rect.left + rc->right;
assert( !is_rect_empty( rc ));
assert( !IsRectEmpty( rc ));
start = get_pixel_ptr_1(dib, rc->left, rc->top);
......@@ -7466,7 +7466,7 @@ static void calc_halftone_params( const struct bitblt_coords *dst, const struct
get_bounding_rect( dst_rect, dst->x, dst->y, dst->width, dst->height );
intersect_rect( src_rect, &src->visrect, src_rect );
intersect_rect( dst_rect, &dst->visrect, dst_rect );
offset_rect( dst_rect, -dst_rect->left, -dst_rect->top );
OffsetRect( dst_rect, -dst_rect->left, -dst_rect->top );
src_width = src_rect->right - src_rect->left;
src_height = src_rect->bottom - src_rect->top;
......
......@@ -5635,7 +5635,7 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr
text_box.bottom = y + tm.tmDescent;
if (flags & ETO_CLIPPED) intersect_rect( &text_box, &text_box, &rc );
if (!is_rect_empty( &text_box ))
if (!IsRectEmpty( &text_box ))
physdev->funcs->pExtTextOut( physdev, 0, 0, ETO_OPAQUE, &text_box, NULL, 0, NULL );
}
}
......
......@@ -532,38 +532,13 @@ static inline DC *get_physdev_dc( PHYSDEV dev )
return get_nulldrv_dc( dev );
}
BOOL WINAPI FontIsLinked(HDC);
BOOL WINAPI SetVirtualResolution(HDC hdc, DWORD horz_res, DWORD vert_res, DWORD horz_size, DWORD vert_size);
static inline BOOL is_rect_empty( const RECT *rect )
{
return (rect->left >= rect->right || rect->top >= rect->bottom);
}
static inline BOOL intersect_rect( RECT *dst, const RECT *src1, const RECT *src2 )
{
dst->left = max( src1->left, src2->left );
dst->top = max( src1->top, src2->top );
dst->right = min( src1->right, src2->right );
dst->bottom = min( src1->bottom, src2->bottom );
return !is_rect_empty( dst );
}
static inline void offset_rect( RECT *rect, int offset_x, int offset_y )
{
rect->left += offset_x;
rect->top += offset_y;
rect->right += offset_x;
rect->bottom += offset_y;
}
static inline void set_rect( RECT *rect, int left, int top, int right, int bottom )
{
rect->left = left;
rect->top = top;
rect->right = right;
rect->bottom = bottom;
return !IsRectEmpty( dst );
}
static inline void order_rect( RECT *rect )
......@@ -610,9 +585,9 @@ static inline void reset_bounds( RECT *bounds )
static inline void union_rect( RECT *dest, const RECT *src1, const RECT *src2 )
{
if (is_rect_empty( src1 ))
if (IsRectEmpty( src1 ))
{
if (is_rect_empty( src2 ))
if (IsRectEmpty( src2 ))
{
reset_bounds( dest );
return;
......@@ -621,7 +596,7 @@ static inline void union_rect( RECT *dest, const RECT *src1, const RECT *src2 )
}
else
{
if (is_rect_empty( src2 )) *dest = *src1;
if (IsRectEmpty( src2 )) *dest = *src1;
else
{
dest->left = min( src1->left, src2->left );
......@@ -634,7 +609,7 @@ static inline void union_rect( RECT *dest, const RECT *src1, const RECT *src2 )
static inline void add_bounds_rect( RECT *bounds, const RECT *rect )
{
if (is_rect_empty( rect )) return;
if (IsRectEmpty( rect )) return;
bounds->left = min( bounds->left, rect->left );
bounds->top = min( bounds->top, rect->top );
bounds->right = max( bounds->right, rect->right );
......
......@@ -958,7 +958,7 @@ BOOL WINAPI NtUserScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const R
else
NtGdiGetAppClipBox( hdc, &clip_rect );
src_rect = clip_rect;
offset_rect( &clip_rect, -dx, -dy );
OffsetRect( &clip_rect, -dx, -dy );
intersect_rect( &src_rect, &src_rect, &clip_rect );
/* if an scroll rectangle is specified, only the pixels within that
......
......@@ -1970,7 +1970,7 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc
monrect = map_dpi_rect( monitor->rc_monitor, get_monitor_dpi( monitor->handle ),
get_thread_dpi() );
offset_rect( &monrect, -origin.x, -origin.y );
OffsetRect( &monrect, -origin.x, -origin.y );
if (!intersect_rect( &monrect, &monrect, &limit )) continue;
enum_info[count].handle = monitor->handle;
......@@ -2049,7 +2049,7 @@ HMONITOR monitor_from_rect( const RECT *rect, DWORD flags, UINT dpi )
RECT r;
r = map_dpi_rect( *rect, dpi, system_dpi );
if (is_rect_empty( &r ))
if (IsRectEmpty( &r ))
{
r.right = r.left + 1;
r.bottom = r.top + 1;
......
......@@ -1658,8 +1658,8 @@ BOOL get_window_rects( HWND hwnd, enum coords_relative relative, RECT *window_re
win = parent;
if (win->parent)
{
offset_rect( &window, win->client_rect.left, win->client_rect.top );
offset_rect( &client, win->client_rect.left, win->client_rect.top );
OffsetRect( &window, win->client_rect.left, win->client_rect.top );
OffsetRect( &client, win->client_rect.left, win->client_rect.top );
}
}
break;
......@@ -2865,7 +2865,7 @@ static BOOL calc_winpos( WINDOWPOS *winpos, RECT *old_window_rect, RECT *old_cli
new_window_rect->right += winpos->x - old_window_rect->left;
new_window_rect->bottom += winpos->y - old_window_rect->top;
offset_rect( new_client_rect, winpos->x - old_window_rect->left,
OffsetRect( new_client_rect, winpos->x - old_window_rect->left,
winpos->y - old_window_rect->top );
}
winpos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE;
......@@ -3823,7 +3823,7 @@ static POINT get_minimized_pos( HWND hwnd, POINT pt )
pt = get_first_minimized_child_pos( &parent_rect, &metrics, width, height );
for (;;)
{
set_rect( &rect, pt.x, pt.y, pt.x + width, pt.y + height );
SetRect( &rect, pt.x, pt.y, pt.x + width, pt.y + height );
if (!NtGdiRectInRegion( hrgn, &rect ))
break;
......@@ -3862,9 +3862,9 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect )
case SW_MINIMIZE:
wpl.ptMinPosition = get_minimized_pos( hwnd, wpl.ptMinPosition );
set_rect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y,
wpl.ptMinPosition.x + get_system_metrics( SM_CXMINIMIZED ),
wpl.ptMinPosition.y + get_system_metrics( SM_CYMINIMIZED ));
SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y,
wpl.ptMinPosition.x + get_system_metrics( SM_CXMINIMIZED ),
wpl.ptMinPosition.y + get_system_metrics( SM_CYMINIMIZED ));
return SWP_NOSIZE | SWP_NOMOVE;
}
if (!send_message( hwnd, WM_QUERYOPEN, 0, 0 )) return SWP_NOSIZE | SWP_NOMOVE;
......@@ -3893,9 +3893,9 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect )
wpl.ptMinPosition = get_minimized_pos( hwnd, wpl.ptMinPosition );
if (!(old_style & WS_MINIMIZE)) swp_flags |= SWP_STATECHANGED;
set_rect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y,
wpl.ptMinPosition.x + get_system_metrics(SM_CXMINIMIZED),
wpl.ptMinPosition.y + get_system_metrics(SM_CYMINIMIZED) );
SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y,
wpl.ptMinPosition.x + get_system_metrics(SM_CXMINIMIZED),
wpl.ptMinPosition.y + get_system_metrics(SM_CYMINIMIZED) );
swp_flags |= SWP_NOCOPYBITS;
break;
......@@ -3910,9 +3910,9 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect )
win_set_flags( hwnd, WIN_RESTORE_MAX, 0 );
if (!(old_style & WS_MAXIMIZE)) swp_flags |= SWP_STATECHANGED;
set_rect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y,
minmax.ptMaxPosition.x + minmax.ptMaxSize.x,
minmax.ptMaxPosition.y + minmax.ptMaxSize.y );
SetRect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y,
minmax.ptMaxPosition.x + minmax.ptMaxSize.x,
minmax.ptMaxPosition.y + minmax.ptMaxSize.y );
break;
case SW_SHOWNOACTIVATE:
......@@ -3930,9 +3930,9 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect )
minmax = get_min_max_info( hwnd );
set_window_style( hwnd, WS_MAXIMIZE, 0 );
swp_flags |= SWP_STATECHANGED;
set_rect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y,
minmax.ptMaxPosition.x + minmax.ptMaxSize.x,
minmax.ptMaxPosition.y + minmax.ptMaxSize.y );
SetRect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y,
minmax.ptMaxPosition.x + minmax.ptMaxSize.x,
minmax.ptMaxPosition.y + minmax.ptMaxSize.y );
break;
}
}
......@@ -4111,7 +4111,7 @@ static BOOL show_window( HWND hwnd, INT cmd )
if (get_window_long( hwnd, GWL_STYLE ) & WS_CHILD) new_swp = swp;
else if (is_iconic( hwnd ) && (newPos.left != -32000 || newPos.top != -32000))
{
offset_rect( &newPos, -32000 - newPos.left, -32000 - newPos.top );
OffsetRect( &newPos, -32000 - newPos.left, -32000 - newPos.top );
new_swp = swp & ~(SWP_NOMOVE | SWP_NOCLIENTMOVE);
}
else new_swp = swp;
......@@ -4974,7 +4974,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
if (cx < 0) cx = 0;
if (cy < 0) cy = 0;
set_rect( &rect, cs.x, cs.y, cs.x + cx, cs.y + cy );
SetRect( &rect, cs.x, cs.y, cs.x + cx, cs.y + cy );
/* check for wraparound */
if (cs.x > 0x7fffffff - cx) rect.right = 0x7fffffff;
if (cs.y > 0x7fffffff - cy) rect.bottom = 0x7fffffff;
......
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