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"

View File

@ -76,6 +76,15 @@
else
return (void *)0;
}
#elif defined(__APPLE__) && defined(__UNIX__)
char *dlopen(char *path, int mode /* mode is ignored */);
void *dlsym(void *handle, char *symbol);
int dlclose(void *handle);
char *dlerror();
# define wxDllOpen(lib) dlopen(lib.fn_str(), 0)
# define wxDllGetSymbol(handle, name) dlsym(handle, name)
# define wxDllClose dlclose
#elif defined(__WINDOWS__)
// using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary
# ifdef __WIN32__
@ -221,7 +230,7 @@ wxDllLoader::LoadLibrary(const wxString & libname, bool *success)
{
wxDllType handle;
#if defined(__WXMAC__)
#if defined(__WXMAC__) && !defined(__UNIX__)
FSSpec myFSSpec ;
Ptr myMainAddr ;
Str255 myErrName ;
@ -294,13 +303,17 @@ wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name)
{
void *symbol = NULL; // return value
#if defined( __WXMAC__ )
#if defined(__WXMAC__) && !defined(__UNIX__)
Ptr symAddress ;
CFragSymbolClass symClass ;
Str255 symName ;
strcpy( (char*) symName , name ) ;
c2pstr( (char*) symName ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) symName , name ) ;
#else
strcpy( (char *) symName , name ) ;
c2pstr( (char *) symName ) ;
#endif
if ( FindSymbol( dllHandle , symName , &symAddress , &symClass ) == noErr )
symbol = (void *)symAddress ;

View File

@ -114,11 +114,11 @@
extern wxChar *wxBuffer;
#ifdef __WXMAC__
#include "morefile.h"
#include "moreextr.h"
#include "fullpath.h"
#include "fspcompa.h"
#if defined(__WXMAC__) && !defined(__UNIX__)
#include "morefile.h"
#include "moreextr.h"
#include "fullpath.h"
#include "fspcompa.h"
#endif
IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList)
@ -817,7 +817,7 @@ wxString wxPathOnly (const wxString& path)
// and back again - or we get nasty problems with delimiters.
// Also, convert to lower case, since case is significant in UNIX.
#ifdef __WXMAC__
#if defined(__WXMAC__) && !defined(__UNIX__)
static char sMacFileNameConversion[ 1000 ] ;
@ -1058,7 +1058,7 @@ wxCopyFile (const wxString& file1, const wxString& file2)
return FALSE;
}
#ifndef __VISAGECPP__
#if !defined(__VISAGECPP__) && !defined(__WXMAC__)
// no chmod in VA. SHould be some permission API for HPFS386 partitions however
if ( chmod(file2, fbuf.st_mode) != 0 )
{

View File

@ -50,7 +50,7 @@
#include "wx/protocol/ftp.h"
#if defined(__WXMAC__)
#include "/wx/mac/macsock.h"
#include "wx/mac/macsock.h"
#endif
#ifndef __MWERKS__

View File

@ -1398,12 +1398,16 @@ wxImage::wxImage( const wxBitmap &bitmap )
#ifdef __WXMAC__
#include <PictUtils.h>
#ifdef __UNIX__
#include <QD/PictUtils.h>
#else
#include <PictUtils.h>
#endif
extern CTabHandle wxMacCreateColorTable( int numColors ) ;
extern void wxMacDestroyColorTable( CTabHandle colors ) ;
extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
extern GWorldPtr wxMacCreateGWorld( int height , int width , int depth ) ;
extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
wxBitmap wxImage::ConvertToBitmap() const

View File

@ -398,7 +398,7 @@ wxLogStderr::wxLogStderr(FILE *fp)
m_fp = fp;
}
#if defined(__WXMAC__)
#if defined(__WXMAC__) && !defined(__UNIX__)
#define kDebuggerSignature 'MWDB'
static Boolean FindProcessBySignature(OSType signature, ProcessInfoRec* info)
@ -494,7 +494,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
str += wxT("\r\n") ;
OutputDebugString(str.c_str());
#endif // MSW
#if defined(__WXMAC__) && wxUSE_GUI
#if defined(__WXMAC__) && !defined(__WXMAC_X__) && wxUSE_GUI
Str255 pstr ;
strcpy( (char*) pstr , str.c_str() ) ;
strcat( (char*) pstr , ";g" ) ;
@ -525,7 +525,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
DebugStr(pstr);
#endif
}
#endif // MSW
#endif // Mac
}
// ----------------------------------------------------------------------------

View File

@ -42,7 +42,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxIPV4address, wxSockAddress)
#ifdef ENABLE_IPV6
IMPLEMENT_DYNAMIC_CLASS(wxIPV6address, wxSockAddress)
#endif
#ifdef __UNIX__
#if defined(__UNIX__) && !defined(__WXMAC_X__)
IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress)
#endif
@ -201,7 +201,7 @@ unsigned short wxIPV6address::Service()
#endif
#ifdef __UNIX__
#if defined(__UNIX__) && !defined(__WXMAC_X__)
// ---------------------------------------------------------------------------
// wxUNIXaddress
// ---------------------------------------------------------------------------

View File

@ -116,6 +116,8 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
#if defined(__VISUALC__) || (defined(__MINGW32__) && wxUSE_NORLANDER_HEADERS)
#define wxVsnprintfA _vsnprintf
#endif
#elif defined(__WXMAC__)
#define wxVsnprintfA vsnprintf
#else // !Windows
#ifdef HAVE_VSNPRINTF
#define wxVsnprintfA vsnprintf
@ -130,9 +132,7 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
#if defined(__VISUALC__)
#pragma message("Using sprintf() because no snprintf()-like function defined")
#elif defined(__GNUG__) && !defined(__UNIX__)
#warning "Using sprintf() because no snprintf()-like function defined"
#elif defined(__MWERKS__)
#elif defined(__GNUG__)
#warning "Using sprintf() because no snprintf()-like function defined"
#endif //compiler
#endif // no vsnprintf
@ -1410,7 +1410,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
// NB: wxVsnprintf() may return either less than the buffer size or -1 if
// there is not enough place depending on implementation
int iLen = wxVsnprintfA(szScratch, WXSIZEOF(szScratch), pszFormat, argptr);
int iLen = wxVsnprintfA(szScratch, WXSIZEOF(szScratch), (char *)pszFormat, argptr);
if ( iLen != -1 ) {
// the whole string is in szScratch
*this = szScratch;

View File

@ -44,6 +44,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
wxTime::tFormat wxTime::ms_Format = wxTime::wx12h;
wxTime::tPrecision wxTime::ms_Precision = wxTime::wxStdMinSec;
wxChar wxTime::ms_bufTime[128];
#endif
IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)

View File

@ -33,6 +33,8 @@
// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
#include "../zlib/zlib.h"
#elif defined(__WXMAC__) && defined(__UNIX__)
#include <Zip/zlib.h>
#else
#include <zlib.h>
#endif

View File

@ -72,7 +72,7 @@ wxTipWindow::wxTipWindow(wxWindow *parent,
{
// set colours
SetForegroundColour(*wxBLACK);
#if !defined(__WXPM__)
#if !defined(__WXPM__) && !defined(__WXMAC__)
SetBackgroundColour(wxColour(0xc3ffff));
#else
// What is 0xc3ffff, try some legable documentation for those of us who don't memorize hex codes??

Binary file not shown.

View File

@ -1,5 +1,5 @@
#include <wx/mac/uma.h>
#include <wx/mac/aga.h>
#include "wx/mac/uma.h"
#include "wx/mac/aga.h"
#if !TARGET_CARBON
@ -13,26 +13,27 @@ pascal SInt32 AGAListControlDefProc (SInt16 procID, ControlHandle theControl, Co
pascal SInt32 AGAEditTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
pascal SInt32 AGAStaticGroupBoxTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
#define B 13
#define W 0
#define B 13
#define W 0
SInt16 kAGARootControlProcID ;
int gAGABackgroundColor = 0 ;
const RGBColor gAGAColorArray[] = { {0xFFFF, 0xFFFF, 0xFFFF}, // W
{0xEEEE, 0xEEEE, 0xEEEE}, // 1
{0xDDDD, 0xDDDD, 0xDDDD}, // 2
{0xCCCC, 0xCCCC, 0xCCCC}, // 3
{0xBBBB, 0xBBBB, 0xBBBB}, // 4
{0xAAAA, 0xAAAA, 0xAAAA}, // 5
{0x9999, 0x9999, 0x9999}, // 6
{0x8888, 0x8888, 0x8888}, // 7
{0x7777, 0x7777, 0x7777}, // 8
{0x6666, 0x6666, 0x6666}, // 9
{0x5555, 0x5555, 0x5555}, // 10
{0x4444, 0x4444, 0x4444}, // 11
{0x2222, 0x2222, 0x2222}, // 12
{0x0000, 0x0000, 0x0000} // B
const RGBColor gAGAColorArray[] = {
{0xFFFF, 0xFFFF, 0xFFFF}, // W
{0xEEEE, 0xEEEE, 0xEEEE}, // 1
{0xDDDD, 0xDDDD, 0xDDDD}, // 2
{0xCCCC, 0xCCCC, 0xCCCC}, // 3
{0xBBBB, 0xBBBB, 0xBBBB}, // 4
{0xAAAA, 0xAAAA, 0xAAAA}, // 5
{0x9999, 0x9999, 0x9999}, // 6
{0x8888, 0x8888, 0x8888}, // 7
{0x7777, 0x7777, 0x7777}, // 8
{0x6666, 0x6666, 0x6666}, // 9
{0x5555, 0x5555, 0x5555}, // 10
{0x4444, 0x4444, 0x4444}, // 11
{0x2222, 0x2222, 0x2222}, // 12
{0x0000, 0x0000, 0x0000} // B
};
char LAGADefaultOutline_mCorners[4][5][5] = {
@ -2552,7 +2553,8 @@ void AGAApplyThemeBackground(ThemeBackgroundKind inKind,
{
}
#endif
#endif // !TARGET_CARBON
AGAPortHelper::AGAPortHelper( GrafPtr newport)
{
GetPort( &port ) ;

View File

@ -13,6 +13,7 @@
#pragma implementation "app.h"
#endif
#include "wx/window.h"
#include "wx/frame.h"
#include "wx/app.h"
#include "wx/utils.h"
@ -29,6 +30,7 @@
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
#include "wx/menu.h"
#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
@ -37,18 +39,24 @@
// mac
#if __option(profile)
#ifndef __UNIX__
#if __option(profile)
#include <profiler.h>
#endif
#endif
#include "apprsrc.h"
#include <wx/mac/uma.h>
#include <wx/mac/macnotfy.h>
#include "wx/mac/uma.h"
#include "wx/mac/macnotfy.h"
#if wxUSE_SOCKETS
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#ifdef __APPLE__
#include <OT/OpenTransport.h>
#else
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#endif
#endif
extern char *wxBuffer;
@ -327,10 +335,25 @@ bool wxApp::Initialize()
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) , (long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) , (long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) , (long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) , (long) wxTheApp , FALSE ) ;
#ifdef __UNIX__
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , AEHandleODoc ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , AEHandleOApp ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , AEHandlePDoc ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , AEHandleQuit ,
(long) wxTheApp , FALSE ) ;
#else
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) ,
(long) wxTheApp , FALSE ) ;
#endif
// test the minimal configuration necessary
@ -384,13 +407,17 @@ bool wxApp::Initialize()
return FALSE ;
}
#if __option(profile)
#ifndef __UNIX__
#if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
#endif
#endif
// now avoid exceptions thrown for new (bad_alloc)
#ifndef __UNIX__
std::__throws_bad_alloc = FALSE ;
#endif
s_macCursorRgn = ::NewRgn() ;
@ -422,8 +449,9 @@ bool wxApp::Initialize()
wxBitmap::InitStandardHandlers();
wxModule::RegisterModules();
if (!wxModule::InitializeModules())
if (!wxModule::InitializeModules()) {
return FALSE;
}
wxWinMacWindowList = new wxList(wxKEY_INTEGER);
wxWinMacControlList = new wxList(wxKEY_INTEGER);
@ -483,9 +511,11 @@ void wxApp::CleanUp()
wxClassInfo::CleanUpClasses();
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
#ifndef __UNIX__
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
#endif
#endif
delete wxTheApp;
@ -532,8 +562,9 @@ int wxEntry( int argc, char *argv[] , bool enterLoop )
wxDebugContext::SetCheckpoint();
#endif
#endif
if (!wxApp::Initialize())
if (!wxApp::Initialize()) {
return 0;
}
// create the application object or ensure that one already exists
if (!wxTheApp)
{
@ -601,7 +632,7 @@ int wxEntry( int argc, char *argv[] , bool enterLoop )
wxApp::CleanUp();
return retValue;
};
}
// Static member initialization
wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NULL;
@ -1038,6 +1069,7 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
s_lastMouseDown = 0;
break;
case inGrow:
{
int growResult = GrowWindow(window , ev->where, &screenBits.bounds);
if (growResult != 0)
{
@ -1057,6 +1089,7 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
}
}
s_lastMouseDown = 0;
}
break;
case inZoomIn:
case inZoomOut:
@ -1464,7 +1497,8 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
wxWindow* currentMouseWindow = NULL ;
MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , &currentMouseWindow ) ;
wxWindow::MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) ,
&currentMouseWindow ) ;
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{

View File

@ -13,6 +13,7 @@
#pragma implementation "bitmap.h"
#endif
#include "wx/wx.h"
#include "wx/setup.h"
#include "wx/utils.h"
#include "wx/palette.h"
@ -22,7 +23,11 @@
extern "C"
{
#ifdef __UNIX__
#include "xpm/xpm.h"
#else
#include "xpm.h"
#endif
} ;
#if !USE_SHARED_LIBRARIES
@ -30,12 +35,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
#endif
#include <PictUtils.h>
#ifdef __UNIX__
#include <QD/PictUtils.h>
#else
#include <PictUtils.h>
#endif
CTabHandle wxMacCreateColorTable( int numColors )
{
CTabHandle newColors; /* Handle to the new color table */
short index; /* Index into the table of colors */
/* Allocate memory for the color table */
newColors = (CTabHandle)NewHandleClear( sizeof (ColorTable) +
sizeof (ColorSpec) * (numColors - 1) );
@ -63,11 +72,11 @@ void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int g
(**newColors).ctTable[index].rgb.blue = 0 ; // someBlueValue;
}
GWorldPtr wxMacCreateGWorld( int height , int width , int depth )
GWorldPtr wxMacCreateGWorld( int width , int height , int depth )
{
OSErr err = noErr ;
GWorldPtr port ;
Rect rect = { 0 , 0 , width , height } ;
Rect rect = { 0 , 0 , height , width } ;
if ( depth < 0 )
{
@ -80,7 +89,7 @@ GWorldPtr wxMacCreateGWorld( int height , int width , int depth )
return port ;
}
return NULL ;
}
}
void wxMacDestroyGWorld( GWorldPtr gw )
{
@ -127,7 +136,7 @@ wxBitmapRefData::~wxBitmapRefData()
default :
// unkown type ?
break ;
} ;
}
if (m_bitmapMask)
{
@ -162,8 +171,8 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits
M_BITMAPDATA->m_numColors = 0;
if ( no_bits == 1 )
{
M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
M_BITMAPDATA->m_ok = (M_BITMAPDATA->m_hBitmap != NULL ) ;
CGrafPtr origPort ;
@ -180,16 +189,16 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits
if ( the_width % 16 )
{
linesize += 2 ;
} ;
}
RGBColor colors[2] = {
{ 0xFFFF , 0xFFFF , 0xFFFF } ,
{ 0, 0 , 0 }
} ;
for( int y = 0 ; y < the_height ; ++y , linestart += linesize )
for ( int y = 0 ; y < the_height ; ++y , linestart += linesize )
{
for( int x = 0 ; x < the_width ; ++x )
for ( int x = 0 ; x < the_width ; ++x )
{
int index = x / 8 ;
int bit = x % 8 ;
@ -211,7 +220,7 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits
}
else
{
//multicolor BITMAPs not yet implemented
wxFAIL_MSG(wxT("multicolor BITMAPs not yet implemented"));
}
if ( wxTheBitmapList )
@ -247,6 +256,11 @@ wxBitmap::wxBitmap(const char **data)
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
wxBitmap::wxBitmap(char **data)
{
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
bool wxBitmap::Create(int w, int h, int d)
{
UnRef();
@ -596,8 +610,12 @@ bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
{
Str255 theName ;
strcpy( (char*) theName , name ) ;
c2pstr( (char*) theName ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) theName , name ) ;
#else
strcpy( (char *) theName , name ) ;
c2pstr( (char *)theName ) ;
#endif
PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ;
if ( thePict )

View File

@ -14,6 +14,7 @@
#endif
#include "wx/button.h"
#include "wx/panel.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
@ -53,15 +54,33 @@ void wxButton::SetDefault()
btnOldDefault = panel->GetDefaultItem();
panel->SetDefaultItem(this);
}
if ( btnOldDefault && btnOldDefault->m_macControl )
{
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
}
if ( m_macControl )
{
UMASetControlData( m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
}
#ifdef __UNIX__
Boolean inData;
if ( btnOldDefault && btnOldDefault->m_macControl )
{
inData = 0;
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
}
if ( m_macControl )
{
inData = 1;
UMASetControlData( m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
}
#else
if ( btnOldDefault && btnOldDefault->m_macControl )
{
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
}
if ( m_macControl )
{
UMASetControlData( m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
}
#endif
}
wxSize wxButton::DoGetBestSize() const

View File

@ -1,5 +1,5 @@
#include <wx/mac/uma.h>
#include <wx/mac/aga.h>
#include "wx/mac/uma.h"
#include "wx/mac/aga.h"
#if !TARGET_CARBON
@ -13,26 +13,27 @@ pascal SInt32 AGAListControlDefProc (SInt16 procID, ControlHandle theControl, Co
pascal SInt32 AGAEditTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
pascal SInt32 AGAStaticGroupBoxTextDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param) ;
#define B 13
#define W 0
#define B 13
#define W 0
SInt16 kAGARootControlProcID ;
int gAGABackgroundColor = 0 ;
const RGBColor gAGAColorArray[] = { {0xFFFF, 0xFFFF, 0xFFFF}, // W
{0xEEEE, 0xEEEE, 0xEEEE}, // 1
{0xDDDD, 0xDDDD, 0xDDDD}, // 2
{0xCCCC, 0xCCCC, 0xCCCC}, // 3
{0xBBBB, 0xBBBB, 0xBBBB}, // 4
{0xAAAA, 0xAAAA, 0xAAAA}, // 5
{0x9999, 0x9999, 0x9999}, // 6
{0x8888, 0x8888, 0x8888}, // 7
{0x7777, 0x7777, 0x7777}, // 8
{0x6666, 0x6666, 0x6666}, // 9
{0x5555, 0x5555, 0x5555}, // 10
{0x4444, 0x4444, 0x4444}, // 11
{0x2222, 0x2222, 0x2222}, // 12
{0x0000, 0x0000, 0x0000} // B
const RGBColor gAGAColorArray[] = {
{0xFFFF, 0xFFFF, 0xFFFF}, // W
{0xEEEE, 0xEEEE, 0xEEEE}, // 1
{0xDDDD, 0xDDDD, 0xDDDD}, // 2
{0xCCCC, 0xCCCC, 0xCCCC}, // 3
{0xBBBB, 0xBBBB, 0xBBBB}, // 4
{0xAAAA, 0xAAAA, 0xAAAA}, // 5
{0x9999, 0x9999, 0x9999}, // 6
{0x8888, 0x8888, 0x8888}, // 7
{0x7777, 0x7777, 0x7777}, // 8
{0x6666, 0x6666, 0x6666}, // 9
{0x5555, 0x5555, 0x5555}, // 10
{0x4444, 0x4444, 0x4444}, // 11
{0x2222, 0x2222, 0x2222}, // 12
{0x0000, 0x0000, 0x0000} // B
};
char LAGADefaultOutline_mCorners[4][5][5] = {
@ -2552,7 +2553,8 @@ void AGAApplyThemeBackground(ThemeBackgroundKind inKind,
{
}
#endif
#endif // !TARGET_CARBON
AGAPortHelper::AGAPortHelper( GrafPtr newport)
{
GetPort( &port ) ;

View File

@ -13,6 +13,7 @@
#pragma implementation "app.h"
#endif
#include "wx/window.h"
#include "wx/frame.h"
#include "wx/app.h"
#include "wx/utils.h"
@ -29,6 +30,7 @@
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
#include "wx/menu.h"
#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
@ -37,18 +39,24 @@
// mac
#if __option(profile)
#ifndef __UNIX__
#if __option(profile)
#include <profiler.h>
#endif
#endif
#include "apprsrc.h"
#include <wx/mac/uma.h>
#include <wx/mac/macnotfy.h>
#include "wx/mac/uma.h"
#include "wx/mac/macnotfy.h"
#if wxUSE_SOCKETS
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#ifdef __APPLE__
#include <OT/OpenTransport.h>
#else
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#endif
#endif
extern char *wxBuffer;
@ -327,10 +335,25 @@ bool wxApp::Initialize()
UMAInitToolbox( 4 ) ;
UMAShowWatchCursor() ;
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) , (long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) , (long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) , (long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) , (long) wxTheApp , FALSE ) ;
#ifdef __UNIX__
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , AEHandleODoc ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , AEHandleOApp ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , AEHandlePDoc ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , AEHandleQuit ,
(long) wxTheApp , FALSE ) ;
#else
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , NewAEEventHandlerProc(AEHandleODoc) ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication , NewAEEventHandlerProc(AEHandleOApp) ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments , NewAEEventHandlerProc(AEHandlePDoc) ,
(long) wxTheApp , FALSE ) ;
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication , NewAEEventHandlerProc(AEHandleQuit) ,
(long) wxTheApp , FALSE ) ;
#endif
// test the minimal configuration necessary
@ -384,13 +407,17 @@ bool wxApp::Initialize()
return FALSE ;
}
#if __option(profile)
#ifndef __UNIX__
#if __option(profile)
ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
#endif
#endif
// now avoid exceptions thrown for new (bad_alloc)
#ifndef __UNIX__
std::__throws_bad_alloc = FALSE ;
#endif
s_macCursorRgn = ::NewRgn() ;
@ -422,8 +449,9 @@ bool wxApp::Initialize()
wxBitmap::InitStandardHandlers();
wxModule::RegisterModules();
if (!wxModule::InitializeModules())
if (!wxModule::InitializeModules()) {
return FALSE;
}
wxWinMacWindowList = new wxList(wxKEY_INTEGER);
wxWinMacControlList = new wxList(wxKEY_INTEGER);
@ -483,9 +511,11 @@ void wxApp::CleanUp()
wxClassInfo::CleanUpClasses();
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
#ifndef __UNIX__
#if __option(profile)
ProfilerDump( "\papp.prof" ) ;
ProfilerTerm() ;
#endif
#endif
delete wxTheApp;
@ -532,8 +562,9 @@ int wxEntry( int argc, char *argv[] , bool enterLoop )
wxDebugContext::SetCheckpoint();
#endif
#endif
if (!wxApp::Initialize())
if (!wxApp::Initialize()) {
return 0;
}
// create the application object or ensure that one already exists
if (!wxTheApp)
{
@ -601,7 +632,7 @@ int wxEntry( int argc, char *argv[] , bool enterLoop )
wxApp::CleanUp();
return retValue;
};
}
// Static member initialization
wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NULL;
@ -1038,6 +1069,7 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
s_lastMouseDown = 0;
break;
case inGrow:
{
int growResult = GrowWindow(window , ev->where, &screenBits.bounds);
if (growResult != 0)
{
@ -1057,6 +1089,7 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
}
}
s_lastMouseDown = 0;
}
break;
case inZoomIn:
case inZoomOut:
@ -1464,7 +1497,8 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
wxWindow* currentMouseWindow = NULL ;
MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) , &currentMouseWindow ) ;
wxWindow::MacGetWindowFromPoint( wxPoint( ev->where.h , ev->where.v ) ,
&currentMouseWindow ) ;
if ( currentMouseWindow != wxWindow::s_lastMouseWindow )
{

View File

@ -13,6 +13,7 @@
#pragma implementation "bitmap.h"
#endif
#include "wx/wx.h"
#include "wx/setup.h"
#include "wx/utils.h"
#include "wx/palette.h"
@ -22,7 +23,11 @@
extern "C"
{
#ifdef __UNIX__
#include "xpm/xpm.h"
#else
#include "xpm.h"
#endif
} ;
#if !USE_SHARED_LIBRARIES
@ -30,12 +35,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
#endif
#include <PictUtils.h>
#ifdef __UNIX__
#include <QD/PictUtils.h>
#else
#include <PictUtils.h>
#endif
CTabHandle wxMacCreateColorTable( int numColors )
{
CTabHandle newColors; /* Handle to the new color table */
short index; /* Index into the table of colors */
/* Allocate memory for the color table */
newColors = (CTabHandle)NewHandleClear( sizeof (ColorTable) +
sizeof (ColorSpec) * (numColors - 1) );
@ -63,11 +72,11 @@ void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int g
(**newColors).ctTable[index].rgb.blue = 0 ; // someBlueValue;
}
GWorldPtr wxMacCreateGWorld( int height , int width , int depth )
GWorldPtr wxMacCreateGWorld( int width , int height , int depth )
{
OSErr err = noErr ;
GWorldPtr port ;
Rect rect = { 0 , 0 , width , height } ;
Rect rect = { 0 , 0 , height , width } ;
if ( depth < 0 )
{
@ -80,7 +89,7 @@ GWorldPtr wxMacCreateGWorld( int height , int width , int depth )
return port ;
}
return NULL ;
}
}
void wxMacDestroyGWorld( GWorldPtr gw )
{
@ -127,7 +136,7 @@ wxBitmapRefData::~wxBitmapRefData()
default :
// unkown type ?
break ;
} ;
}
if (m_bitmapMask)
{
@ -162,8 +171,8 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits
M_BITMAPDATA->m_numColors = 0;
if ( no_bits == 1 )
{
M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
M_BITMAPDATA->m_ok = (M_BITMAPDATA->m_hBitmap != NULL ) ;
CGrafPtr origPort ;
@ -180,16 +189,16 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits
if ( the_width % 16 )
{
linesize += 2 ;
} ;
}
RGBColor colors[2] = {
{ 0xFFFF , 0xFFFF , 0xFFFF } ,
{ 0, 0 , 0 }
} ;
for( int y = 0 ; y < the_height ; ++y , linestart += linesize )
for ( int y = 0 ; y < the_height ; ++y , linestart += linesize )
{
for( int x = 0 ; x < the_width ; ++x )
for ( int x = 0 ; x < the_width ; ++x )
{
int index = x / 8 ;
int bit = x % 8 ;
@ -211,7 +220,7 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits
}
else
{
//multicolor BITMAPs not yet implemented
wxFAIL_MSG(wxT("multicolor BITMAPs not yet implemented"));
}
if ( wxTheBitmapList )
@ -247,6 +256,11 @@ wxBitmap::wxBitmap(const char **data)
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
wxBitmap::wxBitmap(char **data)
{
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
bool wxBitmap::Create(int w, int h, int d)
{
UnRef();
@ -596,8 +610,12 @@ bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
{
Str255 theName ;
strcpy( (char*) theName , name ) ;
c2pstr( (char*) theName ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) theName , name ) ;
#else
strcpy( (char *) theName , name ) ;
c2pstr( (char *)theName ) ;
#endif
PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ;
if ( thePict )

View File

@ -14,6 +14,7 @@
#endif
#include "wx/button.h"
#include "wx/panel.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
@ -53,15 +54,33 @@ void wxButton::SetDefault()
btnOldDefault = panel->GetDefaultItem();
panel->SetDefaultItem(this);
}
if ( btnOldDefault && btnOldDefault->m_macControl )
{
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
}
if ( m_macControl )
{
UMASetControlData( m_macControl , kControlButtonPart , kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
}
#ifdef __UNIX__
Boolean inData;
if ( btnOldDefault && btnOldDefault->m_macControl )
{
inData = 0;
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
}
if ( m_macControl )
{
inData = 1;
UMASetControlData( m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)(&inData) ) ;
}
#else
if ( btnOldDefault && btnOldDefault->m_macControl )
{
UMASetControlData( btnOldDefault->m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)0) ) ;
}
if ( m_macControl )
{
UMASetControlData( m_macControl , kControlButtonPart ,
kControlPushButtonDefaultTag , sizeof( Boolean ) , (char*)((Boolean)1) ) ;
}
#endif
}
wxSize wxButton::DoGetBestSize() const

