X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7fc641aff97d5f100b94cabb0288d3c4261e5328..4813bb8d72d4e6821e031f2b19baaa338b714d39:/src/mac/carbon/uma.cpp diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index 7fcd7abee3..b1d5ade518 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -57,32 +57,6 @@ void UMAInitToolbox( UInt16 WXUNUSED(inMoreMastersCalls), #endif } -// process manager -long UMAGetProcessMode() -{ - OSErr err ; - ProcessInfoRec processinfo; - ProcessSerialNumber procno ; - - procno.highLongOfPSN = 0 ; - procno.lowLongOfPSN = kCurrentProcess ; - processinfo.processInfoLength = sizeof(ProcessInfoRec); - processinfo.processName = NULL; -#ifndef __LP64__ - processinfo.processAppSpec = NULL; -#endif - - err = ::GetProcessInformation( &procno , &processinfo ) ; - wxASSERT( err == noErr ) ; - - return processinfo.processMode ; -} - -bool UMAGetProcessModeDoesActivateOnFGSwitch() -{ - return UMAGetProcessMode() & modeDoesActivateOnFGSwitch ; -} - // menu manager #if wxMAC_USE_COCOA == 0 @@ -93,7 +67,7 @@ MenuRef UMANewMenu( SInt16 id , const wxString& title , wxFontEncoding encoding MenuRef menu ; CreateNewMenu( id , 0 , &menu ) ; - SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding ) ) ; + SetMenuTitleWithCFString( menu , wxCFStringRef(str , encoding ) ) ; return menu ; } @@ -102,7 +76,7 @@ void UMASetMenuTitle( MenuRef menu , const wxString& title , wxFontEncoding enco { wxString str = wxStripMenuCodes( title ) ; - SetMenuTitleWithCFString( menu , wxMacCFStringHolder(str , encoding) ) ; + SetMenuTitleWithCFString( menu , wxCFStringRef(str , encoding) ) ; } void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& title, wxFontEncoding encoding ) @@ -110,7 +84,7 @@ void UMASetMenuItemText( MenuRef menu, MenuItemIndex item, const wxString& titl // we don't strip the accels here anymore, must be done before wxString str = title ; - SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str , encoding) ) ; + SetMenuItemTextWithCFString( menu , item , wxCFStringRef(str , encoding) ) ; } void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex inItem , bool enable) @@ -339,108 +313,4 @@ OSStatus UMAGetHelpMenuDontCreate( #endif -// window manager - -#if wxMAC_USE_QUICKDRAW - -void UMAActivateControl( ControlRef inControl ) -{ - ::ActivateControl( inControl ) ; -} - -void UMADeactivateControl( ControlRef inControl ) -{ - ::DeactivateControl( inControl ) ; -} - -// others - -void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) -{ -#if 1 // TODO REMOVE - if ( inWindowRef ) - { -// bool isHighlighted = IsWindowHighlited( inWindowRef ) ; -// if ( inActivate != isHighlighted ) -#ifndef __LP64__ - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort( inWindowRef ) ; -#endif - HiliteWindow( inWindowRef , inActivate ) ; - ControlRef control = NULL ; - ::GetRootControl( inWindowRef , &control ) ; - if ( control ) - { - if ( inActivate ) - UMAActivateControl( control ) ; - else - UMADeactivateControl( control ) ; - } -#ifndef __LP64__ - SetPort( port ) ; -#endif - } -#endif -} - -Rect * UMAGetControlBoundsInWindowCoords( ControlRef theControl, Rect *bounds ) -{ - GetControlBounds( theControl , bounds ) ; - - WindowRef tlwref = GetControlOwner( theControl ) ; - - wxTopLevelWindowMac* tlwwx = wxFindWinFromMacWindow( tlwref ) ; - if ( tlwwx != NULL ) - { - ControlRef rootControl = tlwwx->GetPeer()->GetControlRef() ; - HIPoint hiPoint = CGPointMake( 0 , 0 ) ; - HIViewConvertPoint( &hiPoint , HIViewGetSuperview(theControl) , rootControl ) ; - OffsetRect( bounds , (short) hiPoint.x , (short) hiPoint.y ) ; - } - - return bounds ; -} - -#endif - -size_t UMAPutBytesCFRefCallback( void *info, const void *bytes, size_t count ) -{ - CFMutableDataRef data = (CFMutableDataRef) info; - if ( data ) - { - CFDataAppendBytes( data, (const UInt8*) bytes, count ); - } - return count; -} - -void UMAReleaseCFDataProviderCallback(void *info, - const void *WXUNUSED(data), - size_t WXUNUSED(count)) -{ - if ( info ) - CFRelease( (CFDataRef) info ); -} - -void UMAReleaseCFDataConsumerCallback( void *info ) -{ - if ( info ) - CFRelease( (CFDataRef) info ); -} - -CGDataProviderRef UMACGDataProviderCreateWithCFData( CFDataRef data ) -{ - if ( data == NULL ) - return NULL; - - return CGDataProviderCreateWithCFData( data ); -} - -CGDataConsumerRef UMACGDataConsumerCreateWithCFData( CFMutableDataRef data ) -{ - if ( data == NULL ) - return NULL; - - return CGDataConsumerCreateWithCFData( data ); -} #endif // wxUSE_GUI