Added #if TARGET_CARBON around shaped window stuff
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -60,9 +60,9 @@ static Point gs_lastWhere;
|
|||||||
static long gs_lastWhen = 0;
|
static long gs_lastWhen = 0;
|
||||||
|
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param);
|
static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param);
|
||||||
|
#endif
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// wxTopLevelWindowMac implementation
|
// wxTopLevelWindowMac implementation
|
||||||
@@ -375,6 +375,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
if (HasFlag(wxSTAY_ON_TOP))
|
if (HasFlag(wxSTAY_ON_TOP))
|
||||||
wclass = kUtilityWindowClass;
|
wclass = kUtilityWindowClass;
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
if ( HasFlag(wxFRAME_SHAPED) )
|
if ( HasFlag(wxFRAME_SHAPED) )
|
||||||
{
|
{
|
||||||
WindowDefSpec customWindowDefSpec;
|
WindowDefSpec customWindowDefSpec;
|
||||||
@@ -386,6 +387,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
(WindowRef*) &m_macWindow);
|
(WindowRef*) &m_macWindow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
|
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
|
||||||
}
|
}
|
||||||
@@ -402,12 +404,14 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
|
|
||||||
m_macFocus = NULL ;
|
m_macFocus = NULL ;
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
if ( HasFlag(wxFRAME_SHAPED) )
|
if ( HasFlag(wxFRAME_SHAPED) )
|
||||||
{
|
{
|
||||||
// default shape matches the window size
|
// default shape matches the window size
|
||||||
wxRegion rgn(0, 0, m_width, m_height);
|
wxRegion rgn(0, 0, m_width, m_height);
|
||||||
SetShape(rgn);
|
SetShape(rgn);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXHWND *window , wxWindowMac** rootwin)
|
void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXHWND *window , wxWindowMac** rootwin)
|
||||||
@@ -825,6 +829,7 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
|
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
|
||||||
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
// The empty region signifies that the shape should be removed from the
|
// The empty region signifies that the shape should be removed from the
|
||||||
// window.
|
// window.
|
||||||
if ( region.IsEmpty() )
|
if ( region.IsEmpty() )
|
||||||
@@ -849,6 +854,9 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
// Tell the window manager that the window has changed shape
|
// Tell the window manager that the window has changed shape
|
||||||
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
|
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -858,7 +866,7 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
// http://developer.apple.com/samplecode/Sample_Code/Human_Interface_Toolbox/Mac_OS_High_Level_Toolbox/CustomWindow.htm
|
// http://developer.apple.com/samplecode/Sample_Code/Human_Interface_Toolbox/Mac_OS_High_Level_Toolbox/CustomWindow.htm
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect)
|
static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect)
|
||||||
{
|
{
|
||||||
GetWindowPortBounds(window, inRect);
|
GetWindowPortBounds(window, inRect);
|
||||||
@@ -984,4 +992,5 @@ static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -60,9 +60,9 @@ static Point gs_lastWhere;
|
|||||||
static long gs_lastWhen = 0;
|
static long gs_lastWhen = 0;
|
||||||
|
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param);
|
static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param);
|
||||||
|
#endif
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// wxTopLevelWindowMac implementation
|
// wxTopLevelWindowMac implementation
|
||||||
@@ -375,6 +375,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
if (HasFlag(wxSTAY_ON_TOP))
|
if (HasFlag(wxSTAY_ON_TOP))
|
||||||
wclass = kUtilityWindowClass;
|
wclass = kUtilityWindowClass;
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
if ( HasFlag(wxFRAME_SHAPED) )
|
if ( HasFlag(wxFRAME_SHAPED) )
|
||||||
{
|
{
|
||||||
WindowDefSpec customWindowDefSpec;
|
WindowDefSpec customWindowDefSpec;
|
||||||
@@ -386,6 +387,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
(WindowRef*) &m_macWindow);
|
(WindowRef*) &m_macWindow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
|
::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
|
||||||
}
|
}
|
||||||
@@ -402,12 +404,14 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
|
|
||||||
m_macFocus = NULL ;
|
m_macFocus = NULL ;
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
if ( HasFlag(wxFRAME_SHAPED) )
|
if ( HasFlag(wxFRAME_SHAPED) )
|
||||||
{
|
{
|
||||||
// default shape matches the window size
|
// default shape matches the window size
|
||||||
wxRegion rgn(0, 0, m_width, m_height);
|
wxRegion rgn(0, 0, m_width, m_height);
|
||||||
SetShape(rgn);
|
SetShape(rgn);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXHWND *window , wxWindowMac** rootwin)
|
void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXHWND *window , wxWindowMac** rootwin)
|
||||||
@@ -825,6 +829,7 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
|
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
|
||||||
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
// The empty region signifies that the shape should be removed from the
|
// The empty region signifies that the shape should be removed from the
|
||||||
// window.
|
// window.
|
||||||
if ( region.IsEmpty() )
|
if ( region.IsEmpty() )
|
||||||
@@ -849,6 +854,9 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
// Tell the window manager that the window has changed shape
|
// Tell the window manager that the window has changed shape
|
||||||
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
|
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -858,7 +866,7 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
// http://developer.apple.com/samplecode/Sample_Code/Human_Interface_Toolbox/Mac_OS_High_Level_Toolbox/CustomWindow.htm
|
// http://developer.apple.com/samplecode/Sample_Code/Human_Interface_Toolbox/Mac_OS_High_Level_Toolbox/CustomWindow.htm
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if TARGET_CARBON
|
||||||
static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect)
|
static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect)
|
||||||
{
|
{
|
||||||
GetWindowPortBounds(window, inRect);
|
GetWindowPortBounds(window, inRect);
|
||||||
@@ -984,4 +992,5 @@ static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user