< prev index next >

src/windows/native/sun/windows/ThemeReader.cpp

Print this page

        

@@ -29,12 +29,10 @@
 #include "awt.h"
 #include "awt_Toolkit.h"
 #include "awt_Object.h"
 #include "awt_Component.h"
 
-#include "math.h"
-
 // Important note about VC6 and VC7 (or XP Platform SDK)   !
 //
 // These type definitions have been imported from UxTheme.h
 // They have been imported instead of including them, because
 // currently we don't require Platform SDK for building J2SE and

@@ -68,15 +66,10 @@
 } MARGINS, *PMARGINS;
 
 #define TMT_TRANSPARENT 2201
 #endif // _UXTHEME_H_
 
-#if defined(_MSC_VER) && _MSC_VER >= 1800
-#  define ROUND_TO_INT(num)    ((int) round(num))
-#else
-#  define ROUND_TO_INT(num)    ((int) floor((num) + 0.5))
-#endif
 
 #define ALPHA_MASK 0xff000000
 #define RED_MASK 0xff0000
 #define GREEN_MASK 0xff00
 #define BLUE_MASK 0xff

@@ -750,27 +743,10 @@
         return dimObj;
     }
     return NULL;
 }
 
-void rescale(SIZE *size) {
-    HWND hWnd = ::GetDesktopWindow();
-    HDC hDC = ::GetDC(hWnd);
-    int dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX);
-    int dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY);
-
-    if (dpiX !=0 && dpiX != 96) {
-        float invScaleX = 96.0f / dpiX;
-        size->cx = ROUND_TO_INT(size->cx * invScaleX);
-    }
-    if (dpiY != 0 && dpiY != 96) {
-        float invScaleY = 96.0f / dpiY;
-        size->cy = ROUND_TO_INT(size->cy * invScaleY);
-    }
-    ::ReleaseDC(hWnd, hDC);
-}
-
 /*
  * Class:     sun_awt_windows_ThemeReader
  * Method:    getPartSize
  * Signature: (JII)Ljava/awt/Dimension;
  */

@@ -792,12 +768,10 @@
             }
             if (dimMID == NULL) {
                 dimMID = env->GetMethodID(dimClassID, "<init>", "(II)V");
                 CHECK_NULL_RETURN(dimMID, NULL);
             }
-
-            rescale(&size);
             jobject dimObj = env->NewObject(dimClassID, dimMID, size.cx, size.cy);
             if (safe_ExceptionOccurred(env)) {
                 env->ExceptionDescribe();
                 env->ExceptionClear();
             }
< prev index next >