#endif
if (dataViewColumnPtr->GetRenderer()->GetMode() == wxDATAVIEW_CELL_EDITABLE)
columnDescription.propertyDesc.propertyFlags |= kDataBrowserPropertyIsEditable;
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
+
if ((columnDescription.propertyDesc.propertyType == kDataBrowserTextType) ||
(columnDescription.propertyDesc.propertyType == kDataBrowserIconAndTextType) ||
(columnDescription.propertyDesc.propertyType == kDataBrowserDateTimeType))
columnDescription.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
-#endif
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
columnDescription.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton;
#endif
#include "wx/mac/private.h"
-#if defined( __WXMAC__ ) && TARGET_API_MAC_OSX && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
+#if defined( __WXMAC__ )
#include "wx/mac/carbon/drawer.h"
return direction;
}
-#endif // defined( __WXMAC__ ) && TARGET_API_MAC_OSX && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
-
+#endif // defined( __WXMAC__ )
columnDesc.propertyDesc.propertyID = kTextColumnId;
columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn;
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
-#endif
verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) );
columnDesc.propertyDesc.propertyID = kNumericOrderColumnId;
columnDesc.propertyDesc.propertyType = kDataBrowserPropertyRelevanceRankPart;
columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn;
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
-#endif
verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) );
-/* -------------------------------------------------------------------------
- * Project: Mac Notifier Support
- * Name: macnotfy.c
- * Author: Stefan CSomor
- * Purpose: Mac Notifier main file
- * CVSID: $Id$
- * -------------------------------------------------------------------------
- */
-
-#include "wx/wxprec.h"
-
-#include "wx/wx.h"
-
-#include "wx/mac/private.h"
-
-#include "wx/mac/macnotfy.h"
-
-const short kMaxEvents = 1000 ;
-
-struct wxMacNotificationEvents
-{
- short top ;
- short bottom ;
-
- wxMacNotificationProcPtr proc[kMaxEvents] ;
- unsigned long events[kMaxEvents] ;
- void* data[kMaxEvents] ;
-} ;
-
-typedef struct wxMacNotificationEvents wxMacNotificationEvents ;
-static wxMacNotificationEvents gMacNotificationEvents ;
-
-ProcessSerialNumber gAppProcess ;
-
-void wxMacCreateNotifierTable()
-{
- GetCurrentProcess(&gAppProcess);
- gMacNotificationEvents.top = 0 ;
- gMacNotificationEvents.bottom = 0 ;
- for ( int i = 0 ; i < kMaxEvents ; ++i )
- {
- gMacNotificationEvents.proc[i] = NULL ;
- gMacNotificationEvents.events[i] = 0 ;
- gMacNotificationEvents.data[i] = NULL ;
- }
-}
-
-void wxMacDestroyNotifierTable()
-{
-}
-
-wxMacNotifierTableRef wxMacGetNotifierTable()
-{
- return (wxMacNotifierTableRef) &gMacNotificationEvents ;
-}
-
-void wxMacAddEvent(
- wxMacNotifierTableRef table ,
- wxMacNotificationProcPtr handler ,
- unsigned long event ,
- void* data ,
- short wakeUp )
-{
- wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ;
- wxASSERT_MSG( handler != NULL , wxT("illegal notification proc ptr") ) ;
- /* this should be protected eventually */
- short index = e->top++ ;
-
- if ( e->top == kMaxEvents )
- e->top = 0 ;
-
- e->proc[index] = handler ;
- e->events[index] = event ;
- e->data[index] = data ;
- if ( wakeUp )
- wxMacWakeUp() ;
-}
-
-bool gInProcessing = false ;
-
-void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data )
-{
- wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ;
- /* this should be protected eventually */
- short index = e->bottom ;
-
- while ( e->top != index )
- {
- if ( e->data[index] == data )
- e->data[index] = NULL ;
- index++ ;
- if ( index == kMaxEvents )
- index = 0 ;
- }
-}
-
-void wxMacProcessNotifierEvents()
-{
- // if ( gInProcessing )
- // return ;
-
- gInProcessing = true ;
- if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )
- {
- // we only should process the notifiers that were here when we entered it
- // otherwise we might never get out...
- short count = gMacNotificationEvents.top - gMacNotificationEvents.bottom ;
- if ( count < 0 )
- count += kMaxEvents ;
-
- while ( count-- )
- {
- // consume event at bottom
- short index = gMacNotificationEvents.bottom++ ;
- if ( gMacNotificationEvents.bottom == kMaxEvents )
- gMacNotificationEvents.bottom = 0 ;
- void* data = gMacNotificationEvents.data[index] ;
- unsigned long event = gMacNotificationEvents.events[index] ;
- wxMacNotificationProcPtr handler = gMacNotificationEvents.proc[index] ;
-
- gMacNotificationEvents.data[index] = NULL ;
- gMacNotificationEvents.events[index] = 0 ;
- gMacNotificationEvents.proc[index] = NULL ;
-
- if ( handler )
- handler( event , data ) ;
- }
- }
- gInProcessing = false ;
-}
-
-void wxMacProcessNotifierAndPendingEvents()
-{
- wxMacProcessNotifierEvents() ;
- wxTheApp->ProcessPendingEvents() ;
-}
+// TODO REMOVE
\ No newline at end of file
case wxSYS_COLOUR_HIGHLIGHT:
-#if 0 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
+#if 0
// NB: enable this case as desired
colorBrushID = kThemeBrushAlternatePrimaryHighlightColor;
#else
break ;
case wxSYS_COLOUR_HIGHLIGHTTEXT :
-#if 0 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
+#if 0
// NB: enable this case as desired
resultColor = *wxWHITE ;
#else
// wxMacSearchFieldControl
// ============================================================================
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
-
-
static const EventTypeSpec eventList[] =
{
{ kEventClassSearchField, kEventSearchFieldCancelClicked } ,
}
}
-#endif
-
// ============================================================================
// implementation
// ============================================================================
const wxSize& size, long style )
{
#ifdef __WXMAC_OSX__
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
if ( UMAGetSystemVersion() >= 0x1030 )
{
m_peer = new wxMacSearchFieldControl( this , str , pos , size , style );
}
-#endif
#endif
if ( !m_peer )
{
TXNObject m_txn ;
} ;
-#if TARGET_API_MAC_OSX
-
// implementation available under OSX
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
-
class wxMacMLTEHIViewControl : public wxMacMLTEControl
{
public :
HIViewRef m_textView ;
};
-#endif
-
-#endif
-
// 'classic' MLTE implementation
class wxMacMLTEClassicControl : public wxMacMLTEControl
wxString st = str ;
wxMacConvertNewlines10To13( &st ) ;
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
if ( HasFocus() )
{
wxMacCFStringHolder cf(st , m_font.GetEncoding() ) ;
SetData<CFStringRef>( 0, kControlEditTextInsertCFStringRefTag, &value );
}
else
-#endif
{
wxString val = GetStringValue() ;
long start , end ;
{
TXNFrameOptions frameOptions = kTXNDontDrawCaretWhenInactiveMask;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
frameOptions |= kTXNDoFontSubstitutionMask;
-#endif
if ( ! (wxStyle & wxTE_NOHIDESEL) )
frameOptions |= kTXNDontDrawSelectionWhenInactiveMask ;
// MLTE control implementation (OSX part)
// ----------------------------------------------------------------------------
-#if TARGET_API_MAC_OSX
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
-
// tiger multi-line textcontrols with no CR in the entire content
// don't scroll automatically, so we need a hack.
// This attempt only works 'before' the key (ie before CallNextEventHandler)
#endif
}
-#endif // MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
-
-
-#endif
-
#endif // wxUSE_TEXTCTRL
#include "wx/mac/uma.h"
#endif
-#include "wx/mac/macnotfy.h"
-
-
// the possible states of the thread:
// ("=>" shows all possible transitions from this state)
enum wxThreadState
#include "wx/mac/private.h"
#endif
-#ifndef __DARWIN__
- #include <Timer.h>
-#endif
-
-#define wxMAC_USE_CARBON_TIMER 1
-
-#if wxMAC_USE_CARBON_TIMER
-
struct MacTimerInfo
{
wxCarbonTimerImpl* m_timer;
m_info->m_timerRef = kInvalidID;
}
-#else // !wxMAC_USE_CARBON_TIMER
-
-typedef struct MacTimerInfo
-{
- TMTask m_task;
- wxMacNotifierTableRef m_table;
- wxCarbonTimerImpl* m_timer;
-};
-
-static void wxProcessTimer( unsigned long event, void *data );
-
-static pascal void MacTimerProc( TMTask * t )
-{
- MacTimerInfo * tm = (MacTimerInfo*) t;
- wxMacAddEvent( tm->m_table, wxProcessTimer, 0, (void*) tm->m_timer, true );
-}
-
-// we need this array to track timers that are being deleted within the Notify procedure
-// adding the timer before the Notify call and checking after whether it still is in there
-// as the destructor would have removed it from the array
-
-wxArrayPtrVoid gTimersInProcess;
-
-static void wxProcessTimer( unsigned long event, void *data )
-{
- if ( data == NULL )
- return;
-
- wxCarbonTimerImpl* timer = (wxCarbonTimerImpl*) data;
- if ( timer->m_oneShot )
- timer->Stop();
-
- gTimersInProcess.Add( timer );
- timer->Notify();
-
- int index = gTimersInProcess.Index( timer );
- if ( index != wxNOT_FOUND )
- {
- gTimersInProcess.RemoveAt( index );
-
- if ( !timer->IsOneShot() && timer->m_info->m_task.tmAddr )
- PrimeTime( (QElemPtr) &timer->m_info->m_task, timer->GetInterval() );
- }
-}
-
-void wxCarbonTimerImpl::Init()
-{
- m_info = new MacTimerInfo();
- m_info->m_task.tmAddr = NULL;
- m_info->m_task.tmWakeUp = 0;
- m_info->m_task.tmReserved = 0;
- m_info->m_task.qType = 0;
- m_info->m_table = wxMacGetNotifierTable();
- m_info->m_timer = this;
-}
-
-bool wxCarbonTimerImpl::IsRunning() const
-{
- // as the qType may already indicate it is elapsed, but it
- // was not handled internally yet
- return ( m_info->m_task.tmAddr != NULL );
-}
-
-wxCarbonTimerImpl::~wxCarbonTimerImpl()
-{
- Stop();
- if (m_info != NULL)
- {
- delete m_info;
- m_info = NULL;
- }
-
- int index = gTimersInProcess.Index( this );
- if ( index != wxNOT_FOUND )
- gTimersInProcess.RemoveAt( index );
-}
-
-bool wxCarbonTimerImpl::Start( int milliseconds, bool mode )
-{
- (void)wxTimerBase::Start( milliseconds, mode );
-
- wxCHECK_MSG( m_milli > 0, false, wxT("invalid value for timer timeout") );
- wxCHECK_MSG( m_info->m_task.tmAddr == NULL, false, wxT("attempting to restart a timer") );
-
- m_info->m_task.tmAddr = NewTimerUPP( MacTimerProc );
- m_info->m_task.tmWakeUp = 0;
- m_info->m_task.tmReserved = 0;
- m_info->m_task.qType = 0;
- m_info->m_timer = this;
- InsXTime( (QElemPtr) &m_info->m_task );
- PrimeTime( (QElemPtr) &m_info->m_task, m_milli );
-
- return true;
-}
-
-void wxCarbonTimerImpl::Stop()
-{
- if ( m_info->m_task.tmAddr )
- {
- RmvTime( (QElemPtr) &m_info->m_task );
- DisposeTimerUPP( m_info->m_task.tmAddr );
- m_info->m_task.tmAddr = NULL;
- }
-
- wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable(), this );
-}
-
-#endif // wxMAC_USE_CARBON_TIMER/!wxMAC_USE_CARBON_TIMER
-
#endif // wxUSE_TIMER
bool drawMetalTheme = MacGetTopLevelWindow()->MacGetMetalAppearance();
bool minimumUmaAvailable = (UMAGetSystemVersion() >= 0x1030);
-#if wxMAC_USE_CORE_GRAPHICS && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
+#if wxMAC_USE_CORE_GRAPHICS
if ( !drawMetalTheme && minimumUmaAvailable )
{
HIThemePlacardDrawInfo info;
wclass = kDocumentWindowClass ;
attr |= kWindowInWindowMenuAttribute ;
}
-#if defined( __WXMAC__ ) && TARGET_API_MAC_OSX && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
else if ( HasFlag( wxFRAME_DRAWER ) )
{
wclass = kDrawerWindowClass;
}
-#endif //10.2 and up
else
{
if ( HasFlag( wxMINIMIZE_BOX ) || HasFlag( wxMAXIMIZE_BOX ) ||
void wxTopLevelWindowMac::MacPerformUpdates()
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
// for composited windows this also triggers a redraw of all
// invalid views in the window
- if ( UMAGetSystemVersion() >= 0x1030 )
- HIWindowFlush((WindowRef) m_macWindow) ;
- else
-#endif
- {
- // the only way to trigger the redrawing on earlier systems is to call
- // ReceiveNextEvent
-
- EventRef currentEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ;
- UInt32 currentEventClass = 0 ;
- if ( currentEvent != NULL )
- {
- currentEventClass = ::GetEventClass( currentEvent ) ;
- ::GetEventKind( currentEvent ) ;
- }
-
- if ( currentEventClass != kEventClassMenu )
- {
- // when tracking a menu, strange redraw errors occur if we flush now, so leave..
- EventRef theEvent;
- ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
- }
- }
+ HIWindowFlush((WindowRef) m_macWindow) ;
}
// Attracts the users attention to this window if the application is
columnDesc.propertyDesc.propertyID = (kMinColumnId + colId);
columnDesc.propertyDesc.propertyType = colType;
columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewSortableColumn;
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;
-#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton;
#endif
// Carbon Events
// ---------------------------------------------------------------------------
-#if TARGET_API_MAC_OSX
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
-enum
-{
- kEventControlVisibilityChanged = 157
-};
-#endif
-
-#endif
-
static const EventTypeSpec eventList[] =
{
{ kEventClassCommand, kEventProcessCommand } ,
m_peer->SetNeedsDisplay() ;
#else
// this would be the preferred version for fast drawing controls
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
- if ( UMAGetSystemVersion() >= 0x1030 )
- HIViewRender(m_peer->GetControlRef()) ;
- else
-#endif
- Update() ;
+ HIViewRender(m_peer->GetControlRef()) ;
#endif
}