View File

@ -15,6 +15,7 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/choice.h"
#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
@ -32,8 +33,8 @@ wxChoice::~wxChoice()
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
int n, const wxString choices[],
long style,
int n, const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name)
{
@ -75,6 +76,15 @@ void wxChoice::Append(const wxString& item)
SetControlMaximum( m_macControl , Number()) ;
}
void wxChoice::Append(const wxString &item, void *client_data)
{
}
void *wxChoice::GetClientData(int index) const
{
return NULL;
}
void wxChoice::Delete(int n)
{
::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ;

View File

@ -14,6 +14,7 @@
#endif
#include "wx/combobox.h"
#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
@ -176,10 +177,16 @@ int wxComboBox::FindString(const wxString& s) const
wxString wxComboBox::GetString(int n) const
{
Str255 text ;
::GetMenuItemText( m_macPopUpMenuHandle , n+1 , text ) ;
p2cstr( text ) ;
return wxString( text );
Str255 p_text ;
char c_text[255];
::GetMenuItemText( m_macPopUpMenuHandle , n+1 , p_text ) ;
#if TARGET_CARBON
p2cstrcpy( c_text, p_text ) ;
#else
p2cstr( p_text ) ;
strcpy( c_text, (char *) p_text ) ;
#endif
return wxString( c_text );
}
wxString wxComboBox::GetStringSelection() const

View File

@ -14,10 +14,18 @@
#endif
#include "wx/control.h"
#include "wx/panel.h"
#include "wx/app.h"
#include "wx/notebook.h"
#include "wx/tabctrl.h"
#include "wx/radiobox.h"
#include "wx/spinbutt.h"
#include "wx/scrolbar.h"
#include "wx/button.h"
#include "wx/dialog.h"
#include "wx/statbox.h"
#include "wx/sizer.h"
#include "wx/stattext.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
@ -61,7 +69,11 @@ wxControl::wxControl()
if ( wxMacLiveScrollbarActionUPP == NULL )
{
#ifdef __UNIX__
wxMacLiveScrollbarActionUPP = NewControlActionUPP( wxMacLiveScrollbarActionProc );
#else
wxMacLiveScrollbarActionUPP = NewControlActionProc( wxMacLiveScrollbarActionProc ) ;
#endif
}
}
@ -115,9 +127,12 @@ void wxControl::SetLabel(const wxString& title)
else
label = title ;
strcpy( (char*) maclabel , label ) ;
c2pstr( (char*) maclabel ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) maclabel , label ) ;
#else
strcpy( (char *) maclabel , label ) ;
c2pstr( (char *) maclabel ) ;
#endif
::SetControlTitle( m_macControl , maclabel ) ;
}
}
@ -209,13 +224,19 @@ void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString l
outBounds->bottom = outBounds->top + m_height - 2 * m_macVerticalBorder;
outBounds->right = outBounds->left + m_width - 2 * m_macHorizontalBorder ;
strcpy( (char*) maclabel , label ) ;
char c_text[255];
strcpy( c_text , label ) ;
if( wxApp::s_macDefaultEncodingIsPC )
{
wxMacConvertFromPCForControls( (char*) maclabel ) ;
wxMacConvertFromPCForControls( c_text ) ;
}
c2pstr( (char*) maclabel ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) maclabel , c_text ) ;
#else
strcpy( (char *) maclabel , c_text ) ;
c2pstr( (char *) maclabel ) ;
#endif
}
void wxControl::MacPostControlCreate()

View File

@ -14,6 +14,7 @@
#endif
#include "wx/dc.h"
#include "wx/app.h"
#include "wx/mac/uma.h"
#if __MSL__ >= 0x6000
@ -161,7 +162,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
{
if ( bmap->m_bitmapType == kMacBitmapTypePict )
{
Rect bitmaprect = { 0 , 0 , bmap->m_height * scale , bmap->m_width * scale} ;
Rect bitmaprect = { 0 , 0 , int(bmap->m_height * scale) , int(bmap->m_width * scale)} ;
::OffsetRect( &bitmaprect , xx1 , yy1 ) ;
::DrawPicture( bmap->m_hPict , &bitmaprect ) ;
}
@ -592,19 +593,19 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
if (m_pen.GetStyle() == wxTRANSPARENT)
return;
MacInstallPen() ;
MacInstallPen() ;
int offset = (m_pen.GetWidth() - 1 ) / 2 ;
int offset = (m_pen.GetWidth() - 1 ) / 2 ;
long x1, x2 , y1 , y2 ;
x1 = XLOG2DEV(points[0].x + xoffset);
y1 = YLOG2DEV(points[0].y + yoffset);
::MoveTo(x1 - offset ,y1 - offset );
y1 = YLOG2DEV(points[0].y + yoffset);
::MoveTo(x1 - offset ,y1 - offset );
for (int i = 0; i < n-1; i++)
{
long x2 = XLOG2DEV(points[i+1].x + xoffset);
long y2 = YLOG2DEV(points[i+1].y + yoffset);
::LineTo(x2 - offset , y2 - offset );
x2 = XLOG2DEV(points[i+1].x + xoffset);
y2 = YLOG2DEV(points[i+1].y + yoffset);
::LineTo(x2 - offset , y2 - offset );
}
}
@ -619,14 +620,14 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[],
PolyHandle polygon = OpenPoly() ;
long x1, x2 , y1 , y2 ;
x1 = XLOG2DEV(points[0].x + xoffset);
y1 = YLOG2DEV(points[0].y + yoffset);
::MoveTo(x1,y1);
y1 = YLOG2DEV(points[0].y + yoffset);
::MoveTo(x1,y1);
for (int i = 0; i < n-1; i++)
{
long x2 = XLOG2DEV(points[i+1].x + xoffset);
long y2 = YLOG2DEV(points[i+1].y + yoffset);
::LineTo(x2, y2);
x2 = XLOG2DEV(points[i+1].x + xoffset);
y2 = YLOG2DEV(points[i+1].y + yoffset);
::LineTo(x2, y2);
}
ClosePoly() ;
@ -725,13 +726,13 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
if (m_brush.GetStyle() != wxTRANSPARENT)
{
MacInstallBrush() ;
::PaintRoundRect( &rect , radius * 2 , radius * 2 ) ;
::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
};
if (m_pen.GetStyle() != wxTRANSPARENT)
{
MacInstallPen() ;
::FrameRoundRect( &rect , radius * 2 , radius * 2 ) ;
::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
};
}
@ -959,10 +960,12 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
RGBColor black = { 0,0,0} ;
RGBForeColor( &m_textForegroundColour.GetPixel() ) ;
RGBBackColor( &m_textBackgroundColour.GetPixel() ) ;
RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
RGBColor black = { 0,0,0} ;
RGBColor forecolor = m_textForegroundColour.GetPixel();
RGBColor backcolor = m_textBackgroundColour.GetPixel();
RGBForeColor( &forecolor ) ;
RGBBackColor( &backcolor ) ;
if ( LockPixels(bmappixels) )
{
@ -1240,15 +1243,17 @@ void wxDC::MacInstallFont() const
if ( font )
{
::TextFont( font->m_macFontNum ) ;
::TextSize( m_scaleY * font->m_macFontSize ) ;
::TextSize( short(m_scaleY * font->m_macFontSize) ) ;
::TextFace( font->m_macFontStyle ) ;
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
::RGBForeColor(&m_textForegroundColour.GetPixel() );
::RGBBackColor(&m_textBackgroundColour.GetPixel() );
RGBColor forecolor = m_textForegroundColour.GetPixel();
RGBColor backcolor = m_textBackgroundColour.GetPixel();
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
}
else
{
@ -1256,7 +1261,7 @@ void wxDC::MacInstallFont() const
GetFNum( "\pGeneva" , &fontnum ) ;
::TextFont( fontnum ) ;
::TextSize( m_scaleY * 10 ) ;
::TextSize( short(m_scaleY * 10) ) ;
::TextFace( 0 ) ;
// todo reset after spacing changes - or store the current spacing somewhere
@ -1264,10 +1269,12 @@ void wxDC::MacInstallFont() const
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
::RGBForeColor( &(m_textForegroundColour.GetPixel()) );
::RGBBackColor(&m_textBackgroundColour.GetPixel() );
}
RGBColor forecolor = m_textForegroundColour.GetPixel();
RGBColor backcolor = m_textBackgroundColour.GetPixel();
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
}
short mode = patCopy ;
@ -1354,8 +1361,10 @@ void wxDC::MacInstallPen() const
if ( m_macPenInstalled )
return ;
::RGBForeColor(&m_pen.GetColour().GetPixel() );
::RGBBackColor(&m_backgroundBrush.GetColour().GetPixel() );
RGBColor forecolor = m_pen.GetColour().GetPixel();
RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
::PenNormal() ;
int penWidth = m_pen.GetWidth();
@ -1364,7 +1373,9 @@ void wxDC::MacInstallPen() const
int penStyle = m_pen.GetStyle();
if (penStyle == wxSOLID)
{
::PenPat(GetQDGlobalsBlack(&blackColor));
}
else if (IS_HATCH(penStyle))
{
Pattern pat ;
@ -1433,8 +1444,10 @@ void wxDC::MacInstallBrush() const
// foreground
::RGBForeColor(&m_brush.GetColour().GetPixel() );
::RGBBackColor(&m_backgroundBrush.GetColour().GetPixel() );
RGBColor forecolor = m_brush.GetColour().GetPixel();
RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
int brushStyle = m_brush.GetStyle();
if (brushStyle == wxSOLID)

View File

@ -16,6 +16,7 @@
#include "wx/dcclient.h"
#include "wx/dcmemory.h"
#include "wx/region.h"
#include "wx/window.h"
#include <math.h>
//-----------------------------------------------------------------------------
@ -113,7 +114,7 @@ wxPaintDC::wxPaintDC(wxWindow *window)
m_macPort = UMAGetWindowPort( windowref ) ;
MacSetupPort() ;
m_ok = TRUE ;
long x , y ,w , h ;
wxCoord x , y ,w , h ;
window->GetUpdateRegion().GetBox( x , y , w , h ) ;
m_minY = m_minX = 0;
wxSize size = window->GetSize() ;

View File

@ -24,10 +24,10 @@
#endif
#include "wx/dcprint.h"
#include "math.h"
#include "wx/msgdlg.h"
#include <math.h>
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxPrinterDC, wxDC)
#endif

