modifications for compilation under Mac OS X

applied patches extracted from submission by Marc Newsam (tested under Mac OS 9)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2001-02-15 21:51:14 +00:00
parent f0c5ebdc0d
commit 03e11df547
149 changed files with 1693 additions and 761 deletions

View File

@@ -61,7 +61,9 @@ class WXDLLEXPORT wxAppBase : public wxEvtHandler
public:
// the virtual functions which may/must be overridden in the derived class
// -----------------------------------------------------------------------
#ifdef __WXMAC_X__
virtual ~wxAppBase() {} // Added min for Mac X
#endif
// called during the program initialization, returning FALSE from here
// prevents the program from continuing - it's a good place to create
// the top level program window and return TRUE.
@@ -370,7 +372,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__) || (defined(__DARWIN__) && defined(__WXMAC__))
#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || (defined(__WXMAC__) && defined(__UNIX__))
#define IMPLEMENT_WXWIN_MAIN \
extern int wxEntry( int argc, char *argv[] ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }

View File

@@ -21,11 +21,13 @@
#include "wx/colour.h"
#include "wx/gdicmn.h"
#if defined( __WXMAC__ ) && defined( TARGET_CARBON )
#include <PMApplication.h>
#if defined(__WXMAC__) && defined(TARGET_CARBON)
#if !defined(__UNIX__)
#include <PMApplication.h>
#endif
#endif
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMAC__)) && wxUSE_POSTSCRIPT
class WXDLLEXPORT wxPrintSetupData;
#endif
@@ -169,7 +171,7 @@ class WXDLLEXPORT wxPrintData: public wxObject
void operator=(const wxPrintData& data);
// For compatibility
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)) && wxUSE_POSTSCRIPT
#if (defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMAC__)) && wxUSE_POSTSCRIPT
void operator=(const wxPrintSetupData& setupData);
#endif
@@ -181,7 +183,7 @@ class WXDLLEXPORT wxPrintData: public wxObject
void SetNativeData(void* data) { m_devMode = data; }
void* GetNativeDataDevNames() const { return m_devNames; }
void SetNativeDataDevNames(void* data) { m_devNames = data; }
#elif defined( __WXMAC__)
#elif defined(__WXMAC__)
void ConvertToNative();
void ConvertFromNative();
#endif
@@ -286,7 +288,7 @@ class WXDLLEXPORT wxPrintDialogData: public wxObject
void ConvertFromNative();
void SetOwnerWindow(wxWindow* win);
void* GetNativeData() const { return m_printDlgData; }
#elif defined( __WXMAC__)
#elif defined(__WXMAC__)
void ConvertToNative();
void ConvertFromNative();
#endif
@@ -375,7 +377,7 @@ public:
void ConvertFromNative();
void SetOwnerWindow(wxWindow* win);
void* GetNativeData() const { return m_pageSetupData; }
#elif defined( __WXMAC__)
#elif defined(__WXMAC__)
void ConvertToNative();
void ConvertFromNative();
#endif

View File

