atl: implement AtlPixelToHiMetric and AtlHiMetricToPixel

Andrey Turkin pancha at mail.nnov.ru
Mon Oct 30 09:57:48 CST 2006


ChangeLog:
Implement AtlPixelToHiMetric and AtlHiMetricToPixel
-------------- next part --------------
 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..70f154b 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   = gdi32 ole32 shlwapi user32 advapi32 kernel32
 EXTRALIBS = -luuid
 
 C_SRCS = \
diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec
index bcabe2e..a91cc84 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 b47f1dd..dd6f83b 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"
@@ -460,3 +461,19 @@ LPVOID WINAPI AtlModuleExtractCreateWndD
     }
     return NULL;
 }
+
+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 );
+}
-- 
1.4.2.4



More information about the wine-patches mailing list