mirror of
https://github.com/reactos/reactos.git
synced 2024-07-29 23:58:44 +00:00
Implemented DC coordinate functions.
Patch by Mike Nordell. svn path=/trunk/; revision=5219
This commit is contained in:
parent
add211f2ff
commit
c1efb7ad67
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* 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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -265,10 +265,11 @@ W32kOffsetViewportOrgEx(HDC hDC,
|
||||||
int YOffset,
|
int YOffset,
|
||||||
LPPOINT UnsafePoint)
|
LPPOINT UnsafePoint)
|
||||||
{
|
{
|
||||||
DC *dc = DC_HandleToPtr(hDC);
|
PDC dc;
|
||||||
POINT Point;
|
POINT Point;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
dc = DC_HandleToPtr(hDC);
|
||||||
if (NULL == dc)
|
if (NULL == dc)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -303,7 +304,26 @@ W32kOffsetWindowOrgEx(HDC hDC,
|
||||||
int YOffset,
|
int YOffset,
|
||||||
LPPOINT Point)
|
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
|
BOOL
|
||||||
|
@ -336,7 +356,7 @@ W32kSetGraphicsMode(HDC hDC,
|
||||||
int Mode)
|
int Mode)
|
||||||
{
|
{
|
||||||
INT ret;
|
INT ret;
|
||||||
DC *dc;
|
PDC dc;
|
||||||
|
|
||||||
dc = DC_HandleToPtr (hDC);
|
dc = DC_HandleToPtr (hDC);
|
||||||
if (!dc)
|
if (!dc)
|
||||||
|
@ -355,6 +375,7 @@ W32kSetGraphicsMode(HDC hDC,
|
||||||
DC_ReleasePtr( hDC );
|
DC_ReleasePtr( hDC );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = dc->w.GraphicsMode;
|
ret = dc->w.GraphicsMode;
|
||||||
dc->w.GraphicsMode = Mode;
|
dc->w.GraphicsMode = Mode;
|
||||||
DC_ReleasePtr( hDC );
|
DC_ReleasePtr( hDC );
|
||||||
|
@ -366,7 +387,19 @@ STDCALL
|
||||||
W32kSetMapMode(HDC hDC,
|
W32kSetMapMode(HDC hDC,
|
||||||
int MapMode)
|
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
|
BOOL
|
||||||
|
@ -376,7 +409,43 @@ W32kSetViewportExtEx(HDC hDC,
|
||||||
int YExtent,
|
int YExtent,
|
||||||
LPSIZE Size)
|
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
|
BOOL
|
||||||
|
@ -386,7 +455,26 @@ W32kSetViewportOrgEx(HDC hDC,
|
||||||
int Y,
|
int Y,
|
||||||
LPPOINT Point)
|
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
|
BOOL
|
||||||
|
@ -396,7 +484,38 @@ W32kSetWindowExtEx(HDC hDC,
|
||||||
int YExtent,
|
int YExtent,
|
||||||
LPSIZE Size)
|
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
|
BOOL
|
||||||
|
@ -406,7 +525,26 @@ W32kSetWindowOrgEx(HDC hDC,
|
||||||
int Y,
|
int Y,
|
||||||
LPPOINT Point)
|
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
|
BOOL
|
||||||
|
|
Loading…
Reference in a new issue