]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/utils.cpp
attempt to recommit , contained binary data for some reason
[wxWidgets.git] / src / mac / carbon / utils.cpp
index 9c4bc2c8ce500039cd28884b2d15452643e181f6..d651da7ca985db19dee49cc9c370f085d457ebd1 100644 (file)
 #include <string.h>
 #include <stdarg.h>
 
-#include "MoreFiles.h"
-#include "MoreFilesExtras.h"
+#ifdef __DARWIN__
+#  include "MoreFilesX.h"
+#else
+#  include "MoreFiles.h"
+#  include "MoreFilesExtras.h"
+#endif
 
 #ifndef __DARWIN__
 #include <Threads.h>
@@ -362,19 +366,19 @@ wxString wxMacFindFolder( short        vol,
                          OSType       folderType,
                          Boolean      createFolder)
 {
-       short           vRefNum  ;
-       long            dirID ;
-       wxString strDir ;
-
-       if ( FindFolder( vol, folderType, createFolder, &vRefNum, &dirID) == noErr)
-       {
-               FSSpec file ;
-               if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr )
-               {
-                       strDir = wxMacFSSpec2MacFilename( &file ) + wxFILE_SEP_PATH ;
-               }
-       }
-       return strDir ;
+    short    vRefNum  ;
+    long     dirID ;
+    wxString strDir ;
+    
+    if ( FindFolder( vol, folderType, createFolder, &vRefNum, &dirID) == noErr)
+    {
+        FSSpec file ;
+        if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr )
+        {
+            strDir = wxMacFSSpec2MacFilename( &file ) + wxFILE_SEP_PATH ;
+        }
+    }
+    return strDir ;
 }
 
 #ifndef __DARWIN__
@@ -461,21 +465,26 @@ int wxDisplayDepth()
 // Get size of display
 void wxDisplaySize(int *width, int *height)
 {
-  wxClientDisplayRect( NULL , NULL , width , height ) ;
+       BitMap screenBits;
+       GetQDGlobalsScreenBits( &screenBits );
+
+    *width = screenBits.bounds.right - screenBits.bounds.left  ;
+    *height = screenBits.bounds.bottom - screenBits.bounds.top ;
 }
 
 void wxDisplaySizeMM(int *width, int *height)
 {
-   wxDisplaySize(width, height);
-   // on mac 72 is fixed (at least now ;-)
-   *width *= 25.4 / 72 ;
-   *height *= 25.4 / 72 ;
+    wxDisplaySize(width, height);
+    // on mac 72 is fixed (at least now ;-)
+    float cvPt2Mm = 25.4 / 72;
+    *width = int( *width * cvPt2Mm );
+    *height = int( *height * cvPt2Mm );
 }
 
 void wxClientDisplayRect(int *x, int *y, int *width, int *height)
 {
-       BitMap screenBits;
-       GetQDGlobalsScreenBits( &screenBits );
+    BitMap screenBits;
+    GetQDGlobalsScreenBits( &screenBits );
 
     if (x) *x = 0;
     if (y) *y = 0;
@@ -483,15 +492,15 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
     *width = screenBits.bounds.right - screenBits.bounds.left  ;
     *height = screenBits.bounds.bottom - screenBits.bounds.top ;
 
-       SInt16 mheight ;
-  #if TARGET_CARBON
-       GetThemeMenuBarHeight( &mheight ) ;
-  #else
+    SInt16 mheight ;
+#if TARGET_CARBON
+    GetThemeMenuBarHeight( &mheight ) ;
+#else
     mheight = LMGetMBarHeight() ;
-  #endif
+#endif
     *height -= mheight ;
     if ( y )
-      *y = mheight ;
+        *y = mheight ;
 }
 
 wxWindow* wxFindWindowAtPoint(const wxPoint& pt)