@@ -29,6 +29,9 @@
class WXDLLEXPORT wxControlBase : public wxWindow
{
public:
#ifdef __WXMAC_X__
virtual ~wxControlBase() {} // Added min for Mac X
#endif
// simulates the event of given type (i.e. wxButton::Command() is just as
// if the button was clicked)
virtual void Command(wxCommandEvent &event);

View File

@@ -29,6 +29,9 @@ class WXDLLEXPORT wxControlWithItems : public wxControl
{
public:
wxControlWithItems() { m_clientDataItemsType = ClientData_None; }
#ifdef __WXMAC_X__
virtual ~wxControlWithItems() {} // Added min for Mac X
#endif
// adding items
// ------------

View File

@@ -52,8 +52,33 @@
#define OS2EMX_PLAIN_CHAR
#endif
#elif defined(applec) || defined(THINK_C) || ( defined( __MWERKS__ ) && !defined(__INTEL__) )
#if defined(__APPLE__)
// MacOS X
#ifndef __WXMAC__
#define __WXMAC__
#endif
#ifndef __WXMAC_X__
#define __WXMAC_X__
#endif
#define PM_USE_SESSION_APIS 0
#include <Carbon/Carbon.h>
#endif
#elif defined(applec) || defined(THINK_C) || (defined(__MWERKS__) && !defined(__INTEL__))
// MacOS
#elif defined(__WXMAC__) && defined(__APPLE__)
// MacOS X
#define __UNIX_LIKE__
#ifndef __WXMAC__
#define __WXMAC__
#endif
#ifndef __WXMAC_X__
#define __WXMAC_X__
#endif
#define PM_USE_SESSION_APIS 0
#include <Carbon/Carbon.h>
#elif defined(__OS2__)
#if defined(__IBMCPP__)
#define __VISAGEAVER__ __IBMCPP__

View File

@@ -22,6 +22,9 @@
class WXDLLEXPORT wxDialogBase : public wxPanel
{
public:
#ifdef __WXMAC_X__
~wxDialogBase() {} // Added min for Mac X
#endif
// the modal dialogs have a return code - usually the id of the last
// pressed button
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }

View File

@@ -22,7 +22,11 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
#elif defined(__WXQT__)
#include "wx/qt/dirdlg.h"
#elif defined(__WXMAC__)
#ifdef __WXMAC_X__
#include "wx/generic/dirdlgg.h"
#else
#include "wx/mac/dirdlg.h"
#endif
#elif defined(__WXPM__)
#include "wx/os2/dirdlg.h"
#elif defined(__WXSTUBS__)

View File

@@ -164,6 +164,7 @@ private:
// { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src);
// so using a temporary variable instead.
// ----------------------------------------------------------------------------
// __MAC_X__ added min ~name() below for compiling Mac X
#define _WX_DEFINE_ARRAY(T, name, classexp) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \
classexp name : public wxBaseArray \
@@ -176,6 +177,7 @@ public: \
if ( type > sizelong ) \
{ wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \
} \
~name() {} \
\
name& operator=(const name& src) \
{ wxBaseArray* temp = (wxBaseArray*) this; \

View File

@@ -48,6 +48,8 @@
#elif defined(__WINDOWS__)
# include <windows.h> // needed to get HMODULE
typedef HMODULE wxDllType;
#elif defined(__APPLE__) && defined(__UNIX__)
typedef void *wxDllType;
#elif defined(__WXMAC__)
typedef CFragConnectionID wxDllType;
#else

View File

@@ -21,7 +21,11 @@ enum
#elif defined(__WXQT__)
#include "wx/qt/filedlg.h"
#elif defined(__WXMAC__)
#ifdef __WXMAC_X__
#include "wx/generic/filedlgg.h"
#else
#include "wx/mac/filedlg.h"
#endif
#elif defined(__WXPM__)
#include "wx/os2/filedlg.h"
#elif defined(__WXSTUBS__)

View File

@@ -25,8 +25,7 @@
// ----------------------------------------------------------------------------
// define off_t
#if !defined(__WXMAC__) || defined(__DARWIN__)
#if !defined(__WXMAC__) || defined(__UNIX__)
#include <sys/types.h>
#else
typedef long off_t;
@@ -256,16 +255,18 @@ WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
#define wxFILE_SEP_PATH_MAC wxT(':')
// separator in the path list (as in PATH environment variable)
// there is no PATH variable in Classic Mac OS so just use the
// semicolon (it must be different from the file name separator)
// NB: these are strings and not characters on purpose!
#define wxPATH_SEP_DOS wxT(";")
#define wxPATH_SEP_UNIX wxT(":")
#define wxPATH_SEP_MAC wxT(";")
// platform independent versions
#ifdef __UNIX__
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX
#define wxPATH_SEP wxPATH_SEP_UNIX
#elif defined(__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

View File

@@ -78,6 +78,9 @@ class WXDLLEXPORT wxFontBase : public wxGDIObject
{
public:
// creator function
#ifdef __WXMAC_X__
virtual ~wxFontBase() {} // Added min for Mac X
#endif
// from the font components
static wxFont *New(

View File

@@ -58,6 +58,9 @@ class WXDLLEXPORT wxFrameBase : public wxWindow
public:
// construction
wxFrameBase();
#ifdef __WXMAC_X__
virtual ~wxFrameBase() {} // Added min for Mac X
#endif
wxFrame *New(wxWindow *parent,
wxWindowID id,

View File

@@ -31,7 +31,11 @@
#ifdef __WXMSW__
#define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c )
#elif defined( __WXMAC__ )
#ifdef __WXMAC_X__
#include <CarbonCore/Math64.h>
#else
#include "Math64.h"
#endif
#define wxMulDivInt32( a , b , c ) S32Set( S64Div( S64Multiply( S64Set(a) , S64Set(b) ) , S64Set(c) ) )
#else
#define wxMulDivInt32( a , b , c ) ((wxInt32)((a)*(((wxDouble)b)/((wxDouble)c))))

View File

@@ -484,6 +484,9 @@ class WXDLLEXPORT wxList : public wxObjectList
{
public:
wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { }
#ifdef __WXMAC_X__
~wxList() {} // Added min for Mac X
#endif
wxList& operator=(const wxList& list)
{ return (wxList&)wxListBase::operator=(list); }

View File

@@ -45,6 +45,9 @@ class WXDLLEXPORT wxListBoxBase : public wxControlWithItems
public:
// all generic methods are in wxControlWithItems, except for the following
// ones which are not yet implemented by wxChoice/wxCombobox
#ifdef __WXMAC_X__
virtual ~wxListBoxBase() {} // Added min for Mac X
#endif
void Insert(const wxString& item, int pos)
{ DoInsert(item, pos); }

View File

@@ -28,10 +28,10 @@ class WXDLLEXPORT wxBitmapHandler;
class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxCursor;
GWorldPtr wxMacCreateGWorld( int height , int widtdh , int depth ) ;
void wxMacDestroyGWorld( GWorldPtr gw ) ;
GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
void wxMacDestroyGWorld( GWorldPtr gw ) ;
PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
CTabHandle wxMacCreateColorTable( int numColors ) ;
// A mask is a mono bitmap used for drawing bitmaps
@@ -100,6 +100,9 @@ class WXDLLEXPORT wxBitmapHandler: public wxObject
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
public:
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; };
#ifdef __WXMAC_X__
virtual ~wxBitmapHandler() {} // Added min for Mac X
#endif
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
@@ -138,6 +141,7 @@ public:
// Initialize with XPM data
wxBitmap(const char **data);
wxBitmap(char **data);
// Load a file or resource
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_PICT_RESOURCE);
@@ -193,6 +197,7 @@ protected:
public:
void SetHBITMAP(WXHBITMAP bmp);
inline WXHBITMAP GetHBITMAP() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
bool FreeResource(bool force = FALSE);
};
#endif

View File

@@ -19,7 +19,7 @@
#include "wx/listbox.h"
#if !defined(__MWERKS__) && !defined(__MACH__)
#if !defined(__MWERKS__) && !defined(__UNIX__)
typedef unsigned int size_t;
#endif

View File

@@ -49,6 +49,9 @@ class WXDLLEXPORT wxChoice: public wxControl
const wxString& name = wxChoiceNameStr);
virtual void Append(const wxString& item);
// Added min Append and GetClientData
virtual void Append(const wxString& item, void *client_data);
virtual void *GetClientData(int index) const;
virtual void Delete(int n);
virtual void Clear();
virtual int GetSelection() const ;

View File

@@ -52,33 +52,35 @@ public:
virtual void SetLabel(const wxString& title) ;
wxList& GetSubcontrols() { return m_subControls; }
void OnEraseBackground(wxEraseEvent& event);
virtual bool Enable(bool enabled) ;
virtual bool Show(bool show) ;
virtual void MacRedrawControl () ;
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label ,
const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator,
const wxString& name , Rect *outBounds , StringPtr maclabel ) ;
virtual void MacPostControlCreate() ;
virtual void MacAdjustControlRect() ;
virtual ControlHandle MacGetContainerForEmbedding() ;
virtual void MacSuperChangedPosition() ;
virtual void MacSuperEnabled( bool enabled ) ;
virtual void MacSuperShown( bool show ) ;
virtual bool MacCanFocus() const ;
virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags ) ;
virtual void OnKeyDown( wxKeyEvent &event ) ;
virtual void OnMouseEvent( wxMouseEvent &event ) ;
virtual void OnPaint(wxPaintEvent& event) ;
virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ;
ControlHandle GetMacControl() { return m_macControl ;}
virtual bool Enable(bool enabled) ;
virtual bool Show(bool show = TRUE) ;
virtual void MacRedrawControl () ;
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label ,
const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator,
const wxString& name ,
Rect *outBounds ,
StringPtr maclabel ) ;
virtual void MacPostControlCreate() ;
virtual void MacAdjustControlRect() ;
virtual ControlHandle MacGetContainerForEmbedding() ;
virtual void MacSuperChangedPosition() ;
virtual void MacSuperEnabled( bool enabled ) ;
virtual void MacSuperShown( bool show ) ;
virtual bool MacCanFocus() const ;
virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags ) ;
virtual void OnKeyDown( wxKeyEvent &event ) ;
virtual void OnMouseEvent( wxMouseEvent &event ) ;
virtual void OnPaint(wxPaintEvent& event) ;
virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL) ;
ControlHandle GetMacControl() { return m_macControl ;}
#if WXWIN_COMPATIBILITY
virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }

View File

@@ -24,6 +24,9 @@ class wxDataObject : public wxDataObjectBase
{
public:
wxDataObject();
#ifdef __WXMAC_X__
~wxDataObject() {} // Added min for Mac X
#endif
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
};

View File

@@ -297,65 +297,65 @@ class WXDLLEXPORT wxDC: public wxDCBase
public:
long XDEV2LOG(long x) const
wxCoord XDEV2LOG(wxCoord x) const
{
long new_x = x - m_deviceOriginX;
if (new_x > 0)
return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
else
return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
}
long XDEV2LOGREL(long x) const
wxCoord XDEV2LOGREL(wxCoord x) const
{
if (x > 0)
return (long)((double)(x) / m_scaleX + 0.5);
return (wxCoord)((double)(x) / m_scaleX + 0.5);
else
return (long)((double)(x) / m_scaleX - 0.5);
return (wxCoord)((double)(x) / m_scaleX - 0.5);
}
long YDEV2LOG(long y) const
wxCoord YDEV2LOG(wxCoord y) const
{
long new_y = y - m_deviceOriginY;
if (new_y > 0)
return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
else
return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
}
long YDEV2LOGREL(long y) const
wxCoord YDEV2LOGREL(wxCoord y) const
{
if (y > 0)
return (long)((double)(y) / m_scaleY + 0.5);
return (wxCoord)((double)(y) / m_scaleY + 0.5);
else
return (long)((double)(y) / m_scaleY - 0.5);
return (wxCoord)((double)(y) / m_scaleY - 0.5);
}
long XLOG2DEV(long x) const
wxCoord XLOG2DEV(wxCoord x) const
{
long new_x = x - m_logicalOriginX;
if (new_x > 0)
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
else
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
}
long XLOG2DEVREL(long x) const
wxCoord XLOG2DEVREL(wxCoord x) const
{
if (x > 0)
return (long)((double)(x) * m_scaleX + 0.5);
return (wxCoord)((double)(x) * m_scaleX + 0.5);
else
return (long)((double)(x) * m_scaleX - 0.5);
return (wxCoord)((double)(x) * m_scaleX - 0.5);
}
long YLOG2DEV(long y) const
wxCoord YLOG2DEV(wxCoord y) const
{
long new_y = y - m_logicalOriginY;
if (new_y > 0)
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
else
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
}
long YLOG2DEVREL(long y) const
wxCoord YLOG2DEVREL(wxCoord y) const
{
if (y > 0)
return (long)((double)(y) * m_scaleY + 0.5);
return (wxCoord)((double)(y) * m_scaleY + 0.5);
else
return (long)((double)(y) * m_scaleY - 0.5);
return (wxCoord)((double)(y) * m_scaleY - 0.5);
}
//
@@ -495,7 +495,7 @@ protected:
GrafPtr m_macOrigPort ;
Rect m_macClipRect ;
Point m_macLocalOrigin ;
AGAPortHelper m_macPortHelper ;
mutable AGAPortHelper m_macPortHelper ;
void MacSetupPort() const ;
void MacVerifySetup() const { if ( m_macPortId != m_macCurrentPortId ) MacSetupPort() ; }

