mac cleanup, pure cgcolor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,19 +18,10 @@
|
|||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxBrush;
|
class WXDLLIMPEXP_FWD_CORE wxBrush;
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kwxMacBrushColour ,
|
|
||||||
kwxMacBrushTheme ,
|
|
||||||
kwxMacBrushThemeBackground
|
|
||||||
} wxMacBrushKind ;
|
|
||||||
|
|
||||||
// Brush
|
// Brush
|
||||||
class WXDLLEXPORT wxBrush: public wxBrushBase
|
class WXDLLEXPORT wxBrush: public wxBrushBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
public:
|
||||||
|
|
||||||
public:
|
|
||||||
wxBrush();
|
wxBrush();
|
||||||
wxBrush(short macThemeBrush ) ;
|
wxBrush(short macThemeBrush ) ;
|
||||||
wxBrush(const wxColour& col, int style = wxSOLID);
|
wxBrush(const wxColour& col, int style = wxSOLID);
|
||||||
@@ -41,31 +32,23 @@ public:
|
|||||||
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||||
virtual void SetStyle(int style) ;
|
virtual void SetStyle(int style) ;
|
||||||
virtual void SetStipple(const wxBitmap& stipple) ;
|
virtual void SetStipple(const wxBitmap& stipple) ;
|
||||||
virtual void MacSetTheme(short macThemeBrush) ;
|
|
||||||
// TODO REMOVE virtual void MacSetThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
|
|
||||||
|
|
||||||
bool operator == (const wxBrush& brush) const;
|
bool operator == (const wxBrush& brush) const;
|
||||||
bool operator != (const wxBrush& brush) const
|
bool operator != (const wxBrush& brush) const
|
||||||
{ return !(*this == brush); }
|
{ return !(*this == brush); }
|
||||||
|
|
||||||
wxMacBrushKind MacGetBrushKind() const ;
|
const wxColour& GetColour() const ;
|
||||||
|
|
||||||
// TODO REMOVE unsigned long MacGetThemeBackground(WXRECTPTR extent) const ;
|
|
||||||
short MacGetTheme() const ;
|
|
||||||
wxColour& GetColour() const ;
|
|
||||||
virtual int GetStyle() const ;
|
virtual int GetStyle() const ;
|
||||||
wxBitmap *GetStipple() const ;
|
wxBitmap *GetStipple() const ;
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
virtual bool Ok() const { return IsOk(); }
|
||||||
virtual bool IsOk() const { return (m_refData != NULL) ; }
|
virtual bool IsOk() const { return (m_refData != NULL) ; }
|
||||||
|
|
||||||
// Implementation
|
protected:
|
||||||
|
virtual wxObjectRefData *CreateRefData() const;
|
||||||
// Useful helper: create the brush resource
|
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
||||||
bool RealizeResource();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Unshare();
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -48,6 +48,10 @@ public:
|
|||||||
bool operator != (const wxColour& colour) const { return !(*this == colour); }
|
bool operator != (const wxColour& colour) const { return !(*this == colour); }
|
||||||
|
|
||||||
CGColorRef GetPixel() const { return m_cgColour; };
|
CGColorRef GetPixel() const { return m_cgColour; };
|
||||||
|
|
||||||
|
CGColorRef GetCGColor() const { return m_cgColour; };
|
||||||
|
CGColorRef CreateCGColor() const { return wxCFRetain( (CGColorRef)m_cgColour ); };
|
||||||
|
|
||||||
void GetRGBColor( RGBColor *col ) const;
|
void GetRGBColor( RGBColor *col ) const;
|
||||||
|
|
||||||
// Mac-specific ctor and assignment operator from the native colour
|
// Mac-specific ctor and assignment operator from the native colour
|
||||||
|
@@ -586,7 +586,7 @@ public :
|
|||||||
|
|
||||||
|
|
||||||
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle );
|
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle );
|
||||||
virtual void SetBackground( const wxBrush &brush );
|
virtual void SetBackgroundColour( const wxColour& col );
|
||||||
virtual ControlPartCode HandleKey( SInt16 keyCode, SInt16 charCode, EventModifiers modifiers );
|
virtual ControlPartCode HandleKey( SInt16 keyCode, SInt16 charCode, EventModifiers modifiers );
|
||||||
void SetActionProc( ControlActionUPP actionProc );
|
void SetActionProc( ControlActionUPP actionProc );
|
||||||
void SetViewSize( SInt32 viewSize );
|
void SetViewSize( SInt32 viewSize );
|
||||||
@@ -1079,27 +1079,10 @@ OSStatus WXDLLEXPORT wxMacDrawCGImage(
|
|||||||
const HIRect * inBounds,
|
const HIRect * inBounds,
|
||||||
CGImageRef inImage) ;
|
CGImageRef inImage) ;
|
||||||
|
|
||||||
// make sure we all use one class for all conversions from wx to native colour
|
CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush ) ;
|
||||||
|
|
||||||
class wxMacCoreGraphicsColour
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
wxMacCoreGraphicsColour();
|
|
||||||
wxMacCoreGraphicsColour(const wxBrush &brush);
|
|
||||||
~wxMacCoreGraphicsColour();
|
|
||||||
|
|
||||||
void Apply( CGContextRef cgContext );
|
|
||||||
protected:
|
|
||||||
void Init();
|
|
||||||
wxMacCFRefHolder<CGColorRef> m_color;
|
|
||||||
wxMacCFRefHolder<CGColorSpaceRef> m_colorSpace;
|
|
||||||
|
|
||||||
bool m_isPattern;
|
|
||||||
wxMacCFRefHolder<CGPatternRef> m_pattern;
|
|
||||||
CGFloat* m_patternColorComponents;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
CGColorSpaceRef wxMacGetGenericRGBColorSpace(void);
|
CGColorSpaceRef wxMacGetGenericRGBColorSpace(void);
|
||||||
|
|
||||||
void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t size);
|
void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t size);
|
||||||
|
|
||||||
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
|
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
|
||||||
@@ -1213,23 +1196,6 @@ protected :
|
|||||||
WindowRef m_macWindow ;
|
WindowRef m_macWindow ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
#ifndef __LP64__
|
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
|
||||||
inline Rect* wxMacGetPictureBounds( PicHandle pict , Rect* rect )
|
|
||||||
{
|
|
||||||
*rect = (**pict).picFrame;
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
inline Rect* wxMacGetPictureBounds( PicHandle pict , Rect* rect )
|
|
||||||
{
|
|
||||||
return QDGetPictureBounds( pict , rect );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
#define wxMAC_DEFINE_PROC_GETTER( UPP , x ) \
|
#define wxMAC_DEFINE_PROC_GETTER( UPP , x ) \
|
||||||
|
@@ -96,7 +96,7 @@ public:
|
|||||||
|
|
||||||
virtual void SetExtraStyle(long exStyle) ;
|
virtual void SetExtraStyle(long exStyle) ;
|
||||||
|
|
||||||
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||||
|
|
||||||
virtual void MacInstallTopLevelWindowEventHandler() ;
|
virtual void MacInstallTopLevelWindowEventHandler() ;
|
||||||
|
|
||||||
|
@@ -202,8 +202,6 @@ public:
|
|||||||
bool MacIsUserPane() { return m_macIsUserPane; }
|
bool MacIsUserPane() { return m_macIsUserPane; }
|
||||||
|
|
||||||
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
||||||
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
|
||||||
const wxBrush& MacGetBackgroundBrush() const { return m_macBackgroundBrush ; }
|
|
||||||
|
|
||||||
// return the rectangle that would be visible of this control,
|
// return the rectangle that would be visible of this control,
|
||||||
// regardless whether controls are hidden
|
// regardless whether controls are hidden
|
||||||
@@ -287,7 +285,6 @@ protected:
|
|||||||
|
|
||||||
// true if is is not a native control but a wxWindow control
|
// true if is is not a native control but a wxWindow control
|
||||||
bool m_macIsUserPane ;
|
bool m_macIsUserPane ;
|
||||||
wxBrush m_macBackgroundBrush ;
|
|
||||||
|
|
||||||
// insets of the mac control from the wx top left corner
|
// insets of the mac control from the wx top left corner
|
||||||
wxPoint m_macTopLeftInset ;
|
wxPoint m_macTopLeftInset ;
|
||||||
|
Reference in New Issue
Block a user