View File

@ -36,14 +36,15 @@
#include "wx/dir.h"
#include "wx/filefn.h" // for wxPathExists()
#include <windows.h>
#ifndef __WXMAC_X__
#include <windows.h>
#endif
#ifdef __WXMAC__
#include "morefile.h"
#include "moreextr.h"
#include "fullpath.h"
#include "fspcompa.h"
#if defined(__WXMAC__) && !defined(__UNIX__)
#include "morefile.h"
#include "moreextr.h"
#include "fullpath.h"
#include "fspcompa.h"
#endif
// ----------------------------------------------------------------------------
@ -116,8 +117,12 @@ wxDirData::wxDirData(const wxString& dirname)
m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ;
m_CPB.hFileInfo.ioNamePtr = m_name ;
m_index = 0 ;
#ifdef __WXMAC_X__
// TODO: what are we supposed to do for Mac OS X
#else
FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
#endif
}
wxDirData::~wxDirData()
@ -131,9 +136,12 @@ void wxDirData::Rewind()
bool wxDirData::Read(wxString *filename)
{
if ( !m_isDir )
return FALSE ;
if ( !m_isDir )
return FALSE ;
#if TARGET_CARBON
char c_name[256] ;
#endif
wxString result;
short err = noErr ;
@ -146,8 +154,13 @@ bool wxDirData::Read(wxString *filename)
err = PBGetCatInfoSync((CInfoPBPtr)&m_CPB);
if ( err != noErr )
break ;
#if TARGET_CARBON
p2cstrcpy( c_name, m_name ) ;
strcpy( (char *)m_name, c_name);
#else
p2cstr( m_name ) ;
#endif
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) // we have a directory
break ;

View File

@ -20,7 +20,11 @@
#include "wx/cmndata.h"
#include "Navigation.h"
#if defined(__UNIX__)
#include <NavigationServices/Navigation.h>
#else
#include <Navigation.h>
#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
@ -457,11 +461,18 @@ int wxDirDialog::ShowModal()
Str255 prompt ;
Str255 path ;
#if TARGET_CARBON
c2pstrcpy((StringPtr)prompt, m_message) ;
#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
#endif
#if TARGET_CARBON
c2pstrcpy((StringPtr)path, m_path ) ;
#else
strcpy((char *)path, m_path ) ;
c2pstr((char *)path ) ;
#endif
StandardFileReply reply ;
FileFilterYDUPP invisiblesExcludedCustomFilterUPP = 0 ;

View File

@ -133,4 +133,4 @@ wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
return wxDragError;
};
#endif
#endif

View File

@ -19,7 +19,9 @@
#include "wx/filedlg.h"
#include "wx/intl.h"
#include "PLStringFuncs.h"
#if !defined(__UNIX__)
#include "PLStringFuncs.h"
#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
@ -27,13 +29,19 @@ IMPLEMENT_CLASS(wxFileDialog, wxDialog)
// begin wxmac
#include "Navigation.h"
#if defined(__UNIX__)
#include <NavigationServices/Navigation.h>
#else
#include <Navigation.h>
#endif
#include "morefile.h"
#include "moreextr.h"
#include "fullpath.h"
#include "fspcompa.h"
#include "PLStringFuncs.h"
#ifndef __UNIX__
#include "morefile.h"
#include "moreextr.h"
#include "fullpath.h"
#include "fspcompa.h"
#include "PLStringFuncs.h"
#endif
extern bool gUseNavServices ;
@ -497,11 +505,19 @@ int wxFileDialog::ShowModal()
Str255 prompt ;
Str255 filename ;
#if TARGET_CARBON
c2pstrcpy((StringPtr)prompt, m_message) ;
#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
#endif
#if TARGET_CARBON
c2pstrcpy((StringPtr)filename, m_fileName) ;
#else
strcpy((char *)filename, m_fileName) ;
c2pstr((char *)filename ) ;
#endif
#if !TARGET_CARBON
StandardPutFile( prompt , filename , &reply ) ;
@ -525,11 +541,18 @@ int wxFileDialog::ShowModal()
Str255 prompt ;
Str255 path ;
#if TARGET_CARBON
c2pstrcpy((StringPtr)prompt, m_message) ;
#else
strcpy((char *)prompt, m_message) ;
c2pstr((char *)prompt ) ;
strcpy((char *)path, m_dir ) ;
#endif
#if TARGET_CARBON
c2pstrcpy((StringPtr)path, m_dir ) ;
#else
strcpy((char *)path, m_dir ) ;
c2pstr((char *)path ) ;
#endif
StandardFileReply reply ;
FileFilterYDUPP crossPlatformFileFilterUPP = 0 ;
@ -601,11 +624,18 @@ int wxFileDialog::ShowModal()
}
}
#if TARGET_CARBON
c2pstrcpy((StringPtr)mNavOptions.message, m_message) ;
#else
strcpy((char *)mNavOptions.message, m_message) ;
c2pstr((char *)mNavOptions.message ) ;
#endif
#if TARGET_CARBON
c2pstrcpy((StringPtr)mNavOptions.savedFileName, m_fileName) ;
#else
strcpy((char *)mNavOptions.savedFileName, m_fileName) ;
c2pstr((char *)mNavOptions.savedFileName ) ;
#endif
if ( m_dialogStyle & wxSAVE )
{

View File

@ -18,6 +18,7 @@
#include "wx/font.h"
#include "wx/fontutil.h"
#include "wx/gdicmn.h"
#include "wx/utils.h"
#include "wx/fontutil.h"
@ -94,9 +95,13 @@ void wxFontRefData::MacFindFont()
m_macFontNum = ::GetAppFont() ;
else
{
strcpy(wxBuffer, m_faceName);
C2PStr(wxBuffer);
::GetFNum( (unsigned char*) wxBuffer, &m_macFontNum);
#if TARGET_CARBON
c2pstrcpy( (StringPtr) wxBuffer, m_faceName ) ;
#else
strcpy( (char *) wxBuffer, m_faceName ) ;
c2pstr( (char *) wxBuffer ) ;
#endif
::GetFNum( (StringPtr) wxBuffer, &m_macFontNum);
}
}

View File

@ -102,7 +102,8 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
void wxFontEnumeratorHelper::DoEnumerate()
{
MenuHandle menu ;
Str255 name ;
Str255 p_name ;
char c_name[256] ;
short lines ;
menu = NewMenu( 32000 , "\pFont" ) ;
@ -111,11 +112,16 @@ void wxFontEnumeratorHelper::DoEnumerate()
for ( int i = 1 ; i < lines+1 ; i ++ )
{
GetMenuItemText( menu , i , name ) ;
p2cstr( name ) ;
/*
if ( m_fixedOnly )
GetMenuItemText( menu , i , p_name ) ;
#if TARGET_CARBON
p2cstrcpy( c_name, p_name ) ;
#else
p2cstr( p_name ) ;
strcpy( c_name, (char *)p_name ) ;
#endif
/*
if ( m_fixedOnly )
{
// check that it's a fixed pitch font (there is *no* error here, the
// flag name is misleading!)
@ -136,7 +142,7 @@ void wxFontEnumeratorHelper::DoEnumerate()
}
*/
m_fontEnum->OnFacename( name ) ;
m_fontEnum->OnFacename( c_name ) ;
}
DisposeMenu( menu ) ;
}

