updated mac sources (CW 5.3 working , CW6 still having code gen problems)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-02-08 21:13:12 +00:00
parent 1db8dc4a2b
commit 5b781a6729
67 changed files with 1772 additions and 257 deletions

View File

@@ -370,7 +370,7 @@ public:
// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
// code if required.
#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)
#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || (defined(__DARWIN__) && defined(__WXMAC__))
#define IMPLEMENT_WXWIN_MAIN \
extern int wxEntry( int argc, char *argv[] ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }

View File

@@ -21,6 +21,10 @@
#include "wx/colour.h"
#include "wx/gdicmn.h"
#if defined( __WXMAC__ ) && defined( TARGET_CARBON )
#include <PMApplication.h>
#endif
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
class WXDLLEXPORT wxPrintSetupData;
#endif
@@ -187,8 +191,13 @@ public:
void* m_devMode;
void* m_devNames;
#elif defined( __WXMAC__ )
#if TARGET_CARBON
PMPageFormat m_macPageFormat ;
PMPrintSettings m_macPrintSettings ;
#else
THPrint m_macPrintInfo ;
#endif
#endif
private:
@@ -284,8 +293,6 @@ class WXDLLEXPORT wxPrintDialogData: public wxObject
#ifdef __WXMSW__
void* m_printDlgData;
#elif defined( __WXMAC__ )
THPrint m_macPrintInfo ;
#endif
private:
@@ -388,8 +395,6 @@ public:
#if defined(__WIN95__)
void* m_pageSetupData;
#elif defined( __WXMAC__ )
THPrint m_macPageSetupInfo ;
#endif
private:

View File

