removing dependancy on mac headers from public wx headers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2002-01-04 17:13:39 +00:00
parent fd1bc7fcb3
commit 5273bf2fd3
35 changed files with 244 additions and 236 deletions

View File

@ -195,10 +195,10 @@ public:
void* m_devNames;
#elif defined( __WXMAC__ )
#if TARGET_CARBON
PMPageFormat m_macPageFormat ;
PMPrintSettings m_macPrintSettings ;
void* m_macPageFormat ;
void* m_macPrintSettings ;
#else
THPrint m_macPrintInfo ;
void* m_macPrintInfo ;
#endif
#endif

View File

@ -12,6 +12,7 @@
#ifndef _UMA_AGA_H
#define _UMA_AGA_H
/*
ControlHandle AGANewControl(WindowPtr owningWindow,
const Rect * boundsRect,
ConstStr255Param controlTitle,
@ -85,28 +86,8 @@ void AGAApplyThemeBackground (ThemeBackgroundKind inKind,
void AGAMoveControl( ControlHandle inControl , short x , short y ) ;
void AGASizeControl( ControlHandle inControl , short x , short y ) ;
class AGAPortHelper
{
public :
AGAPortHelper( GrafPtr newport) ;
AGAPortHelper() ;
~AGAPortHelper() ;
*/
void Setup( GrafPtr newport ) ;
void Clear() ;
bool IsCleared() { return m_clip == NULL ; }
GrafPtr GetCurrentPort() { return m_currentPort ; }
private :
GrafPtr m_currentPort ;
GrafPtr m_oldPort ;
RgnHandle m_clip ;
ThemeDrawingState m_drawingState ;
short m_textFont ;
short m_textSize ;
short m_textStyle ;
short m_textMode ;
} ;
#endif

View File

