Implemented DC coordinate functions.

Patch by Mike Nordell.

svn path=/trunk/; revision=5219
This commit is contained in:
Eric Kohl 2003-07-22 20:02:08 +00:00
parent add211f2ff
commit c1efb7ad67

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: coord.c,v 1.12 2003/05/27 07:23:05 gvg Exp $
/* $Id: coord.c,v 1.13 2003/07/22 20:02:08 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -265,10 +265,11 @@ W32kOffsetViewportOrgEx(HDC hDC,
int YOffset,
LPPOINT UnsafePoint)
{
DC *dc = DC_HandleToPtr(hDC);
PDC dc;
POINT Point;
NTSTATUS Status;
dc = DC_HandleToPtr(hDC);
if (NULL == dc)
{
return FALSE;
@ -303,7 +304,26 @@ W32kOffsetWindowOrgEx(HDC hDC,
int YOffset,
LPPOINT Point)
{
UNIMPLEMENTED;
PDC dc;
dc = DC_HandleToPtr(hDC);
if (!dc)
{
return FALSE;
}
if (Point)
{
Point->x = dc->wndOrgX;
Point->y = dc->wndOrgY;
}
dc->wndOrgX += XOffset;
dc->wndOrgY += YOffset;
DC_ReleasePtr(hDC);
return TRUE;
}
BOOL
@ -336,7 +356,7 @@ W32kSetGraphicsMode(HDC hDC,
int Mode)
{
INT ret;
DC *dc;
PDC dc;
dc = DC_HandleToPtr (hDC);
if (!dc)
@ -355,6 +375,7 @@ W32kSetGraphicsMode(HDC hDC,
DC_ReleasePtr( hDC );
return 0;
}
ret = dc->w.GraphicsMode;
dc->w.GraphicsMode = Mode;
DC_ReleasePtr( hDC );
@ -366,7 +387,19 @@ STDCALL
W32kSetMapMode(HDC hDC,
int MapMode)
{
UNIMPLEMENTED;
int PrevMapMode;
PDC dc;
dc = DC_HandleToPtr(hDC);
if (!dc)
{
return FALSE;
}
PrevMapMode = dc->w.MapMode;
dc->w.MapMode = MapMode;
return PrevMapMode;
}
BOOL
@ -376,7 +409,43 @@ W32kSetViewportExtEx(HDC hDC,
int YExtent,
LPSIZE Size)
{
UNIMPLEMENTED;
PDC dc;
dc = DC_HandleToPtr(hDC);
if (!dc)
{
return FALSE;
}
switch (dc->w.MapMode)
{
case MM_HIENGLISH:
case MM_HIMETRIC:
case MM_LOENGLISH:
case MM_LOMETRIC:
case MM_TEXT:
case MM_TWIPS:
DC_ReleasePtr(hDC);
return FALSE;
case MM_ISOTROPIC:
// Here we should (probably) check that SetWindowExtEx *really* has
// been called
break;
}
if (Size)
{
Size->cx = dc->vportExtX;
Size->cy = dc->vportExtY;
}
dc->vportExtX = XExtent;
dc->vportExtY = YExtent;
DC_ReleasePtr(hDC);
return TRUE;
}
BOOL
@ -386,7 +455,26 @@ W32kSetViewportOrgEx(HDC hDC,
int Y,
LPPOINT Point)
{
UNIMPLEMENTED;
PDC dc;
dc = DC_HandleToPtr(hDC);
if (!dc)
{
return FALSE;
}
if (Point)
{
Point->x = dc->vportOrgX;
Point->y = dc->vportOrgY;
}
dc->vportOrgX = X;
dc->vportOrgY = Y;
DC_ReleasePtr(hDC);
return TRUE;
}
BOOL
@ -396,7 +484,38 @@ W32kSetWindowExtEx(HDC hDC,
int YExtent,
LPSIZE Size)
{
UNIMPLEMENTED;
PDC dc;
dc = DC_HandleToPtr(hDC);
if (!dc)
{
return FALSE;
}
switch (dc->w.MapMode)
{
case MM_HIENGLISH:
case MM_HIMETRIC:
case MM_LOENGLISH:
case MM_LOMETRIC:
case MM_TEXT:
case MM_TWIPS:
DC_ReleasePtr(hDC);
return FALSE;
}
if (Size)
{
Size->cx = dc->wndExtX;
Size->cy = dc->wndExtY;
}
dc->wndExtX = XExtent;
dc->wndExtY = YExtent;
DC_ReleasePtr(hDC);
return TRUE;
}
BOOL
@ -406,7 +525,26 @@ W32kSetWindowOrgEx(HDC hDC,
int Y,
LPPOINT Point)
{
UNIMPLEMENTED;
PDC dc;
dc = DC_HandleToPtr(hDC);
if (!dc)
{
return FALSE;
}
if (Point)
{
Point->x = dc->wndOrgX;
Point->y = dc->wndOrgY;
}
dc->wndOrgX = X;
dc->wndOrgY = Y;
DC_ReleasePtr(hDC);
return TRUE;
}
BOOL