View File

@@ -24,6 +24,7 @@ class WXDLLEXPORT wxPrinterDC: public wxDC
public:
DECLARE_CLASS(wxPrinterDC)
#if wxUSE_PRINTING_ARCHITECTURE
// Create a printer DC
wxPrinterDC(const wxPrintData& printdata );
~wxPrinterDC();
@@ -39,6 +40,7 @@ class WXDLLEXPORT wxPrinterDC: public wxDC
TPPrPort m_macPrintPort ;
#endif
wxPrintData m_printData ;
#endif // wxUSE_PRINTING_ARCHITECTURE
};
#endif

View File

@@ -25,9 +25,11 @@
class WXDLLEXPORT wxWindow;
#ifndef __WXMAC_X__
class WXDLLEXPORT wxDataObject;
class WXDLLEXPORT wxTextDataObject;
class WXDLLEXPORT wxFileDataObject;
#endif
class WXDLLEXPORT wxDropTarget;
class WXDLLEXPORT wxTextDropTarget;
@@ -35,11 +37,12 @@ class WXDLLEXPORT wxFileDropTarget;
class WXDLLEXPORT wxDropSource;
#ifndef __WXMAC_X__
//-------------------------------------------------------------------------
// wxDataObject
//-------------------------------------------------------------------------
class WXDLLEXPORT wxDataObject: public wxObject
class WXDLLEXPORT wxDataObject : public wxObject
{
public:
// all data formats (values are the same as in windows.h, do not change!)
@@ -138,6 +141,8 @@ private:
wxString m_files;
};
#endif
//-------------------------------------------------------------------------
// wxDropTarget
//-------------------------------------------------------------------------
@@ -163,6 +168,7 @@ class WXDLLEXPORT wxDropTarget: public wxObject
virtual wxDataFormat GetFormat(size_t n) const = 0;
};
#ifndef __WXMAC_X__
//-------------------------------------------------------------------------
// wxTextDropTarget
//-------------------------------------------------------------------------
@@ -200,20 +206,12 @@ class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
};
#endif
//-------------------------------------------------------------------------
// wxDropSource
//-------------------------------------------------------------------------
enum wxDragResult
{
wxDragError, // error prevented the d&d operation from completing
wxDragNone, // drag target didn't accept the data
wxDragCopy, // the data was successfully copied
wxDragMove, // the data was successfully moved
wxDragCancel // the operation was cancelled by user (not an error)
};
class WXDLLEXPORT wxDropSource: public wxObject
{
public:

View File

@@ -72,6 +72,8 @@ class WXDLLEXPORT wxImageList: public wxObject
// Returns the number of images in the image list.
int GetImageCount() const;
bool GetSize(int index, int&width, int &height) const;
// Operations
////////////////////////////////////////////////////////////////////////////

View File

@@ -25,6 +25,7 @@ public :
// implement containing class functions
wxFileType *GetFileTypeFromExtension(const wxString& ext);
wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext) ;
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
size_t EnumAllFileTypes(wxArrayString& mimetypes);
@@ -35,6 +36,12 @@ public :
void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); }
// create a new filetype association
wxFileType *Associate(const wxFileTypeInfo& ftInfo);
// create a new filetype with the given name and extension
wxFileType *CreateFileType(const wxString& filetype, const wxString& ext);
private:
wxArrayFileTypeInfo m_fallbacks;
};
@@ -61,6 +68,11 @@ public:
const wxFileType::MessageParameters&) const
{ return GetCommand(printCmd, "print"); }
size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands,
const wxFileType::MessageParameters& params) const;
bool Unassociate();
private:
// helper function
bool GetCommand(wxString *command, const char *verb) const;