@ -93,8 +93,8 @@ public:
static long sm_lastMessageTime;
static wxWindow* s_captureWindow ;
static int s_lastMouseDown ; // 0 = none , 1 = left , 2 = right
static RgnHandle s_macCursorRgn ;
EventRecord* m_macCurrentEvent ;
static WXHRGN s_macCursorRgn ;
WXEVENTREF m_macCurrentEvent ;
int m_nCmdShow;
@ -120,9 +120,9 @@ public :
static bool s_macHasDialogManager ;
static long s_macDialogManagerVersion ;
RgnHandle m_macCursorRgn ;
RgnHandle m_macSleepRgn ;
RgnHandle m_macHelpRgn ;
WXHRGN m_macCursorRgn ;
WXHRGN m_macSleepRgn ;
WXHRGN m_macHelpRgn ;
virtual void MacSuspend( bool convertClipboard ) ;
virtual void MacResume( bool convertClipboard ) ;
@ -133,25 +133,25 @@ public :
// event main methods
void MacDoOneEvent() ;
void MacHandleOneEvent( EventRecord *ev ) ;
EventRecord* MacGetCurrentEvent() { return m_macCurrentEvent ; }
void MacHandleOneEvent( WXEVENTREF ev ) ;
WXEVENTREF MacGetCurrentEvent() { return m_macCurrentEvent ; }
// primary events
virtual void MacHandleMouseDownEvent( EventRecord *ev ) ;
virtual void MacHandleMouseUpEvent( EventRecord *ev ) ;
virtual void MacHandleActivateEvent( EventRecord *ev ) ;
virtual void MacHandleUpdateEvent( EventRecord *ev ) ;
virtual void MacHandleKeyDownEvent( EventRecord *ev ) ;
virtual void MacHandleKeyUpEvent( EventRecord *ev ) ;
virtual void MacHandleDiskEvent( EventRecord *ev ) ;
virtual void MacHandleOSEvent( EventRecord *ev ) ;
virtual void MacHandleHighLevelEvent( EventRecord *ev ) ;
virtual void MacHandleMouseDownEvent( WXEVENTREF ev ) ;
virtual void MacHandleMouseUpEvent( WXEVENTREF ev ) ;
virtual void MacHandleActivateEvent( WXEVENTREF ev ) ;
virtual void MacHandleUpdateEvent( WXEVENTREF ev ) ;
virtual void MacHandleKeyDownEvent( WXEVENTREF ev ) ;
virtual void MacHandleKeyUpEvent( WXEVENTREF ev ) ;
virtual void MacHandleDiskEvent( WXEVENTREF ev ) ;
virtual void MacHandleOSEvent( WXEVENTREF ev ) ;
virtual void MacHandleHighLevelEvent( WXEVENTREF ev ) ;
virtual void MacHandleMenuSelect( int menuid , int menuitem ) ;
virtual OSErr MacHandleAEODoc(const AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEPDoc(const AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEOApp(const AppleEvent *event , AppleEvent *reply) ;
virtual OSErr MacHandleAEQuit(const AppleEvent *event , AppleEvent *reply) ;
virtual short MacHandleAEODoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEPDoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEOApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEQuit(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
DECLARE_EVENT_TABLE()
};
@ -172,17 +172,17 @@ void wxMacConvertToPC( unsigned char *p ) ;
wxString wxMacMakePCStringFromMac( const char * p ) ;
// converts this string into a pascal with optional pc 2 mac encoding
void wxMacStringToPascal( const char * from , StringPtr to , bool pc2macEncoding ) ;
void wxMacStringToPascal( const char * from , unsigned char* to , bool pc2macEncoding ) ;
// converts this string into a pascal with pc 2 mac encoding if s_macDefaultEncodingIsPC
inline void wxMacStringToPascal( const char * from , StringPtr to )
inline void wxMacStringToPascal( const char * from , unsigned char* to )
{ wxMacStringToPascal( from , to , wxApp::s_macDefaultEncodingIsPC ) ; }
// converts this string into a pascal with optional mac 2 pc encoding
wxString wxMacMakeStringFromPascal( StringPtr from , bool mac2pcEncoding ) ;
wxString wxMacMakeStringFromPascal( unsigned char* from , bool mac2pcEncoding ) ;
// converts this pascal string into a wxString with pc 2 mac encoding if s_macDefaultEncodingIsPC
inline wxString wxMacMakeStringFromPascal( StringPtr from )
inline wxString wxMacMakeStringFromPascal( unsigned char* from )
{ return wxMacMakeStringFromPascal( from , wxApp::s_macDefaultEncodingIsPC ) ; }
// converts this c string into a wxString with optional mac 2 pc encoding

View File

@ -27,13 +27,6 @@ class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxImage;
GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
void wxMacDestroyGWorld( GWorldPtr gw ) ;
PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ;
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
// transparently.
class WXDLLEXPORT wxMask: public wxObject
@ -88,10 +81,10 @@ public:
wxPalette m_bitmapPalette;
int m_quality;
int m_bitmapType ;
PicHandle m_hPict ;
WXHBITMAP m_hBitmap;
WXHICON m_hIcon ;
int m_bitmapType ;
WXHMETAFILE m_hPict ;
WXHBITMAP m_hBitmap;
WXHICON m_hIcon ;
wxMask * m_bitmapMask; // Optional mask
};
@ -206,7 +199,7 @@ public:
void SetHICON(WXHICON ico);
inline WXHICON GetHICON() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hIcon : 0); }
PicHandle GetPict() const;
WXHMETAFILE GetPict() const;
bool FreeResource(bool force = FALSE);
};

View File

