X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80f3f3beb68c3aabfdf521e78b383c41399ac75e..276ee5334d28762520abad9653d51f8e81812ebc:/src/mac/carbon/window.cpp diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index b1e009c4df..1784856fdf 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -248,7 +248,6 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl #endif { -#if wxMAC_USE_CORE_GRAPHICS bool created = false ; CGContextRef cgContext = NULL ; OSStatus err = cEvent.GetParameter(kEventParamCGContextRef, &cgContext) ; @@ -278,18 +277,14 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl CGContextClearRect( cgContext, bounds ); } - -#endif if ( thisWindow->MacDoRedraw( updateRgn , cEvent.GetTicks() ) ) result = noErr ; -#if wxMAC_USE_CORE_GRAPHICS thisWindow->MacSetCGContextRef( NULL ) ; } if ( created ) CGContextRelease( cgContext ) ; -#endif } if ( allocatedRgn ) @@ -329,11 +324,9 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl Boolean focusEverything = false ; ControlPartCode controlPart = cEvent.GetParameter(kEventParamControlPart , typeControlPartCode ); -#ifdef __WXMAC_OSX__ if ( cEvent.GetParameter(kEventParamControlFocusEverything , &focusEverything ) == noErr ) { } -#endif if ( thisWindow->MacIsUserPane() ) result = noErr ; @@ -921,10 +914,7 @@ void wxWindowMac::Init() m_peer = NULL ; m_frozenness = 0 ; m_macAlpha = 255 ; - -#if wxMAC_USE_CORE_GRAPHICS m_cgContextRef = NULL ; -#endif // as all windows are created with WS_VISIBLE style... m_isShown = true; @@ -1156,17 +1146,9 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) break ; case wxWINDOW_VARIANT_MINI : - if (UMAGetSystemVersion() >= 0x1030 ) - { - // not always defined in the headers - size = 3 ; - themeFont = 109 ; - } - else - { - size = kControlSizeSmall; - themeFont = kThemeSmallSystemFont ; - } + // not always defined in the headers + size = 3 ; + themeFont = 109 ; break ; case wxWINDOW_VARIANT_LARGE : @@ -1730,7 +1712,7 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor) GetMouse( &pt ) ; #endif - control = wxMacFindControlUnderMouse( tlw , pt , window , &part ) ; + control = FindControlUnderMouse( pt , window , &part ) ; if ( control ) mouseWin = wxFindControlFromMacControl( control ) ; @@ -1842,13 +1824,7 @@ void wxWindowMac::MacInvalidateBorders() RectRgn( updateOuter, &rect ) ; DiffRgn( updateOuter, updateInner , updateOuter ) ; -#ifdef __WXMAC_OSX__ GetParent()->m_peer->SetNeedsDisplay( updateOuter ) ; -#else - WindowRef tlw = (WindowRef) MacGetTopLevelWindowRef() ; - if ( tlw ) - InvalWindowRgn( tlw , updateOuter ) ; -#endif DisposeRgn( updateOuter ) ; DisposeRgn( updateInner ) ; @@ -2451,7 +2427,6 @@ void wxWindowMac::MacPaintGrowBox() if ( IsTopLevel() ) return ; -#if wxMAC_USE_CORE_GRAPHICS if ( MacHasScrollBarCorner() ) { Rect rect ; @@ -2478,7 +2453,6 @@ void wxWindowMac::MacPaintGrowBox() CGContextFillRect( cgContext, cgrect ); CGContextRestoreGState( cgContext ); } -#endif } void wxWindowMac::MacPaintBorders( int WXUNUSED(leftOrigin) , int WXUNUSED(rightOrigin) ) @@ -2493,7 +2467,6 @@ void wxWindowMac::MacPaintBorders( int WXUNUSED(leftOrigin) , int WXUNUSED(right m_peer->GetRect( &rect ) ; InsetRect( &rect, -1 , -1 ) ; -#if wxMAC_USE_CORE_GRAPHICS { CGRect cgrect = CGRectMake( rect.left , rect.top , rect.right - rect.left , rect.bottom - rect.top ) ; @@ -2543,33 +2516,6 @@ void wxWindowMac::MacPaintBorders( int WXUNUSED(leftOrigin) , int WXUNUSED(right } #endif } - #else - { - wxTopLevelWindowMac* top = MacGetTopLevelWindow(); - if ( top ) - { - wxPoint pt(0, 0) ; - wxMacControl::Convert( &pt , GetParent()->m_peer , top->m_peer ) ; - OffsetRect( &rect , pt.x , pt.y ) ; - } - - if ( HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) ) - DrawThemeEditTextFrame( &rect, IsEnabled() ? kThemeStateActive : kThemeStateInactive ) ; - else if ( HasFlag(wxSIMPLE_BORDER) ) - DrawThemeListBoxFrame( &rect, IsEnabled() ? kThemeStateActive : kThemeStateInactive ) ; - - if ( hasFocus ) - DrawThemeFocusRect( &rect , true ) ; - // TODO REMOVE - /* - if ( hasBothScrollbars ) // hasBothScrollbars is not declared - { - // GetThemeStandaloneGrowBoxBounds - // DrawThemeStandaloneNoGrowBox - } - */ - } -#endif } void wxWindowMac::RemoveChild( wxWindowBase *child ) @@ -2752,9 +2698,7 @@ void wxWindowMac::OnSetFocus( wxFocusEvent& event ) if ( MacGetTopLevelWindow() && m_peer->NeedsFocusRect() ) { -#if wxMAC_USE_CORE_GRAPHICS GetParent()->Refresh() ; -#else wxMacWindowStateSaver sv( this ) ; Rect rect ; @@ -2782,7 +2726,6 @@ void wxWindowMac::OnSetFocus( wxFocusEvent& event ) // we have to invalidate things, we cannot simple redraw MacInvalidateBorders() ; } -#endif } event.Skip(); @@ -3102,16 +3045,7 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time ) eventNc.SetEventObject( child ); if ( !child->GetEventHandler()->ProcessEvent( eventNc ) ) { -#if wxMAC_USE_CORE_GRAPHICS child->MacPaintBorders(0, 0) ; -#else - { - wxWindowDC dc(this) ; - dc.SetClippingRegion(wxRegion(updatergn)); - wxMacPortSetter helper(&dc) ; - child->MacPaintBorders(0, 0) ; - } -#endif } } } @@ -3501,7 +3435,6 @@ bool wxWindowMac::Reparent(wxWindowBase *newParentBase) bool wxWindowMac::SetTransparent(wxByte alpha) { -#if wxMAC_USE_CORE_GRAPHICS SetBackgroundStyle(wxBG_STYLE_TRANSPARENT); if ( alpha != m_macAlpha ) @@ -3510,19 +3443,12 @@ bool wxWindowMac::SetTransparent(wxByte alpha) Refresh() ; } return true ; -#else - return false ; -#endif } bool wxWindowMac::CanSetTransparent() { -#if wxMAC_USE_CORE_GRAPHICS return true ; -#else - return false ; -#endif } wxByte wxWindowMac::GetTransparent() const