View File

@ -14,7 +14,7 @@
#endif
#include "wx/frame.h"
#include "wx/mac/statusbr.h"
#include "wx/statusbr.h"
#include "wx/toolbar.h"
#include "wx/menuitem.h"
#include "wx/menu.h"

View File

@ -19,6 +19,27 @@
#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__)
#define OTUNIXERRORS 1
#ifdef __UNIX__
#include <CarbonCore/CarbonCore.h>
#include <OT/OpenTransport.h>
#include <OT/OpenTransportProviders.h>
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#else
#include <OpenTransport.h>
#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#endif
#if TARGET_CARBON
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif
#include <assert.h>
#include <errno.h>
#include <string.h>
@ -27,13 +48,6 @@
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
#define OTUNIXERRORS 1
#include <OpenTransport.h>
#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#if TARGET_CARBON
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif
#include <utime.h>
/*
@ -68,7 +82,9 @@ void wxCYield() ;
#define qDebug2 1
extern pascal void OTDebugStr(const char* str);
#endif
#include <OTDebug.h>
#ifndef __UNIX__
#include <OTDebug.h>
#endif
InetSvcRef gInetSvcRef = 0 ;
@ -353,7 +369,6 @@ GSocketError GSocket_SetPeer(GSocket *socket, GAddress *address)
GAddress *GSocket_GetLocal(GSocket *socket)
{
GAddress *address = NULL ;
InetAddress addr;
GSocketError err;
InetAddress loc ;
@ -1590,4 +1605,13 @@ void _GSocket_Internal_Proc(unsigned long e , void* d )
}
/* Hack added for Mac OS X */
GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf)
{
}
GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path)
{
}
#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */

View File

@ -102,8 +102,13 @@ bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
Str255 theName ;
short theId ;
OSType theType ;
strcpy( (char*) theName , name ) ;
c2pstr( (char*) theName ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) theName , name ) ;
#else
strcpy( (char *) theName , name ) ;
c2pstr( (char *) theName ) ;
#endif
Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
if ( resHandle != 0L )
@ -125,4 +130,4 @@ bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
}
}
return FALSE ;
}
}

View File

@ -29,17 +29,24 @@ wxImageList::~wxImageList()
// TODO: destroy image list handle, if any
}
// Attributes
////////////////////////////////////////////////////////////////////////////
// Returns the number of images in the image list.
int wxImageList::GetImageCount() const
{
// TODO
return 0;
// TODO
return 0;
}
#if 0
bool wxImageList::GetSize(int index, int &width, int &hieght) const
{
// TODO
return false;
}
#endif
// Operations
////////////////////////////////////////////////////////////////////////////

View File

@ -13,13 +13,18 @@
#pragma implementation "listbox.h"
#endif
#include "wx/app.h"
#include "wx/listbox.h"
#include "wx/settings.h"
#include "wx/dynarray.h"
#include "wx/log.h"
#include "wx/utils.h"
#include "extldef.h"
#ifdef __UNIX__
#include "ldef/extldef.h"
#else
#include "extldef.h"
#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
@ -246,13 +251,23 @@ int wxListBox::FindString(const wxString& st) const
{
wxString search = s.Left( s.Length() - 1 ) ;
int len = search.Length() ;
Str255 s1 , s2 ;
strcpy( (char*) s2 , search.c_str() ) ;
c2pstr( (char*) s2 ) ;
Str255 s1 , s2 ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) s2 , search.c_str() ) ;
#else
strcpy( (char *) s2 , search.c_str() ) ;
c2pstr( (char *) s2 ) ;
#endif
for ( int i = 0 ; i < m_noItems ; ++ i )
{
strcpy( (char*) s1 , m_stringArray[i].Left( len ).c_str() ) ;
c2pstr( (char*) s1 ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) s1 , m_stringArray[i].Left( len ).c_str() ) ;
#else
strcpy( (char *) s1 , m_stringArray[i].Left( len ).c_str() ) ;
c2pstr( (char *) s1 ) ;
#endif
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
@ -270,12 +285,22 @@ int wxListBox::FindString(const wxString& st) const
else
{
Str255 s1 , s2 ;
strcpy( (char*) s2 , s.c_str() ) ;
c2pstr( (char*) s2 ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) s2 , s.c_str() ) ;
#else
strcpy( (char *) s2 , s.c_str() ) ;
c2pstr( (char *) s2 ) ;
#endif
for ( int i = 0 ; i < m_noItems ; ++ i )
{
strcpy( (char*) s1 , m_stringArray[i].c_str() ) ;
c2pstr( (char*) s1 ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) s1 , m_stringArray[i].c_str() ) ;
#else
strcpy( (char *) s1 , m_stringArray[i].c_str() ) ;
c2pstr( (char *) s1 ) ;
#endif
if ( EqualString( s1 , s2 , false , false ) )
return i ;
}
@ -480,7 +505,6 @@ void wxListBox::MacDelete( int N )
{
ListHandle list ;
long result ;
Cell cell = { 0 , 0 } ;
UMAGetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag , sizeof( ListHandle ) , (char*) &list , &result ) ;
LDelRow( 1 , N , list ) ;
}

View File

@ -7,6 +7,7 @@
* -------------------------------------------------------------------------
*/
#include "wx/wx.h"
#include "wx/mac/macnotfy.h"
const short kMaxEvents = 1000 ;

View File