@ -29,28 +29,6 @@ typedef enum
kwxMacBrushThemeBackground
} wxMacBrushKind ;
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
{
friend class WXDLLEXPORT wxBrush;
public:
wxBrushRefData();
wxBrushRefData(const wxBrushRefData& data);
~wxBrushRefData();
protected:
wxMacBrushKind m_macBrushKind ;
int m_style;
wxBitmap m_stipple ;
wxColour m_colour;
ThemeBrush m_macThemeBrush ;
ThemeBackgroundKind m_macThemeBackground ;
Rect m_macThemeBackgroundExtent ;
};
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
// Brush
class WXDLLEXPORT wxBrush: public wxGDIObject
{
@ -58,7 +36,7 @@ class WXDLLEXPORT wxBrush: public wxGDIObject
public:
wxBrush();
wxBrush(ThemeBrush macThemeBrush ) ;
wxBrush(short macThemeBrush ) ;
wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple);
inline wxBrush(const wxBrush& brush) { Ref(brush); }
@ -68,20 +46,20 @@ public:
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
virtual void SetStyle(int style) ;
virtual void SetStipple(const wxBitmap& stipple) ;
virtual void SetMacTheme(ThemeBrush macThemeBrush) ;
virtual void SetMacThemeBackground(ThemeBackgroundKind macThemeBackground , const Rect &extent) ;
virtual void SetMacTheme(short macThemeBrush) ;
virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
inline wxMacBrushKind MacGetBrushKind() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour); };
wxMacBrushKind MacGetBrushKind() const ;
ThemeBackgroundKind GetMacThemeBackground(Rect *extent) const ;
inline ThemeBrush GetMacTheme() const { return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack); };
inline wxColour& GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
inline int GetStyle() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
unsigned long GetMacThemeBackground(WXRECTPTR extent) const ;
short GetMacTheme() const ;
wxColour& GetColour() const ;
int GetStyle() const ;
wxBitmap *GetStipple() const ;
virtual bool Ok() const { return (m_refData != NULL) ; }

View File

@ -42,7 +42,7 @@ class WXDLLEXPORT wxButton: public wxButtonBase
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , short controlpart ) ;
static wxSize GetDefaultSize();
virtual void SetDefault();

View File

@ -44,7 +44,7 @@ class WXDLLEXPORT wxCheckBox: public wxControl
const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool);
virtual bool GetValue() const ;
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
virtual void Command(wxCommandEvent& event);
};

View File

@ -64,7 +64,7 @@ class WXDLLEXPORT wxChoice: public wxChoiceBase
virtual int FindString(const wxString& s) const;
virtual wxString GetString(int n) const ;
virtual void SetString( int , const wxString& s ) ;
void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
/*
virtual void Append(const wxString& item);
@ -78,7 +78,7 @@ class WXDLLEXPORT wxChoice: public wxChoiceBase
// Mac specific
virtual void Command(wxCommandEvent& event);
void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
virtual inline int GetColumns() const { return 1 ; };
*/
@ -94,7 +94,7 @@ protected:
wxArrayString m_strings;
wxChoiceDataArray m_datas ;
MenuHandle m_macPopUpMenuHandle ;
WXHMENU m_macPopUpMenuHandle ;
};
#endif

View File

@ -86,7 +86,7 @@ private:
public:
WXCOLORREF m_pixel ;
void Set( WXCOLORREF color ) { m_pixel = color ; m_red = m_pixel.red>>8 ;m_blue = m_pixel.blue>>8 ;m_green = m_pixel.green>>8 ;}
void Set( const WXCOLORREF* color ) ;
private:
DECLARE_DYNAMIC_CLASS(wxColour)

View File

@ -78,10 +78,10 @@ class WXDLLEXPORT wxComboBox: public wxChoice
virtual void Remove(long from, long to);
virtual void SetSelection(long from, long to);
virtual void SetEditable(bool editable);
void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
protected:
int m_noStrings;
MenuHandle m_macPopUpMenuHandle ;
WXHMENU m_macPopUpMenuHandle ;
};
#endif

View File

@ -59,17 +59,17 @@ public:
virtual bool Show(bool show = TRUE) ;
virtual void MacRedrawControl () ;
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , short 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 ) ;
WXRECTPTR outBounds ,
unsigned char* maclabel ) ;
virtual void MacPostControlCreate() ;
virtual void MacAdjustControlRect() ;
virtual ControlHandle MacGetContainerForEmbedding() ;
virtual WXWidget MacGetContainerForEmbedding() ;
virtual void MacSuperChangedPosition() ;
virtual void MacSuperEnabled( bool enabled ) ;
virtual void MacSuperShown( bool show ) ;
@ -80,7 +80,7 @@ public:
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 ;}
WXWidget GetMacControl() { return m_macControl ;}
#if WXWIN_COMPATIBILITY
virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
@ -102,7 +102,7 @@ protected:
protected:
// For controls like radiobuttons which are really composite
ControlHandle m_macControl ;
WXWidget m_macControl ;
bool m_macControlIsShown ;
wxList m_subControls;
int m_macHorizontalBorder ;
@ -123,8 +123,8 @@ private:
inline void wxControl::SetButtonFont(const wxFont& font) { SetFont(font); }
#endif // WXWIN_COMPATIBILITY
wxControl *wxFindControlFromMacControl(ControlHandle inControl ) ;
void wxAssociateControlWithMacControl(ControlHandle inControl, wxControl *control) ;
wxControl *wxFindControlFromMacControl(WXWidget inControl ) ;
void wxAssociateControlWithMacControl(WXWidget inControl, wxControl *control) ;
void wxRemoveMacControlAssociation(wxControl *control) ;
#endif

View File

@ -15,7 +15,7 @@
class wxDataFormat
{
public:
typedef OSType NativeFormat;
typedef unsigned long NativeFormat;
wxDataFormat();
wxDataFormat(wxDataFormatId vType);

View File

@ -21,7 +21,6 @@
#include "wx/icon.h"
#include "wx/font.h"
#include "wx/gdicmn.h"
#include "wx/mac/aga.h"
//-----------------------------------------------------------------------------
// constants
@ -44,19 +43,11 @@
extern int wxPageNumber;
class wxMacPortStateHelper ;
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMacPortSetter
{
public :
wxMacPortSetter( const wxDC* dc ) ;
~wxMacPortSetter() ;
private :
AGAPortHelper m_ph ;
} ;
class WXDLLEXPORT wxDC: public wxDCBase
{
DECLARE_DYNAMIC_CLASS(wxDC)
@ -180,20 +171,20 @@ class WXDLLEXPORT wxDC: public wxDCBase
{
long new_x = x - m_logicalOriginX;
if (new_x > 0)
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.h ;
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.x ;
else
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.h ;
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX + m_macLocalOrigin.x ;
}
wxCoord YLOG2DEVMAC(wxCoord y) const
{
long new_y = y - m_logicalOriginY ;
if (new_y > 0)
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.v ;
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.y ;
else
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.v ;
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.y ;
}
RgnHandle MacGetCurrentClipRgn() { return m_macCurrentClipRgn ; }
WXHRGN MacGetCurrentClipRgn() { return m_macCurrentClipRgn ; }
static void MacSetupBackgroundForCurrentPort(const wxBrush& background ) ;
//
@ -269,8 +260,8 @@ protected:
// Begin implementation for Mac
public:
GrafPtr m_macPort ;
GWorldPtr m_macMask ;
WXHDC m_macPort ;
WXHBITMAP m_macMask ;
// in order to preserve the const inheritance of the virtual functions, we have to
// use mutable variables starting from CWPro 5
@ -283,10 +274,10 @@ protected:
mutable bool m_macPenInstalled ;
mutable bool m_macBrushInstalled ;
RgnHandle m_macBoundaryClipRgn ;
RgnHandle m_macCurrentClipRgn ;
Point m_macLocalOrigin ;
void MacSetupPort( AGAPortHelper* ph ) const ;
WXHRGN m_macBoundaryClipRgn ;
WXHRGN m_macCurrentClipRgn ;
wxPoint m_macLocalOrigin ;
void MacSetupPort( wxMacPortStateHelper* ph ) const ;
};
#endif

View File

@ -36,14 +36,14 @@ class WXDLLEXPORT wxPrinterDC: public wxDC
protected :
#if TARGET_CARBON
#if PM_USE_SESSION_APIS
PMPrintSession m_macPrintSession;
void* m_macPrintSession;
#else
PMPrintContext m_macPrintPort ;
void* m_macPrintPort ;
#endif
#else
TPPrPort m_macPrintPort ;
void* m_macPrintPort ;
#endif
wxPrintData m_printData ;
wxPrintData m_printData ;
#endif // wxUSE_PRINTING_ARCHITECTURE
};

View File

