Commit 3a0d08d2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Store window origin in DC_ATTR.

parent e349a4a1
...@@ -71,8 +71,8 @@ static inline DC *get_dc_obj( HDC hdc ) ...@@ -71,8 +71,8 @@ static inline DC *get_dc_obj( HDC hdc )
*/ */
static void set_initial_dc_state( DC *dc ) static void set_initial_dc_state( DC *dc )
{ {
dc->wnd_org.x = 0; dc->attr->wnd_org.x = 0;
dc->wnd_org.y = 0; dc->attr->wnd_org.y = 0;
dc->wnd_ext.cx = 1; dc->wnd_ext.cx = 1;
dc->wnd_ext.cy = 1; dc->wnd_ext.cy = 1;
dc->attr->vport_org.x = 0; dc->attr->vport_org.x = 0;
...@@ -327,8 +327,8 @@ static void construct_window_to_viewport(DC *dc, XFORM *xform) ...@@ -327,8 +327,8 @@ static void construct_window_to_viewport(DC *dc, XFORM *xform)
xform->eM12 = 0.0; xform->eM12 = 0.0;
xform->eM21 = 0.0; xform->eM21 = 0.0;
xform->eM22 = scaleY; xform->eM22 = scaleY;
xform->eDx = (double)dc->attr->vport_org.x - scaleX * (double)dc->wnd_org.x; xform->eDx = (double)dc->attr->vport_org.x - scaleX * (double)dc->attr->wnd_org.x;
xform->eDy = (double)dc->attr->vport_org.y - scaleY * (double)dc->wnd_org.y; xform->eDy = (double)dc->attr->vport_org.y - scaleY * (double)dc->attr->wnd_org.y;
if (dc->attr->layout & LAYOUT_RTL) if (dc->attr->layout & LAYOUT_RTL)
xform->eDx = dc->attr->vis_rect.right - dc->attr->vis_rect.left - 1 - xform->eDx; xform->eDx = dc->attr->vis_rect.right - dc->attr->vis_rect.left - 1 - xform->eDx;
} }
...@@ -424,7 +424,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level ) ...@@ -424,7 +424,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
dc->xformWorld2Vport = dcs->xformWorld2Vport; dc->xformWorld2Vport = dcs->xformWorld2Vport;
dc->xformVport2World = dcs->xformVport2World; dc->xformVport2World = dcs->xformVport2World;
dc->vport2WorldValid = dcs->vport2WorldValid; dc->vport2WorldValid = dcs->vport2WorldValid;
dc->wnd_org = dcs->wnd_org; dc->attr->wnd_org = dcs->attr->wnd_org;
dc->wnd_ext = dcs->wnd_ext; dc->wnd_ext = dcs->wnd_ext;
dc->attr->vport_org = dcs->attr->vport_org; dc->attr->vport_org = dcs->attr->vport_org;
dc->attr->vport_ext = dcs->attr->vport_ext; dc->attr->vport_ext = dcs->attr->vport_ext;
...@@ -553,7 +553,6 @@ INT WINAPI NtGdiSaveDC( HDC hdc ) ...@@ -553,7 +553,6 @@ INT WINAPI NtGdiSaveDC( HDC hdc )
newdc->xformWorld2Vport = dc->xformWorld2Vport; newdc->xformWorld2Vport = dc->xformWorld2Vport;
newdc->xformVport2World = dc->xformVport2World; newdc->xformVport2World = dc->xformVport2World;
newdc->vport2WorldValid = dc->vport2WorldValid; newdc->vport2WorldValid = dc->vport2WorldValid;
newdc->wnd_org = dc->wnd_org;
newdc->wnd_ext = dc->wnd_ext; newdc->wnd_ext = dc->wnd_ext;
newdc->virtual_res = dc->virtual_res; newdc->virtual_res = dc->virtual_res;
newdc->virtual_size = dc->virtual_size; newdc->virtual_size = dc->virtual_size;
...@@ -1303,19 +1302,6 @@ BOOL WINAPI GetWindowExtEx( HDC hdc, LPSIZE size ) ...@@ -1303,19 +1302,6 @@ BOOL WINAPI GetWindowExtEx( HDC hdc, LPSIZE size )
/*********************************************************************** /***********************************************************************
* GetWindowOrgEx (GDI32.@)
*/
BOOL WINAPI GetWindowOrgEx( HDC hdc, LPPOINT pt )
{
DC * dc = get_dc_ptr( hdc );
if (!dc) return FALSE;
*pt = dc->wnd_org;
release_dc_ptr( dc );
return TRUE;
}
/***********************************************************************
* SetLayout (GDI32.@) * SetLayout (GDI32.@)
* *
* Sets left->right or right->left text layout flags of a dc. * Sets left->right or right->left text layout flags of a dc.
......
...@@ -343,6 +343,17 @@ BOOL WINAPI GetDCOrgEx( HDC hdc, POINT *point ) ...@@ -343,6 +343,17 @@ BOOL WINAPI GetDCOrgEx( HDC hdc, POINT *point )
} }
/*********************************************************************** /***********************************************************************
* GetWindowOrgEx (GDI32.@)
*/
BOOL WINAPI GetWindowOrgEx( HDC hdc, POINT *point )
{
DC_ATTR *dc_attr;
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
*point = dc_attr->wnd_org;
return TRUE;
}
/***********************************************************************
* GetViewportExtEx (GDI32.@) * GetViewportExtEx (GDI32.@)
*/ */
BOOL WINAPI GetViewportExtEx( HDC hdc, SIZE *size ) BOOL WINAPI GetViewportExtEx( HDC hdc, SIZE *size )
......
...@@ -103,10 +103,10 @@ BOOL CDECL nulldrv_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) ...@@ -103,10 +103,10 @@ BOOL CDECL nulldrv_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
DC *dc = get_nulldrv_dc( dev ); DC *dc = get_nulldrv_dc( dev );
if (pt) if (pt)
*pt = dc->wnd_org; *pt = dc->attr->wnd_org;
dc->wnd_org.x += x; dc->attr->wnd_org.x += x;
dc->wnd_org.y += y; dc->attr->wnd_org.y += y;
DC_UpdateXforms( dc ); DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
...@@ -262,10 +262,10 @@ BOOL CDECL nulldrv_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) ...@@ -262,10 +262,10 @@ BOOL CDECL nulldrv_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
DC *dc = get_nulldrv_dc( dev ); DC *dc = get_nulldrv_dc( dev );
if (pt) if (pt)
*pt = dc->wnd_org; *pt = dc->attr->wnd_org;
dc->wnd_org.x = x; dc->attr->wnd_org.x = x;
dc->wnd_org.y = y; dc->attr->wnd_org.y = y;
DC_UpdateXforms( dc ); DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
......
...@@ -87,7 +87,6 @@ typedef struct tagDC ...@@ -87,7 +87,6 @@ typedef struct tagDC
BOOL bounds_enabled:1; /* bounds tracking is enabled */ BOOL bounds_enabled:1; /* bounds tracking is enabled */
BOOL path_open:1; /* path is currently open (only for saved DCs) */ BOOL path_open:1; /* path is currently open (only for saved DCs) */
POINT wnd_org; /* Window origin */
SIZE wnd_ext; /* Window extent */ SIZE wnd_ext; /* Window extent */
SIZE virtual_res; /* Initially HORZRES,VERTRES. Changed by SetVirtualResolution */ SIZE virtual_res; /* Initially HORZRES,VERTRES. Changed by SetVirtualResolution */
SIZE virtual_size; /* Initially HORZSIZE,VERTSIZE. Changed by SetVirtualResolution */ SIZE virtual_size; /* Initially HORZSIZE,VERTSIZE. Changed by SetVirtualResolution */
......
...@@ -116,6 +116,7 @@ typedef struct DC_ATTR ...@@ -116,6 +116,7 @@ typedef struct DC_ATTR
INT map_mode; INT map_mode;
RECT vis_rect; /* visible rectangle in screen coords */ RECT vis_rect; /* visible rectangle in screen coords */
FLOAT miter_limit; FLOAT miter_limit;
POINT wnd_org; /* window origin */
POINT vport_org; /* viewport origin */ POINT vport_org; /* viewport origin */
SIZE vport_ext; /* viewport extent */ SIZE vport_ext; /* viewport extent */
void *emf; void *emf;
......
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