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:
Robin Dunn
2003-09-13 00:03:18 +00:00
parent 439484990e
commit 2dbc444a19
15 changed files with 1519 additions and 1413 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -109,10 +109,14 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
src/mac/mimetmac.cpp
src/unix/baseunix.cpp
src/mac/utilsexc.cpp
src/mac/thread.cpp
src/mac/macnotfy.cpp
src/mac/morefilex/MoreFilesX.c
</set>
<set var="BASE_AND_GUI_MAC_SRC" hints="files">
src/mac/utils.cpp
src/mac/uma.cpp
</set>
<set var="BASE_MAC_HDR" hints="files">
@@ -1546,13 +1550,11 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
src/mac/gdiobj.cpp
src/mac/icon.cpp
src/mac/listbox.cpp
src/mac/macnotfy.cpp
src/mac/mdi.cpp
src/mac/menu.cpp
src/mac/menuitem.cpp
src/mac/metafile.cpp
src/mac/minifram.cpp
src/mac/morefilex/MoreFilesX.c
src/mac/msgdlg.cpp
src/mac/notebmac.cpp
src/mac/palette.cpp
@@ -1575,12 +1577,10 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
src/mac/stattext.cpp
src/mac/tabctrl.cpp
src/mac/textctrl.cpp
src/mac/thread.cpp
src/mac/timer.cpp
src/mac/toolbar.cpp
src/mac/tooltip.cpp
src/mac/toplevel.cpp
src/mac/uma.cpp
src/mac/window.cpp
<!-- Generic implementations used by wxMac: -->
src/generic/caret.cpp

View File

@@ -291,6 +291,12 @@ public:
int argc;
wxChar **argv;
#ifdef __WXMAC__
// This is needed in the wxAppConsole class because it is refereced from
// the wxBase library
static bool s_macDefaultEncodingIsPC ;
#endif
protected:
// the function which creates the traits object when GetTraits() needs it
// for the first time

View File

@@ -114,7 +114,6 @@ private:
WXEVENTREF m_macCurrentEvent ;
public:
static bool s_macDefaultEncodingIsPC ;
static bool s_macSupportPCMenuShortcuts ;
static long s_macAboutMenuItemId ;
static long s_macPreferencesMenuItemId ;

View File

@@ -22,13 +22,17 @@ long UMAGetAppearanceVersion() ;
bool UMAHasWindowManager() ;
long UMAGetWindowManagerAttr() ;
bool UMAHasAquaLayout() ;
bool UMASystemIsInitialized() ;
void UMASetSystemIsInitialized(bool val);
// process manager
long UMAGetProcessMode() ;
bool UMAGetProcessModeDoesActivateOnFGSwitch() ;
#if wxUSE_GUI
// menu manager
MenuRef UMANewMenu( SInt16 id , const wxString& title ) ;
@@ -123,4 +127,6 @@ OSStatus UMAPutScrap( Size size , OSType type , void *data ) ;
#endif
#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
#endif // wxUSE_GUI
#endif

View File

@@ -93,6 +93,10 @@ wxAppConsole *wxAppConsole::ms_appInstance = NULL;
wxAppInitializerFunction wxAppConsole::ms_appInitFn = NULL;
#ifdef __WXMAC__
bool wxAppConsole::s_macDefaultEncodingIsPC = true ;
#endif
// ============================================================================
// wxAppConsole implementation
// ============================================================================

View File

@@ -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 ;

View File

@@ -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 ;

View File

@@ -37,10 +37,12 @@
#ifdef __WXMAC__
#include <Threads.h>
#include "wx/mac/uma.h"
#include "wx/mac/macnotfy.h"
#endif
#define INFINITE 0xFFFFFFFF
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
@@ -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 ;
}

View File

@@ -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);
}
@@ -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

View File

@@ -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)
//

View File

@@ -37,10 +37,12 @@
#ifdef __WXMAC__
#include <Threads.h>
#include "wx/mac/uma.h"
#include "wx/mac/macnotfy.h"
#endif
#define INFINITE 0xFFFFFFFF
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
@@ -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 ;
}

View File

@@ -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);
}
@@ -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

View File

@@ -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)
//

View File

@@ -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