guard code for mac / quickdraw
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -189,10 +189,12 @@ bool wxCheckForInterrupt(wxWindow *WXUNUSED(wnd))
|
|||||||
|
|
||||||
void wxGetMousePosition( int* x, int* y )
|
void wxGetMousePosition( int* x, int* y )
|
||||||
{
|
{
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
Point pt;
|
Point pt;
|
||||||
GetGlobalMouse(&pt);
|
GetGlobalMouse(&pt);
|
||||||
*x = pt.h;
|
*x = pt.h;
|
||||||
*y = pt.v;
|
*y = pt.v;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Return true if we have a colour display
|
// Return true if we have a colour display
|
||||||
@@ -204,6 +206,7 @@ bool wxColourDisplay()
|
|||||||
// Returns depth of screen
|
// Returns depth of screen
|
||||||
int wxDisplayDepth()
|
int wxDisplayDepth()
|
||||||
{
|
{
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
int theDepth = (int) CGDisplayBitsPerPixel(CGMainDisplayID());
|
int theDepth = (int) CGDisplayBitsPerPixel(CGMainDisplayID());
|
||||||
Rect globRect;
|
Rect globRect;
|
||||||
SetRect(&globRect, -32760, -32760, 32760, 32760);
|
SetRect(&globRect, -32760, -32760, 32760, 32760);
|
||||||
@@ -214,6 +217,9 @@ int wxDisplayDepth()
|
|||||||
theDepth = (**(**theMaxDevice).gdPMap).pixelSize;
|
theDepth = (**(**theMaxDevice).gdPMap).pixelSize;
|
||||||
|
|
||||||
return theDepth;
|
return theDepth;
|
||||||
|
#else
|
||||||
|
return 32;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get size of display
|
// Get size of display
|
||||||
@@ -243,6 +249,8 @@ void wxDisplaySizeMM(int *width, int *height)
|
|||||||
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
|
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
|
||||||
{
|
{
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
|
|
||||||
HIRect bounds ;
|
HIRect bounds ;
|
||||||
HIWindowGetAvailablePositioningBounds(kCGNullDirectDisplay,kHICoordSpace72DPIGlobal,
|
HIWindowGetAvailablePositioningBounds(kCGNullDirectDisplay,kHICoordSpace72DPIGlobal,
|
||||||
&bounds);
|
&bounds);
|
||||||
@@ -254,6 +262,18 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
|
|||||||
*width = bounds.size.width;
|
*width = bounds.size.width;
|
||||||
if ( height )
|
if ( height )
|
||||||
*height = bounds.size.height;
|
*height = bounds.size.height;
|
||||||
|
#else
|
||||||
|
int w, h;
|
||||||
|
wxDisplaySize(&w,&h);
|
||||||
|
if ( x )
|
||||||
|
*x = 0;
|
||||||
|
if ( y )
|
||||||
|
*y = 24;
|
||||||
|
if ( width )
|
||||||
|
*width = w;
|
||||||
|
if ( height )
|
||||||
|
*height = h-24;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
Rect r;
|
Rect r;
|
||||||
GetAvailableWindowPositioningBounds( GetMainDevice() , &r );
|
GetAvailableWindowPositioningBounds( GetMainDevice() , &r );
|
||||||
@@ -457,6 +477,8 @@ OSStatus wxMacCarbonEvent::SetParameter(EventParamName inName, EventParamType in
|
|||||||
// Control Access Support
|
// Control Access Support
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS( wxMacControl , wxObject )
|
IMPLEMENT_DYNAMIC_CLASS( wxMacControl , wxObject )
|
||||||
|
|
||||||
wxMacControl::wxMacControl()
|
wxMacControl::wxMacControl()
|
||||||
@@ -1875,6 +1897,8 @@ OSStatus wxMacControl::SetTabEnabled( SInt16 tabNo , bool enable )
|
|||||||
return ::SetTabEnabled( m_controlRef , tabNo , enable );
|
return ::SetTabEnabled( m_controlRef , tabNo , enable );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Quartz Support
|
// Quartz Support
|
||||||
//
|
//
|
||||||
@@ -1922,6 +1946,8 @@ wxMacPortSaver::~wxMacPortSaver()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxMAC_USE_QUICKDRAW
|
||||||
|
|
||||||
void wxMacGlobalToLocal( WindowRef window , Point*pt )
|
void wxMacGlobalToLocal( WindowRef window , Point*pt )
|
||||||
{
|
{
|
||||||
HIPoint p = CGPointMake( pt->h, pt->v );
|
HIPoint p = CGPointMake( pt->h, pt->v );
|
||||||
@@ -1943,5 +1969,6 @@ void wxMacLocalToGlobal( WindowRef window , Point*pt )
|
|||||||
pt->h = p.x;
|
pt->h = p.x;
|
||||||
pt->v = p.y;
|
pt->v = p.y;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
|
Reference in New Issue
Block a user