@ -22,8 +22,10 @@
#pragma implementation "menuitem.h"
#endif
#include "wx/app.h"
#include "wx/menu.h"
#include "wx/menuitem.h"
#include "wx/window.h"
#include "wx/log.h"
#include "wx/utils.h"
@ -362,7 +364,7 @@ wxWindow *wxMenu::GetWindow() const
if ( m_invokingWindow != NULL )
return m_invokingWindow;
else if ( m_menuBar != NULL)
return m_menuBar->GetFrame();
return (wxWindow *) m_menuBar->GetFrame();
return NULL;
}
@ -460,6 +462,7 @@ bool wxMenu::MacMenuSelect( wxEvtHandler* handler, long when , int macMenuId, in
return true ;
}
}
#ifndef __WXMAC_X__
else if ( macMenuId == kHMHelpMenuID )
{
int menuItem = formerHelpMenuItems ;
@ -508,6 +511,7 @@ bool wxMenu::MacMenuSelect( wxEvtHandler* handler, long when , int macMenuId, in
}
}
}
#endif // __WXMAC_X__
for (pos = 0, node = GetMenuItems().First(); node; node = node->Next(), pos++)
{
@ -902,8 +906,11 @@ void wxMenuBar::MacMenuSelect(wxEvtHandler* handler, long when , int macMenuId,
{
for (int i = 0; i < m_menus.GetCount() ; i++)
{
if ( m_menus[i]->MacGetMenuId() == macMenuId ||
if ( m_menus[i]->MacGetMenuId() == macMenuId
#ifndef __WXMAC_X__
||
( macMenuId == kHMHelpMenuID && ( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName ) )
#endif
)
{
if ( m_menus[i]->MacMenuSelect( handler , when , macMenuId , macMenuItemNum ) )

View File

@ -13,6 +13,7 @@
// headers & declarations
// ============================================================================
#include "wx/app.h"
#include "wx/menu.h"
#include "wx/menuitem.h"

View File

@ -13,6 +13,7 @@
#pragma implementation "msgdlg.h"
#endif
#include "wx/app.h"
#include "wx/msgdlg.h"
#include "wx/mac/uma.h"
@ -71,21 +72,36 @@ int wxMessageDialog::ShowModal()
short result ;
Str255 pascalTitle ;
Str255 pascalText ;
char cText[256] ;
if (wxApp::s_macDefaultEncodingIsPC)
{
strcpy( (char*) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
strcpy( (char*) pascalText , wxMacMakeMacStringFromPC( m_message) ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
#else
strcpy( (char *) pascalTitle , wxMacMakeMacStringFromPC( m_caption ) ) ;
c2pstr( (char *) pascalTitle ) ;
#endif
strcpy(cText , wxMacMakeMacStringFromPC( m_message) ) ;
}
else
{
strcpy( (char*) pascalTitle , m_caption ) ;
strcpy( (char*) pascalText , m_message ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) pascalTitle , m_caption ) ;
#else
strcpy( (char *) pascalTitle , m_caption ) ;
c2pstr( (char *) pascalTitle ) ;
#endif
strcpy( cText , m_message ) ;
}
c2pstr( (char*) pascalTitle ) ;
wxMacConvertNewlines( (char*)pascalText ,(char*) pascalText) ;
c2pstr( (char*) pascalText ) ;
wxMacConvertNewlines( cText , cText ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) pascalText , cText ) ;
#else
strcpy( (char *) pascalText , cText ) ;
c2pstr( (char *) pascalText ) ;
#endif
wxASSERT_MSG( ( m_dialogStyle & 0x3F ) != wxYES , "this style is not supported on mac" ) ;

View File

@ -260,8 +260,12 @@ bool wxNotebook::InsertPage(int nPage,
tie.version = 0 ;
tie.iconSuiteID = 0 ;
strcpy( (char*) tie.name , strText ) ;
c2pstr( (char*) tie.name ) ;
#if TARGET_CARBON
c2pstrcpy( (StringPtr) tie.name , strText ) ;
#else
strcpy( (char *) tie.name , strText ) ;
c2pstr( (char *) tie.name ) ;
#endif
SetControlData( m_macControl, nPage + 1, kControlTabInfoTag , sizeof( ControlTabInfoRec) , (char*) &tie ) ;
SetControlData( m_macControl, m_nSelection + 1, kControlTabEnabledFlagTag, sizeof( Boolean ), (Ptr)&enabled );

View File

@ -41,6 +41,9 @@ const short kwxMacTabBottomMargin = 16 ;
// event table
// ----------------------------------------------------------------------------
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
@ -254,8 +257,7 @@ bool wxNotebook::InsertPage(int nPage,
tie.version = 0 ;
tie.iconSuiteID = 0 ;
strcpy( (char*) tie.name , strText ) ;
c2pstr( (char*) tie.name ) ;
c2pstrcpy( (StringPtr) tie.name , strText ) ;
SetControlData( m_macControl, nPage + 1, kControlTabInfoTag , sizeof( ControlTabInfoRec) , (char*) &tie ) ;
SetControlData( m_macControl, m_nSelection + 1, kControlTabEnabledFlagTag, sizeof( Boolean ), (Ptr)&enabled );

View File

@ -31,11 +31,14 @@
# include <fstream>
#endif
#include <windows.h>
#include <wx/palette.h>
#include <wx/bitmap.h>
#include <wx/mac/pnghand.h>
#include <wx/mac/pngread.h>
#ifndef __WXMAC_X__
# include <windows.h>
#endif
#include "wx/msgdlg.h"
#include "wx/palette.h"
#include "wx/bitmap.h"
#include "wx/mac/pnghand.h"
#include "wx/mac/pngread.h"
extern "C" {
#include "png.h"
@ -47,7 +50,7 @@ extern "C" void png_write_init PNGARG((png_structp png_ptr));
extern CTabHandle wxMacCreateColorTable( int numColors ) ;
extern void wxMacDestroyColorTable( CTabHandle colors ) ;
extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
extern GWorldPtr wxMacCreateGWorld( int height , int width , int depth ) ;
extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
void
@ -115,7 +118,8 @@ wxPNGReader::Create(int width, int height, int depth, int colortype)
{
wxMacDestroyGWorld( lpbi ) ;
}
if (lpbi = wxMacCreateGWorld( Width , Height , Depth) )
lpbi = wxMacCreateGWorld( Width , Height , Depth);
if (lpbi)
{
EfeWidth = (long)(((long)Width*Depth + 31) / 32) * 4;
int bitwidth = width ;

View File

@ -67,7 +67,7 @@ wxPrintDialog::~wxPrintDialog()
int wxPrintDialog::ShowModal()
{
int result = wxID_CANCEL ;
#if !TARGET_CARBON
#if !TARGET_CARBON
OSErr err ;
wxString message ;
@ -90,9 +90,13 @@ int wxPrintDialog::ShowModal()
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
}
::UMAPrClose() ;
#else
#pragma warning "TODO:Printing for carbon"
#endif
#else
#if __UNIX__
#warning "TODO:Printing for carbon"
#else
#pragma warning "TODO:Printing for carbon"
#endif
#endif
return result ;
}
@ -158,7 +162,11 @@ int wxPageSetupDialog::ShowModal()
}
::UMAPrClose() ;
#else
#pragma warning "TODO:printing for carbon"
#if __UNIX__
#warning "TODO:Printing for carbon"
#else
#pragma warning "TODO:Printing for carbon"
#endif
#endif
return result ;
}

View File

@ -18,7 +18,8 @@
#endif
#include "wx/radiobox.h"
#include <wx/mac/uma.h>
#include "wx/radiobut.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)

View File

@ -14,6 +14,7 @@
#endif
#include "wx/settings.h"
#include "wx/gdicmn.h"
wxColour wxSystemSettings::GetSystemColour(int index)
{

View File

@ -44,13 +44,70 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator,
const wxString& name)
{
Rect bounds ;
Str255 title ;
MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ;
m_macMinimumStatic = NULL ;
Rect bounds ;
Str255 title ;
wxSize slsize;
int maxtextwidth, textheight;
// Is control horizontal or vertical (Can be ambigous if user selects
// another style without also specifying horz or vert
if (!(style & wxSL_HORIZONTAL) && !(style & wxSL_VERTICAL)) {
// Default is horizontal so make it so
style |= wxSL_HORIZONTAL;
}
slsize = size;
// Check that size corresponds with users selection of vertical or
// horizontal slider and insert suitable default values
if (style & wxSL_HORIZONTAL)
{
slsize.y = 15; // Slider width
if (slsize.x == -1) {
slsize.x = 150; // Slider default length
}
}
else
{
slsize.x = 15; // Slider width
if (slsize.y == -1) {
slsize.y = 150; // Slider default length
}
}
/* Set the height and width for the slider control region. The actual
* slider is set at 10 pixels across. If the slider has labels then the
* control region must be large enough to contain these labels
*/
if (style & wxSL_LABELS)
{
wxString text;
int ht, wd;
// Get maximum text label width and height
text.Printf("%d", minValue);
parent->GetTextExtent(text, &maxtextwidth, &textheight);
text.Printf("%d", maxValue);
parent->GetTextExtent(text, &wd, &ht);
if(ht > textheight) {
textheight = ht;
}
if (wd > maxtextwidth) {
maxtextwidth = wd;
}
if (style & wxSL_VERTICAL) {
slsize.x = (15 + maxtextwidth + 2); // Slider wd plus mac text width
}
if (style & wxSL_HORIZONTAL) {
slsize.y = (15 + textheight); // Slider ht plus text ht.
}
}
MacPreControlCreate( parent , id , "" , pos , slsize , style,
validator , name , &bounds , title ) ;
m_macMinimumStatic = NULL ;
m_macMaximumStatic = NULL ;
m_macValueStatic = NULL ;
m_lineSize = 1;
m_tickFreq = 0;
@ -58,78 +115,70 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
m_rangeMin = minValue;
m_pageSize = (int)((maxValue-minValue)/10);
if ( m_width == -1 )
// Must modify bounds to that of the slider dimensions from slider
// dimensions plus text labels.
if (style & wxSL_LABELS)
{
if ( style & wxSL_HORIZONTAL )
{
m_width = 20 ;
if ( style & wxSL_LABELS && style & wxSL_VERTICAL )
m_width += 24 ;
bounds.right = bounds.left + m_width ;
bounds.bottom = bounds.top + 15;
bounds.right -= (5 + maxtextwidth);
}
if ( m_height == -1 )
else // Vertical slider
{
m_height = 20 ;
if ( style & wxSL_LABELS && style & wxSL_HORIZONTAL )
m_height += 24 ;
bounds.bottom = bounds.top + m_height ;
bounds.right = bounds.left + 15;
bounds.bottom -= (5 + textheight);
}
if ( style & wxSL_LABELS && style & wxSL_HORIZONTAL )
}
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds ,
title , true , value , minValue , maxValue,
kControlSliderProc + kControlSliderLiveFeedback + ( ( style & wxSL_AUTOTICKS ) ? kControlSliderHasTickMarks : 0 ) , (long) this ) ;
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
::SetControlAction( m_macControl , wxMacLiveScrollbarActionUPP ) ;
MacPostControlCreate() ;
if ( style & wxSL_LABELS )
{
if ( style & wxSL_HORIZONTAL )
{
bounds.top += 12 ;
bounds.right -= 24 ;
wxPoint leftpos( 0 , 15 ) ;
wxPoint rightpos( m_width - (maxtextwidth + 20) , 15 ) ;
wxPoint valuepos( m_width - maxtextwidth , 0 ) ;
wxString valuestring ;
valuestring.Printf( "%d" , minValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , leftpos ) ;
valuestring.Printf( "%d" , maxValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , rightpos ) ;
valuestring.Printf( "%d" , value ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos ) ;
}
if ( style & wxSL_LABELS && style & wxSL_VERTICAL )
else // Vertical slider
{
bounds.left += 24 ;
bounds.top += 12 ;
wxPoint toppos( 17 , 0 ) ;
wxPoint bottompos( 17 , m_height - (textheight + 15) ) ;
wxPoint valuepos( 0 , m_height - textheight ) ;
wxString valuestring ;
valuestring.Printf( "%d" , minValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , bottompos ) ;
valuestring.Printf( "%d" , maxValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , toppos ) ;
valuestring.Printf( "%d" , value ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos ) ;
}
m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , value , minValue , maxValue,
kControlSliderProc + kControlSliderLiveFeedback + ( ( style & wxSL_AUTOTICKS ) ? kControlSliderHasTickMarks : 0 ) , (long) this ) ;
wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
::SetControlAction( m_macControl , wxMacLiveScrollbarActionUPP ) ;
MacPostControlCreate() ;
if ( style & wxSL_LABELS )
{
if ( style & wxSL_HORIZONTAL )
{
wxSize size( 24 , 12 ) ;
wxPoint leftpos( 0 , 0 ) ;
wxPoint rightpos( m_width - 2 * 12 , 0 ) ;
wxPoint valuepos( m_width - 12 , 20 ) ;
wxString valuestring ;
valuestring.Printf( "%d" , minValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , leftpos , size ) ;
valuestring.Printf( "%d" , maxValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , rightpos , size ) ;
valuestring.Printf( "%d" , value ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos , size ) ;
}
else
{
wxSize size( 24 , 12 ) ;
wxPoint toppos( 0 , 12 ) ;
wxPoint bottompos( 0 , m_height - 12 ) ;
wxPoint valuepos( 20 , 0 ) ;
wxString valuestring ;
valuestring.Printf( "%d" , minValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , bottompos , size ) ;
valuestring.Printf( "%d" , maxValue ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , toppos , size ) ;
valuestring.Printf( "%d" , value ) ;
m_macMinimumStatic = new wxStaticText( this , -1 , valuestring , valuepos , size ) ;
}
}
return TRUE;
}
return true;
}
wxSlider::~wxSlider()
@ -145,17 +194,31 @@ void wxSlider::SetValue(int value)
{
wxString valuestring ;
valuestring.Printf( "%d" , value ) ;
if ( m_macMinimumStatic )
if ( m_macMinimumStatic )
m_macMinimumStatic->SetLabel( valuestring ) ;
SetControlValue( m_macControl , value ) ;
}
void wxSlider::SetRange(int minValue, int maxValue)
{
m_rangeMin = minValue;
m_rangeMax = maxValue;
wxString value;
// TODO
m_rangeMin = minValue;
m_rangeMax = maxValue;
// TODO
SetControlMinimum(m_macControl, m_rangeMin);
SetControlMaximum(m_macControl, m_rangeMax);
if(m_macMinimumStatic) {
value.Printf("%d", m_rangeMin);
m_macMinimumStatic->SetLabel(value);
}
if(m_macMaximumStatic) {
value.Printf("%d", m_rangeMax);
m_macMaximumStatic->SetLabel(value);
}
SetValue(m_rangeMin);
}
// For trackbars only

View File

@ -11,6 +11,7 @@
#ifdef __GNUG__
#pragma implementation "spinbutt.h"
#pragma implementation "spinbuttbase.h"
#endif
#include "wx/spinbutt.h"
@ -29,6 +30,11 @@
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent);
#endif
wxSpinButton::wxSpinButton()
: wxSpinButtonBase()
{
}
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name)
{
@ -60,6 +66,16 @@ wxSpinButton::~wxSpinButton()
// Attributes
////////////////////////////////////////////////////////////////////////////
int wxSpinButton::GetMin() const
{
return m_min;
}
int wxSpinButton::GetMax() const
{
return m_max;
}
int wxSpinButton::GetValue() const
{
return m_value;
@ -87,7 +103,7 @@ void wxSpinButton::MacHandleControlClick( ControlHandle control , SInt16 control
return ;
wxEventType scrollEvent = wxEVT_NULL;
int nScrollInc;
int nScrollInc = 0;
switch( controlpart )
{

View File

@ -14,6 +14,7 @@
#endif
#include "wx/statbmp.h"
#include "wx/dcclient.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)

View File

@ -17,7 +17,9 @@
// headers
// ----------------------------------------------------------------------------
#include "wx/mac/statusbr.h"
#include "wx/statusbr.h"
#include "wx/dc.h"
#include "wx/dcclient.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStatusBarMac, wxStatusBarGeneric);
@ -33,7 +35,7 @@ END_EVENT_TABLE()
// ============================================================================
// ----------------------------------------------------------------------------
// wxStatusBarXX class
// wxStatusBarMac class
// ----------------------------------------------------------------------------
wxStatusBarMac::wxStatusBarMac()
@ -105,4 +107,4 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
# ifdef __WXMSW__
dc.SetFont(wxNullFont);
# endif // MSW
}
}

View File

@ -15,6 +15,8 @@
#include "wx/app.h"
#include "wx/stattext.h"
#include "wx/dc.h"
#include "wx/dcclient.h"
#include <stdio.h>

View File

@ -13,27 +13,26 @@
#pragma implementation "textctrl.h"
#endif
#ifndef __WXMAC__
#include <sys/types.h>
#include <sys/stat.h>
#ifdef __UNIX__
#include <sys/types.h>
#include <sys/stat.h>
#else
#include <stat.h>
#include <stat.h>
#endif
#include <fstream.h>
#include "wx/app.h"
#include "wx/button.h"
#include "wx/panel.h"
#include "wx/textctrl.h"
#include "wx/settings.h"
#include "wx/filefn.h"
#include "wx/utils.h"
#if defined(__BORLANDC__) && !defined(__WIN32__)
#include <alloc.h>
#else
#ifndef __MWERKS__
#ifndef __GNUWIN32__
#include <malloc.h>
#endif
#endif
#include <alloc.h>
#elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__WXMAC_X__)
#include <malloc.h>
#endif
#include "wx/mac/uma.h"

View File

@ -72,9 +72,13 @@ bool wxTimer::Start(int milliseconds,bool mode)
wxCHECK_MSG( m_info.m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") );
m_milli = milliseconds;
m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ;
m_info.m_task.tmWakeUp = 0 ;
m_info.m_task.tmReserved = 0 ;
#ifdef __UNIX__
m_info.m_task.tmAddr = NewTimerUPP( MacTimerProc ) ;
#else
m_info.m_task.tmAddr = NewTimerProc( MacTimerProc ) ;
#endif
m_info.m_task.tmWakeUp = 0 ;
m_info.m_task.tmReserved = 0 ;
InsXTime((QElemPtr) &m_info.m_task ) ;
PrimeTime( (QElemPtr) &m_info.m_task , m_milli ) ;
return FALSE;

View File

@ -15,8 +15,10 @@
#if wxUSE_TOOLTIPS
#include "wx/app.h"
#include "wx/window.h"
#include "wx/tooltip.h"
#include "wx/timer.h"
#include "wx/geometry.h"
#include "wx/mac/aga.h"
#include "wx/mac/uma.h"

View File

@ -14,6 +14,7 @@
#endif
#include "wx/stubs/textctrl.h"
#include "wx/treebase.h"
#include "wx/stubs/treectrl.h"
#if !USE_SHARED_LIBRARY

View File

@ -1,8 +1,12 @@
#include <wx/mac/uma.h>
#include <wx/mac/aga.h>
#include "wx/defs.h"
#include "wx/mac/uma.h"
#include "wx/mac/aga.h"
#include "Navigation.h"
#ifdef __UNIX__
#include <NavigationServices/Navigation.h>
#else
#include <Navigation.h>
#endif
// init
@ -75,10 +79,12 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls )
#endif // UMA_USE_WINDOWMGR
#endif
#ifndef __UNIX__
if ( sUMAHasWindowManager )
InitFloatingWindows() ;
else
InitWindows();
#endif
if ( NavServicesAvailable() )
{
@ -387,13 +393,22 @@ void UMASetWTitleC( WindowRef inWindowRef , const char *title )
Str255 ptitle ;
strncpy( (char*)ptitle , title , 96 ) ;
ptitle[96] = 0 ;
#if TARGET_CARBON
c2pstrcpy( ptitle, (char *)ptitle ) ;
#else
c2pstr( (char*)ptitle ) ;
#endif
SetWTitle( inWindowRef , ptitle ) ;
}
void UMAGetWTitleC( WindowRef inWindowRef , char *title )
{
GetWTitle( inWindowRef , (unsigned char*)title ) ;
#if TARGET_CARBON
p2cstrcpy( title, (unsigned char *)title ) ;
#else
p2cstr( (unsigned char*)title ) ;
#endif
}
void UMAShowWindow( WindowRef inWindowRef )
@ -1354,18 +1369,18 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
{
#if UMA_USE_APPEARANCE
if ( UMAHasAppearance() )
{
::DrawThemePlacard( inRect , inState ) ;
}
else
if ( UMAHasAppearance() )
{
::DrawThemePlacard( inRect , inState ) ;
}
else
#endif
#if !TARGET_CARBON
{
}
{
}
#else
{
}
{
}
#endif
}

View File

@ -27,6 +27,9 @@
#include <string.h>
#include <stdarg.h>
#ifndef __UNIX__
// defined in unix/utilsunx.cpp for Mac OS X
// get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
@ -123,6 +126,7 @@ void wxFatalError(const wxString& msg, const wxString& title)
{
// TODO
}
#endif // !__UNIX__
// Emit a beeeeeep
void wxBell()
@ -275,11 +279,13 @@ wxString wxMacFindFolder( short vol,
return strDir ;
}
#ifndef __UNIX__
char *wxGetUserHome (const wxString& user)
{
// TODO
return NULL;
}
#endif
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.
@ -328,13 +334,13 @@ void wxDisplaySize(int *width, int *height)
*width = screenBits.bounds.right - screenBits.bounds.left ;
*height = screenBits.bounds.bottom - screenBits.bounds.top ;
#if TARGET_CARBON
#if TARGET_CARBON
SInt16 mheight ;
GetThemeMenuBarHeight( &mheight ) ;
*height -= mheight ;
#else
*height -= LMGetMBarHeight() ;
#endif
#endif
}
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)

Some files were not shown because too many files have changed in this diff Show More