Move more stuff into base for wxMac so that two level namespace dylibs
can be used on OS X. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -93,6 +93,10 @@ wxAppConsole *wxAppConsole::ms_appInstance = NULL;
|
||||
|
||||
wxAppInitializerFunction wxAppConsole::ms_appInitFn = NULL;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
bool wxAppConsole::s_macDefaultEncodingIsPC = true ;
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// wxAppConsole implementation
|
||||
// ============================================================================
|
||||
@@ -371,10 +375,10 @@ bool wxAppConsole::CheckBuildOptions(const char *optionsSignature,
|
||||
wxString prog = wxString::FromAscii(optionsSignature);
|
||||
wxString progName = wxString::FromAscii(componentName);
|
||||
wxString msg;
|
||||
|
||||
|
||||
msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."),
|
||||
lib.c_str(), progName.c_str(), prog.c_str());
|
||||
|
||||
|
||||
wxLogFatalError(msg);
|
||||
|
||||
// normally wxLogFatalError doesn't return
|
||||
@@ -456,7 +460,7 @@ void wxConsoleAppTraitsBase::RemoveFromPendingDelete(wxObject * WXUNUSED(object)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
|
||||
#if wxUSE_SOCKETS
|
||||
GSocketGUIFunctionsTable* wxConsoleAppTraitsBase::GetSocketGUIFunctionsTable()
|
||||
{
|
||||
@@ -533,7 +537,7 @@ void wxAssert(int cond,
|
||||
const wxChar *szFile,
|
||||
int nLine,
|
||||
const wxChar *szCond,
|
||||
const wxChar *szMsg)
|
||||
const wxChar *szMsg)
|
||||
{
|
||||
if ( !cond )
|
||||
wxOnAssert(szFile, nLine, szCond, szMsg);
|
||||
|
@@ -104,7 +104,6 @@ long wxApp::sm_lastMessageTime = 0;
|
||||
long wxApp::s_lastModifiers = 0 ;
|
||||
|
||||
|
||||
bool wxApp::s_macDefaultEncodingIsPC = true ;
|
||||
bool wxApp::s_macSupportPCMenuShortcuts = true ;
|
||||
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
|
||||
long wxApp::s_macPreferencesMenuItemId = wxID_PREFERENCES ;
|
||||
@@ -1561,7 +1560,7 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr )
|
||||
{
|
||||
// Activate window first
|
||||
::SelectWindow( window ) ;
|
||||
|
||||
|
||||
// Send event later
|
||||
if ( win )
|
||||
win->MacMouseDown( ev , windowPart ) ;
|
||||
@@ -2177,7 +2176,7 @@ void wxApp::MacHandleMouseMovedEvent(wxInt32 x , wxInt32 y ,wxUint32 modifiers ,
|
||||
event.m_controlDown = modifiers & controlKey;
|
||||
event.m_altDown = modifiers & optionKey;
|
||||
event.m_metaDown = modifiers & cmdKey;
|
||||
|
||||
|
||||
event.m_x = x;
|
||||
event.m_y = y;
|
||||
event.m_timeStamp = timestamp;
|
||||
|
@@ -104,7 +104,6 @@ long wxApp::sm_lastMessageTime = 0;
|
||||
long wxApp::s_lastModifiers = 0 ;
|
||||
|
||||
|
||||
bool wxApp::s_macDefaultEncodingIsPC = true ;
|
||||
bool wxApp::s_macSupportPCMenuShortcuts = true ;
|
||||
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
|
||||
long wxApp::s_macPreferencesMenuItemId = wxID_PREFERENCES ;
|
||||
@@ -1561,7 +1560,7 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr )
|
||||
{
|
||||
// Activate window first
|
||||
::SelectWindow( window ) ;
|
||||
|
||||
|
||||
// Send event later
|
||||
if ( win )
|
||||
win->MacMouseDown( ev , windowPart ) ;
|
||||
@@ -2177,7 +2176,7 @@ void wxApp::MacHandleMouseMovedEvent(wxInt32 x , wxInt32 y ,wxUint32 modifiers ,
|
||||
event.m_controlDown = modifiers & controlKey;
|
||||
event.m_altDown = modifiers & optionKey;
|
||||
event.m_metaDown = modifiers & cmdKey;
|
||||
|
||||
|
||||
event.m_x = x;
|
||||
event.m_y = y;
|
||||
event.m_timeStamp = timestamp;
|
||||
|
@@ -37,10 +37,12 @@
|
||||
#ifdef __WXMAC__
|
||||
#include <Threads.h>
|
||||
#include "wx/mac/uma.h"
|
||||
#include "wx/mac/macnotfy.h"
|
||||
#endif
|
||||
|
||||
#define INFINITE 0xFFFFFFFF
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -257,12 +259,12 @@ public:
|
||||
}
|
||||
|
||||
bool IsOk() const { return m_mutex.IsOk() ; }
|
||||
|
||||
|
||||
wxCondError Wait()
|
||||
{
|
||||
return WaitTimeout(0xFFFFFFFF );
|
||||
}
|
||||
|
||||
|
||||
wxCondError WaitTimeout(unsigned long msectimeout)
|
||||
{
|
||||
wxMacStCritical critical ;
|
||||
@@ -300,7 +302,7 @@ public:
|
||||
{
|
||||
wxMacStCritical critical ;
|
||||
return wxCOND_NO_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
wxArrayLong m_waiters ;
|
||||
wxInt32 m_excessSignals ;
|
||||
@@ -844,7 +846,7 @@ bool wxThreadModule::OnInit()
|
||||
#endif
|
||||
if ( !hasThreadManager )
|
||||
{
|
||||
wxMessageBox( wxT("Error") , wxT("Thread Support is not available on this System") , wxOK ) ;
|
||||
wxLogSysError( wxT("Thread Support is not available on this System") );
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
|
@@ -10,6 +10,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include <MacTextEditor.h>
|
||||
|
||||
@@ -30,6 +33,7 @@
|
||||
#endif
|
||||
#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 wxWindows code can safely assume that appearance 1.1
|
||||
@@ -40,7 +44,6 @@ static bool sUMAHasAppearance = false ;
|
||||
static long sUMAAppearanceVersion = 0 ;
|
||||
static long sUMASystemVersion = 0 ;
|
||||
static bool sUMAHasAquaLayout = false ;
|
||||
static bool sUMASystemInitialized = false ;
|
||||
|
||||
extern int gAGABackgroundColor ;
|
||||
bool UMAHasAppearance() { return sUMAHasAppearance ; }
|
||||
@@ -53,7 +56,7 @@ static long sUMAWindowManagerAttr = 0 ;
|
||||
bool UMAHasWindowManager() { return sUMAHasWindowManager ; }
|
||||
long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; }
|
||||
bool UMAHasAquaLayout() { return sUMAHasAquaLayout ; }
|
||||
bool UMASystemIsInitialized() { return sUMASystemInitialized ; }
|
||||
|
||||
|
||||
void UMACleanupToolbox()
|
||||
{
|
||||
@@ -158,7 +161,7 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
||||
}
|
||||
|
||||
|
||||
sUMASystemInitialized = true ;
|
||||
UMASetSystemIsInitialized(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -295,7 +298,7 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn
|
||||
// for some reasons this must be 0 right now
|
||||
// everything else leads to just the first function key item
|
||||
// to be selected. Thanks to Ryan Wilcox for finding out.
|
||||
macKey = 0 ;
|
||||
macKey = 0 ;
|
||||
glyph = kMenuF1Glyph + ( key - WXK_F1 ) ;
|
||||
if ( key >= WXK_F13 )
|
||||
glyph += 13 ;
|
||||
@@ -777,3 +780,21 @@ OSStatus UMAPutScrap( Size size , OSType type , void *data )
|
||||
return err ;
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#if wxUSE_BASE
|
||||
|
||||
static bool sUMASystemInitialized = false ;
|
||||
|
||||
bool UMASystemIsInitialized()
|
||||
{
|
||||
return sUMASystemInitialized ;
|
||||
}
|
||||
|
||||
void UMASetSystemIsInitialized(bool val)
|
||||
{
|
||||
sUMASystemInitialized = val;
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
@@ -359,6 +359,10 @@ bool wxIsBusy()
|
||||
return (gs_wxBusyCursorCount > 0);
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#if wxUSE_BASE
|
||||
|
||||
wxString wxMacFindFolder( short vol,
|
||||
OSType folderType,
|
||||
Boolean createFolder)
|
||||
@@ -378,6 +382,10 @@ wxString wxMacFindFolder( short vol,
|
||||
return strDir ;
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
// Check whether this window wants to process messages, e.g. Stop button
|
||||
// in long calculations.
|
||||
bool wxCheckForInterrupt(wxWindow *wnd)
|
||||
@@ -534,10 +542,6 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
|
||||
}
|
||||
#endif // !__DARWIN__
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMac Specific utility functions
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -691,6 +695,7 @@ wxWCharBuffer wxMacStringToWString( const wxString &from )
|
||||
return result ;
|
||||
}
|
||||
|
||||
|
||||
wxString wxMacMakeStringFromCString( const char * from , int len )
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
@@ -771,6 +776,11 @@ wxString wxMacMakeStringFromPascal( ConstStringPtr from )
|
||||
return wxMacMakeStringFromCString( (char*) &from[1] , from[0] ) ;
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
|
||||
//
|
||||
// CFStringRefs (Carbon only)
|
||||
//
|
||||
|
@@ -37,10 +37,12 @@
|
||||
#ifdef __WXMAC__
|
||||
#include <Threads.h>
|
||||
#include "wx/mac/uma.h"
|
||||
#include "wx/mac/macnotfy.h"
|
||||
#endif
|
||||
|
||||
#define INFINITE 0xFFFFFFFF
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -257,12 +259,12 @@ public:
|
||||
}
|
||||
|
||||
bool IsOk() const { return m_mutex.IsOk() ; }
|
||||
|
||||
|
||||
wxCondError Wait()
|
||||
{
|
||||
return WaitTimeout(0xFFFFFFFF );
|
||||
}
|
||||
|
||||
|
||||
wxCondError WaitTimeout(unsigned long msectimeout)
|
||||
{
|
||||
wxMacStCritical critical ;
|
||||
@@ -300,7 +302,7 @@ public:
|
||||
{
|
||||
wxMacStCritical critical ;
|
||||
return wxCOND_NO_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
wxArrayLong m_waiters ;
|
||||
wxInt32 m_excessSignals ;
|
||||
@@ -844,7 +846,7 @@ bool wxThreadModule::OnInit()
|
||||
#endif
|
||||
if ( !hasThreadManager )
|
||||
{
|
||||
wxMessageBox( wxT("Error") , wxT("Thread Support is not available on this System") , wxOK ) ;
|
||||
wxLogSysError( wxT("Thread Support is not available on this System") );
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
|
@@ -10,6 +10,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include <MacTextEditor.h>
|
||||
|
||||
@@ -30,6 +33,7 @@
|
||||
#endif
|
||||
#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 wxWindows code can safely assume that appearance 1.1
|
||||
@@ -40,7 +44,6 @@ static bool sUMAHasAppearance = false ;
|
||||
static long sUMAAppearanceVersion = 0 ;
|
||||
static long sUMASystemVersion = 0 ;
|
||||
static bool sUMAHasAquaLayout = false ;
|
||||
static bool sUMASystemInitialized = false ;
|
||||
|
||||
extern int gAGABackgroundColor ;
|
||||
bool UMAHasAppearance() { return sUMAHasAppearance ; }
|
||||
@@ -53,7 +56,7 @@ static long sUMAWindowManagerAttr = 0 ;
|
||||
bool UMAHasWindowManager() { return sUMAHasWindowManager ; }
|
||||
long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr ; }
|
||||
bool UMAHasAquaLayout() { return sUMAHasAquaLayout ; }
|
||||
bool UMASystemIsInitialized() { return sUMASystemInitialized ; }
|
||||
|
||||
|
||||
void UMACleanupToolbox()
|
||||
{
|
||||
@@ -158,7 +161,7 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
|
||||
}
|
||||
|
||||
|
||||
sUMASystemInitialized = true ;
|
||||
UMASetSystemIsInitialized(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -295,7 +298,7 @@ void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEn
|
||||
// for some reasons this must be 0 right now
|
||||
// everything else leads to just the first function key item
|
||||
// to be selected. Thanks to Ryan Wilcox for finding out.
|
||||
macKey = 0 ;
|
||||
macKey = 0 ;
|
||||
glyph = kMenuF1Glyph + ( key - WXK_F1 ) ;
|
||||
if ( key >= WXK_F13 )
|
||||
glyph += 13 ;
|
||||
@@ -777,3 +780,21 @@ OSStatus UMAPutScrap( Size size , OSType type , void *data )
|
||||
return err ;
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#if wxUSE_BASE
|
||||
|
||||
static bool sUMASystemInitialized = false ;
|
||||
|
||||
bool UMASystemIsInitialized()
|
||||
{
|
||||
return sUMASystemInitialized ;
|
||||
}
|
||||
|
||||
void UMASetSystemIsInitialized(bool val)
|
||||
{
|
||||
sUMASystemInitialized = val;
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
@@ -359,6 +359,10 @@ bool wxIsBusy()
|
||||
return (gs_wxBusyCursorCount > 0);
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#if wxUSE_BASE
|
||||
|
||||
wxString wxMacFindFolder( short vol,
|
||||
OSType folderType,
|
||||
Boolean createFolder)
|
||||
@@ -378,6 +382,10 @@ wxString wxMacFindFolder( short vol,
|
||||
return strDir ;
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
// Check whether this window wants to process messages, e.g. Stop button
|
||||
// in long calculations.
|
||||
bool wxCheckForInterrupt(wxWindow *wnd)
|
||||
@@ -534,10 +542,6 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
|
||||
}
|
||||
#endif // !__DARWIN__
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxMac Specific utility functions
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -691,6 +695,7 @@ wxWCharBuffer wxMacStringToWString( const wxString &from )
|
||||
return result ;
|
||||
}
|
||||
|
||||
|
||||
wxString wxMacMakeStringFromCString( const char * from , int len )
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
@@ -771,6 +776,11 @@ wxString wxMacMakeStringFromPascal( ConstStringPtr from )
|
||||
return wxMacMakeStringFromCString( (char*) &from[1] , from[0] ) ;
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
|
||||
//
|
||||
// CFStringRefs (Carbon only)
|
||||
//
|
||||
|
@@ -1166,6 +1166,9 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
#if wxUSE_BASE
|
||||
|
||||
void wxHandleProcessTermination(wxEndProcessData *proc_data)
|
||||
{
|
||||
// notify user about termination if required
|
||||
@@ -1186,5 +1189,5 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
Reference in New Issue
Block a user