@ -61,10 +61,10 @@ class WXDLLEXPORT wxDropTarget: public wxDropTargetBase
virtual bool GetData();
bool CurrentDragHasSupportedFormat() ;
void SetCurrentDrag( DragReference drag ) { m_currentDrag = drag ; }
DragReference GetCurrentDrag() { return m_currentDrag ; }
void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; }
void* GetCurrentDrag() { return m_currentDrag ; }
protected :
DragReference m_currentDrag ;
void* m_currentDrag ;
};
//-------------------------------------------------------------------------
@ -94,11 +94,11 @@ public:
virtual wxDragResult DoDragDrop( bool bAllowMove = FALSE );
wxWindow* GetWindow() { return m_window ; }
void SetCurrentDrag( DragReference drag ) { m_currentDrag = drag ; }
DragReference GetCurrentDrag() { return m_currentDrag ; }
void SetCurrentDrag( void* drag ) { m_currentDrag = drag ; }
void* GetCurrentDrag() { return m_currentDrag ; }
protected :
wxWindow *m_window;
DragReference m_currentDrag ;
void* m_currentDrag ;
};
#endif

View File

@ -72,7 +72,7 @@ protected:
public :
short m_macFontNum ;
short m_macFontSize ;
Style m_macFontStyle ;
unsigned char m_macFontStyle ;
public :
void MacFindFont() ;
};

View File

@ -32,13 +32,13 @@ public:
wxIcon(const char **data);
wxIcon(char **data);
wxIcon(const char bits[], int width , int height );
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICON_RESOURCE,
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1);
~wxIcon();
bool LoadFile(const wxString& name, long flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ ,
int desiredWidth /* = -1 */ , int desiredHeight = -1);
bool LoadFile(const wxString& name ,long flags = wxBITMAP_TYPE_ICON_RESOURCE )
bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
{ return LoadFile( name , flags , -1 , -1 ) ; }
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }

View File

@ -109,9 +109,9 @@ public:
// Windows callbacks
virtual void SetupColours();
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
ListHandle m_macList ;
void* m_macList ;
wxArrayString m_stringArray ;
wxListDataArray m_dataArray ;
wxArrayInt m_selectionPreImage ;

View File

@ -72,7 +72,7 @@ public:
// menu handle depending on what we're
int GetRealId() const;
static int MacBuildMenuString(StringPtr outMacItemText, SInt16 *outMacShortcutChar , UInt8 *outMacModifiers , const char *inItemName , bool useShortcuts ) ;
static int MacBuildMenuString(unsigned char* outMacItemText, wxInt16 *outMacShortcutChar , wxUint8 *outMacModifiers , const char *inItemName , bool useShortcuts ) ;
private:
wxBitmap m_bitmap; // Bitmap for menuitem, if any

View File

@ -41,7 +41,7 @@ public:
~wxMetafileRefData(void);
public:
PicHandle m_metafile;
WXHMETAFILE m_metafile;
};
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
@ -65,8 +65,8 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
// Implementation
inline PicHandle GetHMETAFILE(void) { return M_METAFILEDATA->m_metafile; }
void SetHMETAFILE(PicHandle mf) ;
inline WXHMETAFILE GetHMETAFILE(void) { return M_METAFILEDATA->m_metafile; }
void SetHMETAFILE(WXHMETAFILE mf) ;
// Operators
inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; }

View File

@ -132,7 +132,7 @@ public:
virtual void Command(wxCommandEvent& event);
protected:
virtual wxNotebookPage *DoRemovePage(int page) ;
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
// common part of all ctors
void Init();

View File