View File

@@ -16,6 +16,7 @@
#pragma interface "palette.h"
#endif
#include "wx/colour.h"
#include "wx/gdiobj.h"
class WXDLLEXPORT wxPalette;

View File

@@ -40,15 +40,15 @@ class wxPNGReader
protected:
int filetype;
char filename[255];
ImagePointerType RawImage; // Image data
ImagePointerType RawImage; // Image data
int Width, Height; // Dimensions
int Depth; // (bits x pixel)
int ColorType; // Bit 1 = Palette used
// Bit 2 = Color used
// Bit 3 = Alpha used
int Width, Height; // Dimensions
int Depth; // (bits x pixel)
int ColorType; // Bit 1 = Palette used
// Bit 2 = Color used
// Bit 3 = Alpha used
long EfeWidth; // Efective Width
long EfeWidth; // Efective Width
GWorldPtr lpbi;
int bgindex;
@@ -58,7 +58,7 @@ friend class wxPNGReaderIter;
public:
wxPNGReader(void);
wxPNGReader (char* ImageFileName); // Read an image file
~wxPNGReader ();
virtual ~wxPNGReader ();
void Create(int width, int height, int deep, int colortype=-1);

View File

@@ -17,6 +17,8 @@
#endif
#include "wx/control.h"
#include "wx/slider.h"
#include "wx/stattext.h"
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;

View File

