gdi32: Add explicit fields for the DC flags.

oldstable
Alexandre Julliard 2012-04-10 13:36:45 +02:00
parent b762fcc9a7
commit 2776a97931
3 changed files with 9 additions and 10 deletions

View File

@ -1347,7 +1347,7 @@ UINT WINAPI SetBoundsRect(HDC hdc, const RECT* rect, UINT flags)
if ((flags & DCB_ENABLE) && (flags & DCB_DISABLE)) return 0;
if (!(dc = get_dc_ptr( hdc ))) return 0;
ret = ((dc->flags & DC_BOUNDS_ENABLE) ? DCB_ENABLE : DCB_DISABLE) |
ret = (dc->bounds_enabled ? DCB_ENABLE : DCB_DISABLE) |
(is_rect_empty( &dc->BoundsRect ) ? DCB_RESET : DCB_SET);
if (flags & DCB_RESET)
@ -1376,8 +1376,8 @@ UINT WINAPI SetBoundsRect(HDC hdc, const RECT* rect, UINT flags)
}
}
if (flags & DCB_ENABLE) dc->flags |= DC_BOUNDS_ENABLE;
if (flags & DCB_DISABLE) dc->flags &= ~DC_BOUNDS_ENABLE;
if (flags & DCB_ENABLE) dc->bounds_enabled = TRUE;
if (flags & DCB_DISABLE) dc->bounds_enabled = FALSE;
release_dc_ptr( dc );
return ret;

View File

@ -89,6 +89,9 @@ typedef struct tagDC
DWORD_PTR dwHookData;
DCHOOKPROC hookProc; /* DC hook */
BOOL bounds_enabled:1; /* bounds tracking is enabled */
BOOL path_open:1; /* path is currently open (only for saved DCs) */
INT wndOrgX; /* Window origin */
INT wndOrgY;
INT wndExtX; /* Window extent */
@ -149,10 +152,6 @@ typedef struct tagDC
RECT BoundsRect; /* Current bounding rect */
} DC;
/* DC flags */
#define DC_PATH_OPEN 0x0001 /* DC path is open (only set on saved DCs) */
#define DC_BOUNDS_ENABLE 0x0008 /* Bounding rectangle tracking is enabled */
/* Certain functions will do no further processing if the driver returns this.
Used by mfdrv for example. */
#define GDI_NO_MORE_WORK 2

View File

@ -867,7 +867,7 @@ BOOL PATH_SavePath( DC *dst, DC *src )
else if ((physdev = find_path_physdev( src )))
{
if (!(dst->path = copy_gdi_path( physdev->path ))) return FALSE;
dst->flags |= DC_PATH_OPEN;
dst->path_open = TRUE;
}
else dst->path = NULL;
return TRUE;
@ -877,7 +877,7 @@ BOOL PATH_RestorePath( DC *dst, DC *src )
{
struct path_physdev *physdev = find_path_physdev( dst );
if (src->path && (src->flags & DC_PATH_OPEN))
if (src->path && src->path_open)
{
if (!physdev)
{
@ -887,7 +887,7 @@ BOOL PATH_RestorePath( DC *dst, DC *src )
else free_gdi_path( physdev->path );
physdev->path = src->path;
src->flags &= ~DC_PATH_OPEN;
src->path_open = FALSE;
src->path = NULL;
}
else if (physdev)