@ -1,11 +1,13 @@
/////////////////////////////////////////////////////////////////////////////
// Name: private.h
// Purpose: Private declarations
// Author: AUTHOR
// Purpose: Private declarations: as this header is only included by
// wxWindows itself, it may contain identifiers which don't start
// with "wx".
// Author: Stefan Csomor
// Modified by:
// Created: ??/??/98
// RCS-ID: $Id$
// Copyright: (c) AUTHOR
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -14,8 +16,98 @@
#include "wx/defs.h"
/* TODO: put any private declarations here.
*/
#if defined(__POWERPC__) && defined(__DARWIN__)
#include <Carbon/Carbon.h>
#else
#include "MacHeaders.c"
#endif
#if UNIVERSAL_INTERFACES_VERSION < 0x0340
#error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/"
#endif
class wxMacPortStateHelper
{
public :
wxMacPortStateHelper( GrafPtr newport) ;
wxMacPortStateHelper() ;
~wxMacPortStateHelper() ;
void Setup( GrafPtr newport ) ;
void Clear() ;
bool IsCleared() { return m_clip == NULL ; }
GrafPtr GetCurrentPort() { return m_currentPort ; }
private :
GrafPtr m_currentPort ;
GrafPtr m_oldPort ;
RgnHandle m_clip ;
ThemeDrawingState m_drawingState ;
short m_textFont ;
short m_textSize ;
short m_textStyle ;
short m_textMode ;
} ;
class WXDLLEXPORT wxMacPortSetter
{
public :
wxMacPortSetter( const wxDC* dc ) ;
~wxMacPortSetter() ;
private :
wxMacPortStateHelper m_ph ;
} ;
class wxMacDrawingHelper
{
public :
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
~wxMacDrawingHelper() ;
bool Ok() { return m_ok ; }
void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
const Point& GetOrigin() { return m_origin ; }
private :
Point m_origin ;
GrafPtr m_formerPort ;
GrafPtr m_currentPort ;
PenState m_savedPenState ;
bool m_ok ;
} ;
// filefn.h
WXDLLEXPORT wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) ;
WXDLLEXPORT void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) ;
# ifndef __DARWIN__
// Mac file names are POSIX (Unix style) under Darwin, so these are not needed
WXDLLEXPORT wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) ;
WXDLLEXPORT void wxUnixFilename2FSSpec( const char *path , FSSpec *spec ) ;
WXDLLEXPORT wxString wxMac2UnixFilename( const char *s) ;
WXDLLEXPORT wxString wxUnix2MacFilename( const char *s);
# endif
// utils.h
WXDLLEXPORT wxString wxMacFindFolder(short vRefNum,
OSType folderType,
Boolean createFolder);
GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
void wxMacDestroyGWorld( GWorldPtr gw ) ;
PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ;
void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
CTabHandle wxMacCreateColorTable( int numColors ) ;
#define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
#define MAC_WXHBITMAP(a) (GWorldPtr(a))
#define MAC_WXHMETAFILE(a) (PicHandle(a))
#define MAC_WXHICON(a) (CIconHandle(a))
#define MAC_WXHCURSOR(a) (CursHandle(a))
#define MAC_WXHRGN(a) (RgnHandle(a))
#define MAC_WXHWND(a) (WindowPtr(a))
#define MAC_WXRECPTR(a) ((Rect*)a)
#define MAC_WXPOINTPTR(a) ((Point*)a)
#define MAC_WXHMENU(a) ((MenuHandle)a)
#endif
// _WX_PRIVATE_H_

View File

@ -44,7 +44,7 @@ public:
// implementation
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart );
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart );
void Command(wxCommandEvent& event);
wxRadioButton *AddInCycle(wxRadioButton *cycle);
inline wxRadioButton *NextInCycle() {return m_cycle;}

View File

@ -57,7 +57,7 @@ public:
bool refresh = TRUE);
void Command(wxCommandEvent& event);
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
protected:
int m_pageSize;

View File

@ -87,7 +87,7 @@ public:
virtual void DoMoveWindow(int x, int y, int w, int h);
void Command(wxCommandEvent& event);
void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
wxStaticText* m_macMinimumStatic ;
wxStaticText* m_macMaximumStatic ;

View File

@ -64,7 +64,7 @@ public:
// implementation
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
protected:
virtual wxSize DoGetBestSize() const;

View File

