void UMAAppendSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , SInt16 id )
{
AppendMenuItemTextWithCFString( menu,
- CFSTR("A"), 0, 0,NULL);
+ CFSTR("A"), 0, 0,NULL);
UMASetMenuItemText( menu, (SInt16) ::CountMenuItems(menu), title , encoding );
SetMenuItemHierarchicalID( menu , CountMenuItems( menu ) , id ) ;
}
void UMAInsertSubMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , SInt16 id )
{
InsertMenuItemTextWithCFString( menu,
- CFSTR("A"), item, 0, 0);
-
+ CFSTR("A"), item, 0, 0);
+
UMASetMenuItemText( menu, item+1, title , encoding );
SetMenuItemHierarchicalID( menu , item+1 , id ) ;
}
void UMAAppendMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , wxAcceleratorEntry *entry )
{
AppendMenuItemTextWithCFString( menu,
- CFSTR("A"), 0, 0,NULL);
+ CFSTR("A"), 0, 0,NULL);
// don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise)
ChangeMenuItemAttributes( menu , ::CountMenuItems(menu), kMenuItemAttrIgnoreMeta , 0 ) ;
UMASetMenuItemText(menu, (SInt16) ::CountMenuItems(menu), title , encoding );
void UMAInsertMenuItem( MenuRef menu , const wxString& title, wxFontEncoding encoding , MenuItemIndex item , wxAcceleratorEntry *entry )
{
InsertMenuItemTextWithCFString( menu,
- CFSTR("A"), item, 0, 0);
+ CFSTR("A"), item, 0, 0);
// don't attempt to interpret metacharacters like a '-' at the beginning (would become a separator otherwise)
ChangeMenuItemAttributes( menu , item+1, kMenuItemAttrIgnoreMeta , 0 ) ;
{
GetControlBounds( theControl , bounds ) ;
-#if TARGET_API_MAC_OSX
WindowRef tlwref = GetControlOwner( theControl ) ;
wxTopLevelWindowMac* tlwwx = wxFindWinFromMacWindow( tlwref ) ;
HIViewConvertPoint( &hiPoint , HIViewGetSuperview(theControl) , rootControl ) ;
OffsetRect( bounds , (short) hiPoint.x , (short) hiPoint.y ) ;
}
-#endif
return bounds ;
}
return count;
}
-void UMAReleaseCFDataProviderCallback( void *info, const void *data, size_t count )
+void UMAReleaseCFDataProviderCallback(void *info,
+ const void *WXUNUSED(data),
+ size_t WXUNUSED(count))
{
if ( info )
CFRelease( (CFDataRef) info );
{
if ( data == NULL )
return NULL;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if( &CGDataProviderCreateWithCFData != NULL )
- {
- return CGDataProviderCreateWithCFData( data );
- }
-#endif
- // make sure we keep it until done
- CFRetain( data );
- CGDataProviderRef provider = CGDataProviderCreateWithData( (void*) data , CFDataGetBytePtr( data ) ,
- CFDataGetLength( data ), UMAReleaseCFDataProviderCallback );
- // if provider couldn't be created, release the data again
- if ( provider == NULL )
- CFRelease( data );
- return provider;
+ return CGDataProviderCreateWithCFData( data );
}
CGDataConsumerRef UMACGDataConsumerCreateWithCFData( CFMutableDataRef data )
{
if ( data == NULL )
return NULL;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if( &CGDataConsumerCreateWithCFData != NULL )
- {
- return CGDataConsumerCreateWithCFData( data );
- }
-#endif
- // make sure we keep it until done
- CFRetain( data );
- CGDataConsumerCallbacks callbacks;
- callbacks.putBytes = UMAPutBytesCFRefCallback;
- callbacks.releaseConsumer = UMAReleaseCFDataConsumerCallback;
- CGDataConsumerRef consumer = CGDataConsumerCreate( data , &callbacks );
- // if consumer couldn't be created, release the data again
- if ( consumer == NULL )
- CFRelease( data );
- return consumer;
+
+ return CGDataConsumerCreateWithCFData( data );
}
#endif // wxUSE_GUI