@@ -33,7 +33,7 @@ class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
{
public:
// construction
wxSpinButton() { }
wxSpinButton();
wxSpinButton(wxWindow *parent,
wxWindowID id = -1,
@@ -56,6 +56,8 @@ public:
// accessors
virtual int GetMin() const;
virtual int GetMax() const;
virtual int GetValue() const;
virtual void SetValue(int val);
virtual void SetRange(int minVal, int maxVal);

View File

@@ -21,12 +21,15 @@
#define UMA_USE_8_6 1
#endif
#if defined(__POWERPC__) || defined(__MACH__)
#define UMA_USE_APPEARANCE 1
#define UMA_USE_WINDOWMGR 1
#if defined(__POWERPC__) || defined(__APPLE__)
#define UMA_USE_APPEARANCE 1
#define UMA_USE_WINDOWMGR 1
#if defined(__APPLE__)
#include <Carbon/Carbon.h>
#endif
#else
#define UMA_USE_APPEARANCE 0
#define UMA_USE_WINDOWMGR 0
#define UMA_USE_APPEARANCE 0
#define UMA_USE_WINDOWMGR 0
#endif
#if !UMA_USE_8_6 && UMA_USE_WINDOWMGR
@@ -242,4 +245,4 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ;
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
#endif
#endif

View File

@@ -86,7 +86,7 @@ public:
};
#endif
#ifdef __UNIX__
#if defined(__UNIX__) && !defined(__APPLE__)
#include <sys/socket.h>
#ifndef __VMS__
# include <sys/un.h>

View File

@@ -54,7 +54,7 @@ protected:
#include "wx/msw/statbr95.h"
typedef wxStatusBar95 wxStatusBarReal;
#elif defined(__WXMAC__)
#elif defined(__WXMAC__) && !defined(__UNIX__)
#include "wx/mac/statusbr.h"
typedef wxStatusBarMac wxStatusBarReal;

View File

@@ -276,20 +276,5 @@ class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
#endif
// _WX_TREECTRL_H_

View File

@@ -123,17 +123,16 @@ public:
{ _T("%H:%M:%S"), _T("%H:%M") } // wx24h
};
static wxChar s_bufTime[128];
wxStrncpy(ms_bufTime, m_time.Format(formats[ms_Format][ms_Precision]),
WXSIZEOF(ms_bufTime));
wxStrncpy(s_bufTime, m_time.Format(formats[ms_Format][ms_Precision]),
WXSIZEOF(s_bufTime));
return s_bufTime;
return ms_bufTime;
}
private:
static tFormat ms_Format;
static tPrecision ms_Precision;
static wxChar ms_bufTime[128];
#if 0 // old wxTime members unused any more
clockTy sec; /* seconds since 1/1/1901 */

View File

@@ -49,6 +49,10 @@ public:
void SetOwner(wxEvtHandler *owner, int id = -1)
{ m_owner = owner; m_idTimer = id; }
#ifdef __WXMAC_X__
virtual ~wxTimerBase() {} // Added min for Mac X
#endif
// working with the timer
// ----------------------

View File

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

View File

@@ -25,7 +25,7 @@
#endif
*/
#else
#define USE_PRECOMPILED_MAC_HEADERS 1 /*Set to 0 if you don't want to use precompiled MacHeaders*/
#define USE_PRECOMPILED_MAC_HEADERS 1 /*Set to 0 if you don't want to use precompiled MacHeaders*/
#endif
// automatically includes MacHeaders
#elif (__MWERKS__ >= 0x0900) && __INTEL__

View File

@@ -366,7 +366,7 @@ typedef unsigned __WCHAR_TYPE__ wxUChar;
# define wxUChar unsigned char
# endif
# if defined(__FreeBSD__) || defined(__MACH__)
# if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__UNIX__))
# undef _T
# endif
@@ -419,7 +419,7 @@ typedef unsigned __WCHAR_TYPE__ wxUChar;
# elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
# define wxStricmp _stricmp
# define wxStrnicmp _strnicmp
# elif defined(__UNIX__) || defined(__GNUWIN32__) || defined(__MACH__)
# elif defined(__UNIX__) || defined(__GNUWIN32__)
# define wxStricmp strcasecmp
# define wxStrnicmp strncasecmp
# elif defined(__MWERKS__) && !defined(__INTEL__)

View File

@@ -24,6 +24,7 @@
#undef WX_PRECOMP
#define wxUSE_GUI 1
#define OLDP2C 1
#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef __WXMSW__
#include <windows.h>

View File

@@ -24,6 +24,7 @@
#define WX_PRECOMP
#define wxUSE_GUI 1
#define OLDP2C 1
#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef WX_PRECOMP
#include "wx/wxprec.h"

View File

@@ -17,6 +17,7 @@
#define __WXDEBUG__ 1
#define wxUSE_GUI 1
#define OLDP2C 1
#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef __WXMSW__
#include <windows.h>

View File

@@ -17,6 +17,7 @@
#define __WXDEBUG__ 1
#define wxUSE_GUI 1
#define OLDP2C 1
#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#include "wx/wx_cw_cm.h"
#ifdef WX_PRECOMP
#include "wx/wxprec.h"