@ -21,12 +21,7 @@
class wxTimer ;
typedef struct MacTimerInfo
{
TMTask m_task;
wxMacNotifierTableRef m_table ;
wxTimer* m_timer ;
} ;
struct MacTimerInfo ;
class WXDLLEXPORT wxTimer: public wxTimerBase
{
@ -41,7 +36,7 @@ public:
virtual bool IsRunning() const ;
MacTimerInfo m_info;
MacTimerInfo* m_info;
protected :
void Init();
private:

View File

@ -59,7 +59,7 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
// Add all the buttons
virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
virtual void MacHandleControlClick( WXWidget control , short controlpart ) ;
virtual wxString MacGetToolTipString( wxPoint &where ) ;
void OnPaint(wxPaintEvent& event) ;
void OnMouse(wxMouseEvent& event) ;

View File

@ -31,7 +31,7 @@ public:
static void Enable(bool flag);
// set the delay after which the tooltip appears
static void SetDelay(long milliseconds);
static void NotifyWindowDelete( WindowRef win ) ;
static void NotifyWindowDelete( WXHWND win ) ;
// implementation only from now on
// -------------------------------

View File

@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/mac/toplevel.h
// Purpose: wxTopLevelWindowMac is the MSW implementation of wxTLW
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.09.01
@ -68,24 +68,24 @@ public:
const wxSize& size,
long style,
const wxString& name ) ;
static WindowRef MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ;
static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ;
virtual void Clear() ;
virtual ControlHandle MacGetContainerForEmbedding() ;
WindowRef MacGetWindowRef() { return m_macWindow ; }
virtual void MacActivate( EventRecord *ev , bool inIsActivating ) ;
virtual WXWidget MacGetContainerForEmbedding() ;
WXWindow MacGetWindowRef() { return m_macWindow ; }
virtual void MacActivate( WXEVENTREF ev , bool inIsActivating ) ;
virtual void MacUpdate( long timestamp ) ;
virtual void MacMouseDown( EventRecord *ev , short windowPart ) ;
virtual void MacMouseUp( EventRecord *ev , short windowPart ) ;
virtual void MacMouseMoved( EventRecord *ev , short windowPart ) ;
virtual void MacKeyDown( EventRecord *ev ) ;
virtual void MacFireMouseEvent( EventRecord *ev ) ;
virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ;
virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ;
virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ;
virtual void MacKeyDown( WXEVENTREF ev ) ;
virtual void MacFireMouseEvent( WXEVENTREF ev ) ;
virtual void Raise();
virtual void Lower();
virtual void SetTitle( const wxString& title);
virtual bool Show( bool show = TRUE );
virtual void DoMoveWindow(int x, int y, int width, int height);
void MacInvalidate( const Rect * rect, bool eraseBackground ) ;
void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ;
protected:
// common part of all ctors
void Init();
@ -97,14 +97,14 @@ protected:
// when it is called while the frame is hidden
bool m_maximizeOnShow;
SInt16 m_macWindowBackgroundTheme ;
WindowRef m_macWindow ;
ControlHandle m_macRootControl ;
short m_macWindowBackgroundTheme ;
WXWindow m_macWindow ;
WXWidget m_macRootControl ;
wxWindowMac* m_macFocus ;
RgnHandle m_macNoEraseUpdateRgn ;
WXHRGN m_macNoEraseUpdateRgn ;
bool m_macNeedsErasing ;
static WindowRef s_macWindowInUpdate ;
static WXWindow s_macWindowInUpdate ;
};
// list of all frames and modeless dialogs
@ -112,8 +112,8 @@ extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
// associate mac windows with wx counterparts
wxTopLevelWindowMac* wxFindWinFromMacWindow( WindowRef inWindow ) ;
void wxAssociateWinWithMacWindow(WindowRef inWindow, wxTopLevelWindowMac *win) ;
wxTopLevelWindowMac* wxFindWinFromMacWindow( WXWindow inWindow ) ;
void wxAssociateWinWithMacWindow(WXWindow inWindow, wxTopLevelWindowMac *win) ;
void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ;

View File

