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:
@@ -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
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "wx/listbox.h"
|
||||
|
||||
#if !defined(__MWERKS__) && !defined(__MACH__)
|
||||
#if !defined(__MWERKS__) && !defined(__UNIX__)
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
|
||||
|
@@ -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 ;
|
||||
|
@@ -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)) { }
|
||||
|
@@ -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;
|
||||
};
|
||||
|
@@ -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() ; }
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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:
|
||||
|
@@ -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
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -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;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#pragma interface "palette.h"
|
||||
#endif
|
||||
|
||||
#include "wx/colour.h"
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -17,6 +17,8 @@
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/slider.h"
|
||||
#include "wx/stattext.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user