@@ -36,6 +36,19 @@ class WXDLLEXPORT wxDateSpan;
#define inline
#endif // Debug
// not all c-runtimes are based on 1/1/1970 being (time_t) 0
// set this to the corresponding value in seconds 1/1/1970 has on your
// systems c-runtime
#ifdef __WXMAC__
#if __MSL__ < 0x6000
#define WX_TIME_BASE_OFFSET ( 2082844800L + 126144000L )
#else
#define WX_TIME_BASE_OFFSET 0
#endif
#else
#define WX_TIME_BASE_OFFSET 0
#endif
/*
* TODO
*

View File

@@ -66,7 +66,7 @@ inline wxDateTime wxDateTime::Today()
inline wxDateTime& wxDateTime::Set(time_t timet)
{
// assign first to avoid long multiplication overflow!
m_time = timet;
m_time = timet - WX_TIME_BASE_OFFSET ;
m_time *= TIME_T_FACTOR;
return *this;
@@ -146,10 +146,10 @@ inline time_t wxDateTime::GetTicks() const
return (time_t)-1;
}
return (time_t)((m_time / (long)TIME_T_FACTOR).GetLo());
return (time_t)((m_time / (long)TIME_T_FACTOR).GetLo())+WX_TIME_BASE_OFFSET ;
}
inline bool wxDateTime::SetToLastWeekDay(WeekDay weekday,
bool wxDateTime::SetToLastWeekDay(WeekDay weekday,
Month month,
int year)
{

View File

@@ -25,7 +25,8 @@
// ----------------------------------------------------------------------------
// define off_t
#ifndef __WXMAC__
#if !defined(__WXMAC__) || defined(__DARWIN__)
#include <sys/types.h>
#else
typedef long off_t;
@@ -264,7 +265,12 @@ WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX
#define wxPATH_SEP wxPATH_SEP_UNIX
#elif defined(__MAC__)
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_MAC
// TODO find out whether we can really switch back to native file names
// previously this mac was emulating unix/win filename structures
// #define wxFILE_SEP_PATH wxFILE_SEP_PATH_MAC
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_DOS
#define wxPATH_SEP wxPATH_SEP_DOS
#else // Windows and OS/2
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_DOS
#define wxPATH_SEP wxPATH_SEP_DOS

View File

@@ -18,6 +18,10 @@
#include "wx/defs.h"
#ifndef wxUSE_GEOMETRY
#define wxUSE_GEOMETRY 0
#endif
#if wxUSE_GEOMETRY
#include "wx/utils.h"

View File

@@ -147,10 +147,10 @@ public :
virtual void MacHandleHighLevelEvent( EventRecord *ev ) ;
virtual void MacHandleMenuSelect( int menuid , int menuitem ) ;
virtual OSErr MacHandleAEODoc(AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEPDoc(AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEOApp(AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEQuit(AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEODoc(const AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEPDoc(const AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEOApp(const AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEQuit(const AppleEvent *event , AppleEvent *reply) ;
DECLARE_EVENT_TABLE()
};

View File

@@ -26,9 +26,10 @@ class WXDLLEXPORT wxChoice: public wxControl
DECLARE_DYNAMIC_CLASS(wxChoice)
public:
inline wxChoice() {}
wxChoice() {}
~wxChoice() ;
inline wxChoice(wxWindow *parent, wxWindowID id,
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,

View File

@@ -33,7 +33,11 @@ class WXDLLEXPORT wxPrinterDC: public wxDC
virtual void StartPage(void) ;
virtual void EndPage(void) ;
protected :
#if TARGET_CARBON
PMPrintContext m_macPrintPort ;
#else
TPPrPort m_macPrintPort ;
#endif
wxPrintData m_printData ;
};

View File

@@ -35,6 +35,8 @@ protected:
wxString m_dir;
wxString m_path; // Full path
wxString m_fileName;
wxArrayString m_fileNames;
wxArrayString m_paths;
wxString m_wildCard;
int m_filterIndex;
public:
@@ -54,6 +56,8 @@ public:
inline wxString GetPath() const { return m_path; }
inline wxString GetDirectory() const { return m_dir; }
inline wxString GetFilename() const { return m_fileName; }
void GetPaths(wxArrayString& paths) const { paths = m_paths; }
void GetFilenames(wxArrayString& files) const { files = m_fileNames; }
inline wxString GetWildcard() const { return m_wildCard; }
inline long GetStyle() const { return m_dialogStyle; }
inline int GetFilterIndex() const { return m_filterIndex ; }

View File

@@ -23,8 +23,8 @@ class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric
{
DECLARE_DYNAMIC_CLASS(wxStatusBarMac);
wxStatusBarMac(void);
inline wxStatusBarMac(wxWindow *parent, wxWindowID id,
wxStatusBarMac();
wxStatusBarMac(wxWindow *parent, wxWindowID id,
long style = 0,
const wxString& name = wxPanelNameStr)
{
@@ -34,7 +34,7 @@ class WXDLLEXPORT wxStatusBarMac : public wxStatusBarGeneric
~wxStatusBarMac();
bool Create(wxWindow *parent, wxWindowID id,
long style,
long style ,
const wxString& name = wxPanelNameStr) ;
virtual void DrawFieldText(wxDC& dc, int i);

View File

@@ -16,6 +16,11 @@
#define UMA_USE_8_6 0
#if TARGET_CARBON
#undef UMA_USE_8_6
#define UMA_USE_8_6 1
#endif
#if defined(__POWERPC__) || defined(__MACH__)
#define UMA_USE_APPEARANCE 1
#define UMA_USE_WINDOWMGR 1
@@ -35,6 +40,7 @@
#endif
void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
void UMACleanupToolbox() ;
bool UMAHasAppearance() ;
long UMAGetAppearanceVersion() ;
@@ -69,8 +75,8 @@ void UMADrawMenuBar() ;
void UMAShowWatchCursor() ;
void UMAShowArrowCursor() ;
void UMAPrOpen() ;
void UMAPrClose() ;
OSStatus UMAPrOpen() ;
OSStatus UMAPrClose() ;
// window manager

View File

@@ -28,14 +28,17 @@ public:
public:
bool Create(const wxString& fileName, bool isResource = FALSE);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool IsOk() const { return !m_sndname.IsEmpty(); }
bool Play(bool async = TRUE, bool looped = FALSE) const;
protected:
bool Free();
private:
char* m_waveData;
SndChannelPtr m_sndChan;
wxString m_sndname;
SndListHandle m_hSnd;
int m_waveLength;
bool m_isResource;
};

View File

@@ -246,7 +246,12 @@ public :
WindowRef GetMacRootWindow() const ;
virtual ControlHandle MacGetContainerForEmbedding() ;
virtual long MacGetBorderSize() const ;
virtual long MacGetLeftBorderSize() const ;
virtual long MacGetRightBorderSize() const ;
virtual long MacGetTopBorderSize() const ;
virtual long MacGetBottomBorderSize() const ;
static long MacRemoveBordersFromStyle( long style ) ;
virtual void MacSuperChangedPosition() ;
virtual void MacSuperShown( bool show ) ;

View File

@@ -255,6 +255,12 @@ WXDLLEXPORT const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString)
WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString);
#endif
#ifdef __WXMAC__
WXDLLEXPORT wxString wxMacFindFolder(short vRefNum,
OSType folderType,
Boolean createFolder);
#endif
#if wxUSE_GUI // GUI only things from now on
// ----------------------------------------------------------------------------

View File

@@ -9,6 +9,8 @@
#include "wx/qt/wave.h"
#elif defined(__WXPM__)
#include "wx/os2/wave.h"
#elif defined(__WXMAC__)
#include "wx/mac/wave.h"
#endif
#endif