#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>
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__
// 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;
*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)