Andrey Turkin : atl: Implement AtlPixelToHiMetric and
AtlHiMetricToPixel.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Nov 2 15:47:55 CST 2006
Module: wine
Branch: master
Commit: abc3769ad2a4b717b404b006d7fc9728d10a635a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=abc3769ad2a4b717b404b006d7fc9728d10a635a
Author: Andrey Turkin <pancha at mail.nnov.ru>
Date: Mon Oct 30 18:57:48 2006 +0300
atl: Implement AtlPixelToHiMetric and AtlHiMetricToPixel.
---
dlls/atl/Makefile.in | 2 +-
dlls/atl/atl.spec | 4 ++--
dlls/atl/atl_main.c | 17 +++++++++++++++++
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/atl/Makefile.in b/dlls/atl/Makefile.in
index e54cf64..fc20950 100644
--- a/dlls/atl/Makefile.in
+++ b/dlls/atl/Makefile.in
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = atl.dll
IMPORTLIB = libatl.$(IMPLIBEXT)
-IMPORTS = ole32 shlwapi user32 advapi32 kernel32
+IMPORTS = ole32 shlwapi user32 gdi32 advapi32 kernel32
EXTRALIBS = -luuid
C_SRCS = \
diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec
index f7f46fe..c8f0199 100644
--- a/dlls/atl/atl.spec
+++ b/dlls/atl/atl.spec
@@ -19,8 +19,8 @@
24 stub AtlWaitWithMessageLoop
25 stub AtlSetErrorInfo
26 stub AtlCreateTargetDC
-27 stub AtlHiMetricToPixel
-28 stub AtlPixelToHiMetric
+27 stdcall AtlHiMetricToPixel(ptr ptr)
+28 stdcall AtlPixelToHiMetric(ptr ptr)
29 stub AtlDevModeW2A
30 stdcall AtlComPtrAssign(ptr ptr)
31 stub AtlComQIPtrAssign
diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c
index 2fdf901..f7a6fc4 100644
--- a/dlls/atl/atl_main.c
+++ b/dlls/atl/atl_main.c
@@ -26,6 +26,7 @@ #define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
+#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "objbase.h"
@@ -421,3 +422,19 @@ ATOM WINAPI AtlModuleRegisterWndClassInf
TRACE("returning 0x%04x\n", atom);
return atom;
}
+
+void WINAPI AtlHiMetricToPixel(const SIZEL* lpHiMetric, SIZEL* lpPix)
+{
+ HDC dc = GetDC(NULL);
+ lpPix->cx = lpHiMetric->cx * GetDeviceCaps( dc, LOGPIXELSX ) / 100;
+ lpPix->cy = lpHiMetric->cy * GetDeviceCaps( dc, LOGPIXELSY ) / 100;
+ ReleaseDC( NULL, dc );
+}
+
+void WINAPI AtlPixelToHiMetric(const SIZEL* lpPix, SIZEL* lpHiMetric)
+{
+ HDC dc = GetDC(NULL);
+ lpHiMetric->cx = 100 * lpPix->cx / GetDeviceCaps( dc, LOGPIXELSX );
+ lpHiMetric->cy = 100 * lpPix->cy / GetDeviceCaps( dc, LOGPIXELSY );
+ ReleaseDC( NULL, dc );
+}
More information about the wine-cvs
mailing list