@ -12,16 +12,7 @@
#ifndef H_UMA
#define H_UMA
#if defined(__POWERPC__)
#if defined(__DARWIN__)
#include <Carbon/Carbon.h>
#endif
#endif
#if !TARGET_CARBON
// this is now defined in the latest headers
// typedef short MenuItemIndex ;
#endif
#include "wx/mac/private.h"
void UMAInitToolbox( UInt16 inMoreMastersCalls) ;
void UMACleanupToolbox() ;
@ -222,7 +213,15 @@ OSStatus UMAGetHelpMenu(
MenuRef * outHelpMenu,
MenuItemIndex * outFirstCustomItemIndex); /* can be NULL */
// Appearance Drawing
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
// accessor helpers
#if !TARGET_CARBON
#define ClearCurrentScrap() ZeroScrap() ;
/*
#define GetPortTextFont( p) ((p)->txFont )
#define GetPortTextSize( p) ((p)->txSize )
#define GetPortTextFace( p) ((p)->txFace )
@ -238,10 +237,9 @@ OSStatus UMAGetHelpMenu(
#define GetControlBounds( c , b ) &((*b) = (**c).contrlRect )
#define GetPortBitMapForCopyBits( p ) ((BitMap*) &(((CGrafPtr)p)->portPixMap ))
#define GetControlOwner( control ) ((**control).contrlOwner)
#define InvalWindowRgn( window , rgn ) InvalRgn( rgn )
#define GetPortPenMode( p ) (p->pnMode)
#define SetPortPenMode( p , mode ) (p->pnMode = mode )
#define ClearCurrentScrap() ZeroScrap() ;
// control manager
#define GetControlReference( control ) ((**control).contrlRfCon)
@ -250,13 +248,13 @@ OSStatus UMAGetHelpMenu(
#define SetListSelectionFlags( list , options ) (**list).selFlags = options
#define GetListRefCon( list ) (**list).refCon
*/
#else
// calls not in carbon
#endif
#if TARGET_CARBON
#define GetWindowUpdateRgn( inWindow , updateRgn ) GetWindowRegion( inWindow , kWindowUpdateRgn, updateRgn )
#endif
// Appearance Drawing
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
#endif

View File

@ -35,10 +35,10 @@ protected:
bool Free();
private:
SndChannelPtr m_sndChan;
void* m_sndChan;
wxString m_sndname;
SndListHandle m_hSnd;
void* m_hSnd;
int m_waveLength;
bool m_isResource;
};

View File

@ -215,16 +215,16 @@ public:
public :
static bool MacGetWindowFromPoint( const wxPoint &point , wxWindowMac** outWin ) ;
virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) ;
virtual void MacRedraw( RgnHandle updatergn , long time , bool erase) ;
virtual void MacRedraw( WXHRGN updatergn , long time , bool erase) ;
virtual bool MacCanFocus() const { return true ; }
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
virtual void MacPaintBorders( int left , int top ) ;
WindowRef MacGetRootWindow() const ;
WXWindow MacGetRootWindow() const ;
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
virtual ControlHandle MacGetContainerForEmbedding() ;
virtual WXWidget MacGetContainerForEmbedding() ;
virtual long MacGetLeftBorderSize() const ;
virtual long MacGetRightBorderSize() const ;
@ -308,23 +308,5 @@ private:
DECLARE_EVENT_TABLE()
};
class wxMacDrawingHelper
{
public :
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
~wxMacDrawingHelper() ;
bool Ok() { return m_ok ; }
void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
const Point& GetOrigin() { return m_origin ; }
private :
Point m_origin ;
GrafPtr m_formerPort ;
GrafPtr m_currentPort ;
PenState m_savedPenState ;
bool m_ok ;
} ;
#endif
// _WX_WINDOW_H_

View File

@ -272,12 +272,6 @@ WXDLLEXPORT const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString)
WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString);
#endif
#ifdef __WXMAC__
WXDLLEXPORT wxString wxMacFindFolder(short vRefNum,
OSType folderType,
Boolean createFolder);
#endif
// get number of total/free bytes on the disk where path belongs
WXDLLEXPORT bool wxGetDiskSpace(const wxString& path,
wxLongLong *pTotal = NULL,

View File

@ -1,4 +1,4 @@
#define MSL_USE_PRECOMPILED_HEADERS 1
#define MSL_USE_PRECOMPILED_HEADERS 0
#if !defined( __MWERKS__ )
#error "this file is only for builds with Metrowerks CodeWarrior"
@ -38,11 +38,15 @@
#endif
#elif defined( __WXMAC__)
#define USE_PRECOMPILED_MAC_HEADERS 0 /*Set to 0 if you don't want to use precompiled MacHeaders*/
#include "MacHeaders.c"
#include <ansi_prefix.mac.h>
#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#define OPAQUE_TOOLBOX_STRUCTS 1
#include <ansi_prefix.mac.h>
/*
#include <MacTypes.h>
#if UNIVERSAL_INTERFACES_VERSION < 0x0340
#error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/"
#endif
*/
#endif
#define USE_DEFINE