if ( mac_x != former_mac_x || mac_y != former_mac_y )
{
- UMAMoveControl( m_controlHandle, mac_x, mac_y );
+ ::MoveControl( m_controlHandle, mac_x, mac_y );
}
}
else if ( IsControl() )
int former_mac_y = contrlRect.top;
if ( mac_x != former_mac_x || mac_y != former_mac_y )
- UMAMoveControl( m_controlHandle, mac_x, mac_y );
+ ::MoveControl( m_controlHandle, mac_x, mac_y );
}
}
#if 0
SetBevelButtonTextPlacement( m_controlHandle, kControlBevelButtonPlaceBelowGraphic );
- UMASetControlTitle( m_controlHandle, label, wxFont::GetDefaultEncoding() );
+ SetControlTitleWithCFString( m_controlHandle , wxMacCFStringHolder( label, wxFont::GetDefaultEncoding() );
#endif
InstallControlEventHandler(
ControlRef container = (ControlRef) GetHandle();
wxASSERT_MSG( container != NULL, wxT("No valid Mac container control") );
- UMAShowControl( controlHandle );
+ SetControlVisibility( controlHandle, true, true );
::EmbedControl( controlHandle, container );
}
#include "wx/mac/uma.h"
-// since we have decided that we only support 8.6 upwards we are
-// checking for these minimum requirements in the startup code of
-// the application so all wxWidgets code can safely assume that appearance 1.1
-// windows manager, control manager, navigation services etc. are
-// present
-
static SInt32 sUMASystemVersion = 0 ;
-long UMAGetSystemVersion() { return sUMASystemVersion ; }
-
-void UMACleanupToolbox()
-{
+long UMAGetSystemVersion()
+{
+ if ( sUMASystemVersion == 0 )
+ {
+ verify_noerr(Gestalt(gestaltSystemVersion, &sUMASystemVersion));
+ }
+ return sUMASystemVersion ;
}
void UMAInitToolbox( UInt16 WXUNUSED(inMoreMastersCalls),
bool WXUNUSED(isEmbedded) )
{
- if ( Gestalt(gestaltSystemVersion, &sUMASystemVersion) != noErr)
- sUMASystemVersion = 0x0000 ;
-
-#ifndef __LP64__
+#if 0 // ndef __LP64__
{
FontFamilyID fontId ;
Str255 fontName ;
OptionBits options = 0 ;
- if ( UMAGetSystemVersion() < 0x1000 )
- options |= kTXNAlwaysUseQuickDrawTextMask ;
-
TXNInitTextension( fontDescriptions, noOfFontDescriptions, options );
}
#endif
-
- UMASetSystemIsInitialized( true );
}
// process manager
SetMenuItemTextWithCFString( menu , item , wxMacCFStringHolder(str , encoding) ) ;
}
-UInt32 UMAMenuEvent( EventRecord *inEvent )
-{
- return MenuEvent( inEvent ) ;
-}
-
void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex inItem , bool enable)
{
if ( enable )
#if wxMAC_USE_COCOA == 0
-void UMAShowWatchCursor()
-{
- SetThemeCursor(kThemeWatchCursor);
-}
-
-void UMAShowArrowCursor()
-{
- SetThemeCursor(kThemeArrowCursor);
-}
-
static OSStatus UMAGetHelpMenu(
MenuRef * outHelpMenu,
MenuItemIndex * outFirstCustomItemIndex,
#if wxMAC_USE_QUICKDRAW
-GrafPtr UMAGetWindowPort( WindowRef inWindowRef )
-{
- wxASSERT( inWindowRef != NULL ) ;
-
- return (GrafPtr) GetWindowPort( inWindowRef ) ;
-}
-
-void UMADisposeWindow( WindowRef inWindowRef )
-{
- wxASSERT( inWindowRef != NULL ) ;
-
- DisposeWindow( inWindowRef ) ;
-}
-
-void UMASetWTitle( WindowRef inWindowRef , const wxString& title , wxFontEncoding encoding )
-{
- SetWindowTitleWithCFString( inWindowRef , wxMacCFStringHolder(title , encoding) ) ;
-}
-
-// appearance additions
-
-void UMASetControlTitle( ControlRef inControl , const wxString& title , wxFontEncoding encoding )
-{
- SetControlTitleWithCFString( inControl , wxMacCFStringHolder(title , encoding) ) ;
-}
-
void UMAActivateControl( ControlRef inControl )
{
::ActivateControl( inControl ) ;
}
-void UMAMoveControl( ControlRef inControl , short x , short y )
-{
- ::MoveControl( inControl , x , y ) ;
-}
-
-void UMASizeControl( ControlRef inControl , short x , short y )
-{
- ::SizeControl( inControl , x , y ) ;
-}
-
void UMADeactivateControl( ControlRef inControl )
{
::DeactivateControl( inControl ) ;
}
-// shows the control and adds the region to the update region
-void UMAShowControl( ControlRef inControl )
-{
- SetControlVisibility( inControl , true , false ) ;
- HIViewSetNeedsDisplay( inControl, true );
-}
-
-// hides the control and adds the region to the update region
-void UMAHideControl( ControlRef inControl )
-{
- SetControlVisibility( inControl , false , false ) ;
- HIViewSetNeedsDisplay( inControl, true );
-}
-
-bool UMAIsWindowFloating( WindowRef inWindow )
-{
- WindowClass cl ;
-
- GetWindowClass( inWindow , &cl ) ;
- return cl == kFloatingWindowClass ;
-}
-
-bool UMAIsWindowModal( WindowRef inWindow )
-{
- WindowClass cl ;
-
- GetWindowClass( inWindow , &cl ) ;
- return cl < kFloatingWindowClass ;
-}
-
// others
void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
{
+#if 1 // TODO REMOVE
if ( inWindowRef )
{
// bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
SetPort( port ) ;
#endif
}
-}
-
-OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
-{
-#ifndef __LP64__
- return ::DrawThemePlacard( inRect , inState ) ;
-#else
- return noErr;
#endif
}
#endif
-#ifndef __LP64__
-
-wxMacPortStateHelper::wxMacPortStateHelper( GrafPtr newport )
-{
- m_clip = NULL ;
- Setup( newport ) ;
-}
-
-wxMacPortStateHelper::wxMacPortStateHelper()
-{
- m_clip = NULL ;
-}
-
-void wxMacPortStateHelper::Setup( GrafPtr newport )
-{
- GetPort( &m_oldPort ) ;
- SetPort( newport ) ;
- SetOrigin(0, 0);
-
- wxASSERT_MSG( m_clip == NULL , wxT("Cannot call setup twice") ) ;
- m_clip = NewRgn() ;
- GetClip( m_clip );
- m_textFont = GetPortTextFont( (CGrafPtr) newport );
- m_textSize = GetPortTextSize( (CGrafPtr) newport );
- m_textStyle = GetPortTextFace( (CGrafPtr) newport );
- m_textMode = GetPortTextMode( (CGrafPtr) newport );
- GetThemeDrawingState( &m_drawingState ) ;
- m_currentPort = newport ;
-}
-
-void wxMacPortStateHelper::Clear()
-{
- if ( m_clip )
- {
- DisposeRgn( m_clip ) ;
- DisposeThemeDrawingState( m_drawingState ) ;
- m_clip = NULL ;
- }
-}
-
-wxMacPortStateHelper::~wxMacPortStateHelper()
-{
- if ( m_clip )
- {
- SetPort( m_currentPort ) ;
- SetClip( m_clip ) ;
- DisposeRgn( m_clip ) ;
- TextFont( m_textFont );
- TextSize( m_textSize );
- TextFace( m_textStyle );
- TextMode( m_textMode );
- SetThemeDrawingState( m_drawingState , true ) ;
- SetPort( m_oldPort ) ;
- }
-}
-
-#endif
-
size_t UMAPutBytesCFRefCallback( void *info, const void *bytes, size_t count )
{
CFMutableDataRef data = (CFMutableDataRef) info;
return CGDataConsumerCreateWithCFData( data );
}
#endif // wxUSE_GUI
-
-#if wxUSE_BASE
-
-static bool sUMASystemInitialized = false ;
-
-bool UMASystemIsInitialized()
-{
- return sUMASystemInitialized ;
-}
-
-void UMASetSystemIsInitialized(bool val)
-{
- sUMASystemInitialized = val;
-}
-
-#endif // wxUSE_BASE
GetGlobalMouse(&pt);
*x = pt.h;
*y = pt.v;
+#else
+ // TODO
#endif
};
return theDepth;
#else
- return 32;
+ return 32; // TODO
#endif
}
// Common Event Support
// ----------------------------------------------------------------------------
-extern ProcessSerialNumber gAppProcess;
-
void wxMacWakeUp()
{
- ProcessSerialNumber psn;
- Boolean isSame;
- psn.highLongOfPSN = 0;
- psn.lowLongOfPSN = kCurrentProcess;
- SameProcess( &gAppProcess , &psn , &isSame );
- if ( isSame )
- {
- OSStatus err = noErr;
+ OSStatus err = noErr;
#if 0
- // lead sometimes to race conditions, although all calls used should be thread safe ...
- static wxMacCarbonEvent s_wakeupEvent;
- if ( !s_wakeupEvent.IsValid() )
- {
- err = s_wakeupEvent.Create( 'WXMC', 'WXMC', GetCurrentEventTime(),
- kEventAttributeNone );
- }
- if ( err == noErr )
- {
-
- if ( IsEventInQueue( GetMainEventQueue() , s_wakeupEvent ) )
- return;
- s_wakeupEvent.SetCurrentTime();
- err = PostEventToQueue(GetMainEventQueue(), s_wakeupEvent,
- kEventPriorityHigh );
- }
-#else
- wxMacCarbonEvent wakeupEvent;
- wakeupEvent.Create( 'WXMC', 'WXMC', GetCurrentEventTime(),
- kEventAttributeNone );
- err = PostEventToQueue(GetMainEventQueue(), wakeupEvent,
- kEventPriorityHigh );
-#endif
+ // lead sometimes to race conditions, although all calls used should be thread safe ...
+ static wxMacCarbonEvent s_wakeupEvent;
+ if ( !s_wakeupEvent.IsValid() )
+ {
+ err = s_wakeupEvent.Create( 'WXMC', 'WXMC', GetCurrentEventTime(),
+ kEventAttributeNone );
}
- else
+ if ( err == noErr )
{
- WakeUpProcess( &gAppProcess );
+
+ if ( IsEventInQueue( GetMainEventQueue() , s_wakeupEvent ) )
+ return;
+ s_wakeupEvent.SetCurrentTime();
+ err = PostEventToQueue(GetMainEventQueue(), s_wakeupEvent,
+ kEventPriorityHigh );
}
+#else
+ wxMacCarbonEvent wakeupEvent;
+ wakeupEvent.Create( 'WXMC', 'WXMC', GetCurrentEventTime(),
+ kEventAttributeNone );
+ err = PostEventToQueue(GetMainEventQueue(), wakeupEvent,
+ kEventPriorityHigh );
+#endif
}
#endif // wxUSE_BASE
else
encoding = wxFont::GetDefaultEncoding();
- UMASetControlTitle( m_controlRef , title , encoding );
+ SetControlTitleWithCFString( m_controlRef , wxMacCFStringHolder( title , encoding ) );
}
void wxMacControl::GetFeatures( UInt32 * features )
#endif
#endif // wxUSE_GUI
+
+#if wxUSE_BASE
+
+#endif