adding metafile and clipboard support

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2005-02-13 05:59:04 +00:00
parent 79c5fe4be8
commit 71cc158eaa
7 changed files with 193 additions and 75 deletions

View File

@@ -68,18 +68,18 @@ public:
int GetBytesPerRow() const { return m_bytesPerRow ; }
// renders/updates native representation when necessary
void RealizeNative() ;
#if !wxMAC_USE_CORE_GRAPHICS
WXHBITMAP GetHBITMAP() const ;
#endif
private:
wxMemoryBuffer m_memBuf ;
int m_bytesPerRow ;
int m_width ;
int m_height ;
#if !wxMAC_USE_CORE_GRAPHICS
WXHBITMAP m_maskBitmap ;
#endif
};
class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase
@@ -193,10 +193,8 @@ public:
bool HasAlpha() const;
void UseAlpha();
#if !wxMAC_USE_CORE_GRAPHICS
// returns the 'native' implementation, a GWorldPtr for the content and one for the mask
WXHBITMAP GetHBITMAP( WXHBITMAP * mask = NULL ) const;
#endif
#if wxMAC_USE_CORE_GRAPHICS
// returns a CGImageRef which must released after usage with CGImageRelease

View File

@@ -222,7 +222,9 @@ class WXDLLEXPORT wxDC: public wxDCBase
else
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY + m_macLocalOrigin.y ;
}
#if !wxMAC_USE_CORE_GRAPHICS
#if wxMAC_USE_CORE_GRAPHICS
wxGraphicContext* GetGraphicContext() { return m_graphicContext ; }
#else
WXHRGN MacGetCurrentClipRgn() { return m_macCurrentClipRgn ; }
static void MacSetupBackgroundForCurrentPort(const wxBrush& background ) ;
#endif

View File

@@ -32,17 +32,7 @@
#define wxMetaFileDC wxMetafileDC
class WXDLLEXPORT wxMetafile;
class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData
{
friend class WXDLLEXPORT wxMetafile;
public:
wxMetafileRefData(void);
~wxMetafileRefData(void);
public:
WXHMETAFILE m_metafile;
};
class wxMetafileRefData ;
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
@@ -63,14 +53,14 @@ public:
virtual bool SetClipboard(int width = 0, int height = 0);
virtual bool Play(wxDC *dc);
inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
bool Ok() const ;
wxSize GetSize() const;
int GetWidth() const { return GetSize().x; }
int GetHeight() const { return GetSize().y; }
// Implementation
inline WXHMETAFILE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; }
WXHMETAFILE GetHMETAFILE() const ;
void SetHMETAFILE(WXHMETAFILE mf) ;
// Operators

View File

@@ -354,6 +354,7 @@ CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDep
void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
CTabHandle wxMacCreateColorTable( int numColors ) ;
*/
PicHandle wxMacCreatePicHandle( const wxBitmap &bmp ) ;
IconRef wxMacCreateIconRef(const wxBitmap& bmp) ;
void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap , int forceType = 0 ) ;
void wxMacReleaseBitmapButton( ControlButtonContentInfo*info ) ;
@@ -597,6 +598,7 @@ private:
} ;
CGColorSpaceRef wxMacGetGenericRGBColorSpace(void) ;
void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t size) ;
#endif // wxMAC_USE_CORE_GRAPHICS
@@ -638,10 +640,10 @@ public:
wxMask * m_bitmapMask; // Optional mask
#if wxMAC_USE_CORE_GRAPHICS
CGImageRef CGImageCreate() const ;
#else
#endif
GWorldPtr GetHBITMAP(GWorldPtr * mask = NULL ) const ;
void UpdateAlphaMask() const ;
#endif
private :
bool Create(int width , int height , int depth) ;
void Init() ;
@@ -656,12 +658,11 @@ private :
bool m_ok;
#if wxMAC_USE_CORE_GRAPHICS
mutable CGImageRef m_cgImageRef ;
#else
#endif
GWorldPtr m_hBitmap;
GWorldPtr m_hMaskBitmap ;
wxMemoryBuffer m_maskMemBuf ;
int m_maskBytesPerRow ;
#endif
};
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData)