Fix Ok/IsOk() mess in wxGDIObject-derived classes; also added
wxGDIObject::Create/CloneGDIRefData() and implemented them for (almost) all ports git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -31,7 +31,7 @@ extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxAnimationCtrlNameStr[];
|
|||||||
// wxAnimationBase
|
// wxAnimationBase
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_ADV wxAnimationBase : public wxGDIObject
|
class WXDLLIMPEXP_ADV wxAnimationBase : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxAnimationBase() {}
|
wxAnimationBase() {}
|
||||||
|
@@ -133,9 +133,6 @@ public:
|
|||||||
static void InitStandardHandlers();
|
static void InitStandardHandlers();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const = 0;
|
|
||||||
|
|
||||||
virtual int GetHeight() const = 0;
|
virtual int GetHeight() const = 0;
|
||||||
virtual int GetWidth() const = 0;
|
virtual int GetWidth() const = 0;
|
||||||
virtual int GetDepth() const = 0;
|
virtual int GetDepth() const = 0;
|
||||||
|
@@ -64,7 +64,6 @@ protected:
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
class WXDLLEXPORT wxBitmap: public wxGDIObject
|
class WXDLLEXPORT wxBitmap: public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// initialization
|
// initialization
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
@@ -116,8 +115,6 @@ public:
|
|||||||
// get the given part of bitmap
|
// get the given part of bitmap
|
||||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
int GetWidth() const;
|
int GetWidth() const;
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
int GetDepth() const;
|
int GetDepth() const;
|
||||||
@@ -140,10 +137,6 @@ public:
|
|||||||
|
|
||||||
int GetBitmapType() const;
|
int GetBitmapType() const;
|
||||||
|
|
||||||
// wxObjectRefData
|
|
||||||
wxObjectRefData *CreateRefData() const;
|
|
||||||
wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
// wxCocoa
|
// wxCocoa
|
||||||
WX_NSBitmapImageRep GetNSBitmapImageRep();
|
WX_NSBitmapImageRep GetNSBitmapImageRep();
|
||||||
void SetNSBitmapImageRep(WX_NSBitmapImageRep bitmapImageRep);
|
void SetNSBitmapImageRep(WX_NSBitmapImageRep bitmapImageRep);
|
||||||
@@ -151,6 +144,12 @@ public:
|
|||||||
|
|
||||||
static void InitStandardHandlers() { }
|
static void InitStandardHandlers() { }
|
||||||
static void CleanUpHandlers() { }
|
static void CleanUpHandlers() { }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
|
class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
|
||||||
@@ -158,5 +157,4 @@ class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
|
|||||||
DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
|
DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // __WX_COCOA_BITMAP_H__
|
||||||
// __WX_COCOA_BITMAP_H__
|
|
||||||
|
@@ -52,16 +52,12 @@ public:
|
|||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxBitmap *GetStipple() const;
|
wxBitmap *GetStipple() const;
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const
|
|
||||||
{ return (m_refData != NULL); }
|
|
||||||
|
|
||||||
// wxObjectRefData
|
|
||||||
wxObjectRefData *CreateRefData() const;
|
|
||||||
wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
// wxCocoa
|
// wxCocoa
|
||||||
WX_NSColor GetNSColor();
|
WX_NSColor GetNSColor();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __WX_COCOA_BRUSH_H__
|
#endif // __WX_COCOA_BRUSH_H__
|
||||||
|
@@ -50,7 +50,7 @@ public:
|
|||||||
virtual ~wxColour();
|
virtual ~wxColour();
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool IsOk() const { return m_cocoaNSColor; }
|
virtual bool IsOk() const { return m_cocoaNSColor; }
|
||||||
WX_NSColor GetNSColor() { return m_cocoaNSColor; }
|
WX_NSColor GetNSColor() { return m_cocoaNSColor; }
|
||||||
|
|
||||||
unsigned char Red() const { return m_red; }
|
unsigned char Red() const { return m_red; }
|
||||||
|
@@ -14,12 +14,8 @@
|
|||||||
|
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
class WXDLLEXPORT wxCursorRefData: public wxObjectRefData
|
class WXDLLEXPORT wxCursorRefData : public wxGDIRefData
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxCursorRefData)
|
|
||||||
|
|
||||||
friend class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
|
||||||
friend class WXDLLIMPEXP_FWD_CORE wxCursor;
|
|
||||||
public:
|
public:
|
||||||
wxCursorRefData();
|
wxCursorRefData();
|
||||||
virtual ~wxCursorRefData();
|
virtual ~wxCursorRefData();
|
||||||
@@ -27,6 +23,11 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
int m_width, m_height;
|
int m_width, m_height;
|
||||||
WX_NSCursor m_hCursor;
|
WX_NSCursor m_hCursor;
|
||||||
|
|
||||||
|
friend class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||||
|
friend class WXDLLIMPEXP_FWD_CORE wxCursor;
|
||||||
|
|
||||||
|
DECLARE_NO_COPY_CLASS(wxCursorRefData)
|
||||||
};
|
};
|
||||||
|
|
||||||
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
||||||
@@ -35,31 +36,26 @@ protected:
|
|||||||
// Cursor
|
// Cursor
|
||||||
class WXDLLEXPORT wxCursor: public wxBitmap
|
class WXDLLEXPORT wxCursor: public wxBitmap
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxCursor();
|
wxCursor();
|
||||||
|
|
||||||
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
|
wxCursor(const char bits[], int width, int height,
|
||||||
const char maskBits[] = NULL);
|
int hotSpotX = -1, int hotSpotY = -1,
|
||||||
|
const char maskBits[] = NULL);
|
||||||
|
|
||||||
wxCursor(const wxString& name, long flags = 0,
|
wxCursor(const wxString& name, long flags = 0,
|
||||||
int hotSpotX = 0, int hotSpotY = 0);
|
int hotSpotX = 0, int hotSpotY = 0);
|
||||||
|
|
||||||
wxCursor(int cursor_type);
|
wxCursor(int cursor_type);
|
||||||
virtual ~wxCursor();
|
virtual ~wxCursor();
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
// FIXME: operator==() is wrong!
|
||||||
virtual bool IsOk() const { return m_refData ; }
|
bool operator==(const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
|
||||||
|
bool operator!=(const wxCursor& cursor) const { return !(*this == cursor); }
|
||||||
|
|
||||||
inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
|
WX_NSCursor GetNSCursor() const { return M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0; }
|
||||||
inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }
|
|
||||||
|
|
||||||
inline WX_NSCursor GetNSCursor() const
|
|
||||||
{
|
|
||||||
return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
||||||
|
@@ -110,15 +110,6 @@ public:
|
|||||||
virtual bool RealizeResource();
|
virtual bool RealizeResource();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*! @abstract Helper method for COW.
|
|
||||||
@discussion
|
|
||||||
wxFont can be considered a mutable holder of an immutable opaque implementation object.
|
|
||||||
All methods that mutate the font should first call Unshare() to ensure that mutating
|
|
||||||
the implementation object does not cause another wxFont that happened to share the
|
|
||||||
same ref data to mutate.
|
|
||||||
*/
|
|
||||||
void Unshare();
|
|
||||||
|
|
||||||
/*! @abstract Internal constructor with ref data
|
/*! @abstract Internal constructor with ref data
|
||||||
@discussion
|
@discussion
|
||||||
Takes ownership of @a refData. That is, it is assumed that refData has either just been
|
Takes ownership of @a refData. That is, it is assumed that refData has either just been
|
||||||
@@ -128,6 +119,10 @@ protected:
|
|||||||
explicit wxFont(wxFontRefData *refData)
|
explicit wxFont(wxFontRefData *refData)
|
||||||
{ Create(refData); }
|
{ Create(refData); }
|
||||||
bool Create(wxFontRefData *refData);
|
bool Create(wxFontRefData *refData);
|
||||||
|
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
};
|
};
|
||||||
|
@@ -18,9 +18,8 @@
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
// wxIcon
|
// wxIcon
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
class WXDLLEXPORT wxIcon: public wxGDIObject
|
class WXDLLEXPORT wxIcon : public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
|
||||||
public:
|
public:
|
||||||
wxIcon();
|
wxIcon();
|
||||||
|
|
||||||
@@ -49,14 +48,18 @@ public:
|
|||||||
// ctors, assignment operators...), but it's ok to have such function
|
// ctors, assignment operators...), but it's ok to have such function
|
||||||
void CopyFromBitmap(const wxBitmap& bmp);
|
void CopyFromBitmap(const wxBitmap& bmp);
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
int GetWidth() const;
|
int GetWidth() const;
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
|
|
||||||
WX_NSImage GetNSImage() const;
|
WX_NSImage GetNSImage() const;
|
||||||
bool CreateFromXpm(const char **bits);
|
bool CreateFromXpm(const char **bits);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_COCOA_ICON_H__
|
||||||
// _WX_COCOA_ICON_H__
|
|
||||||
|
@@ -23,24 +23,15 @@ class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
class WXDLLEXPORT wxPen: public wxGDIObject
|
class WXDLLEXPORT wxPen: public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
|
||||||
public:
|
public:
|
||||||
wxPen();
|
wxPen();
|
||||||
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
|
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
|
||||||
wxPen(const wxBitmap& stipple, int width);
|
wxPen(const wxBitmap& stipple, int width);
|
||||||
virtual ~wxPen();
|
virtual ~wxPen();
|
||||||
|
|
||||||
// wxObjectRefData
|
// FIXME: operator==() is wrong
|
||||||
wxObjectRefData *CreateRefData() const;
|
bool operator==(const wxPen& pen) const { return m_refData == pen.m_refData; }
|
||||||
wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
inline bool operator == (const wxPen& pen) const
|
|
||||||
{ return m_refData == pen.m_refData; }
|
|
||||||
inline bool operator != (const wxPen& pen) const
|
|
||||||
{ return m_refData != pen.m_refData; }
|
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const { return (m_refData != NULL) ; }
|
|
||||||
|
|
||||||
void SetColour(const wxColour& col) ;
|
void SetColour(const wxColour& col) ;
|
||||||
void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||||
@@ -62,6 +53,12 @@ public:
|
|||||||
|
|
||||||
WX_NSColor GetNSColor();
|
WX_NSColor GetNSColor();
|
||||||
int GetCocoaLineDash(const CGFloat **pattern);
|
int GetCocoaLineDash(const CGFloat **pattern);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __WX_COCOA_PEN_H__
|
#endif // __WX_COCOA_PEN_H__
|
||||||
|
@@ -92,9 +92,6 @@ public:
|
|||||||
// accessors
|
// accessors
|
||||||
// ---------
|
// ---------
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const = 0;
|
|
||||||
|
|
||||||
virtual ChannelType Red() const = 0;
|
virtual ChannelType Red() const = 0;
|
||||||
virtual ChannelType Green() const = 0;
|
virtual ChannelType Green() const = 0;
|
||||||
virtual ChannelType Blue() const = 0;
|
virtual ChannelType Blue() const = 0;
|
||||||
@@ -119,6 +116,23 @@ protected:
|
|||||||
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) = 0;
|
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) = 0;
|
||||||
|
|
||||||
virtual bool FromString(const wxString& s);
|
virtual bool FromString(const wxString& s);
|
||||||
|
|
||||||
|
// wxColour doesn't use reference counted data (at least not in all ports)
|
||||||
|
// so provide stubs for the functions which need to be defined if we do use
|
||||||
|
// them
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( "must be overridden if used" );
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( "must be overridden if used" );
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -21,12 +21,12 @@ wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
|
|||||||
// wxBitmap
|
// wxBitmap
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
|
class WXDLLIMPEXP_CORE wxBitmapHandler : public wxBitmapHandlerBase
|
||||||
{
|
{
|
||||||
DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
|
DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
|
class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxBitmap() {}
|
wxBitmap() {}
|
||||||
@@ -39,9 +39,6 @@ public:
|
|||||||
wxBitmap(const wxImage& image, int depth = -1);
|
wxBitmap(const wxImage& image, int depth = -1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
bool Create(const wxIDirectFBSurfacePtr& surface);
|
bool Create(const wxIDirectFBSurfacePtr& surface);
|
||||||
bool Create(int width, int height, int depth = -1);
|
bool Create(int width, int height, int depth = -1);
|
||||||
|
|
||||||
@@ -86,9 +83,8 @@ public:
|
|||||||
wxIDirectFBSurfacePtr GetDirectFBSurface() const;
|
wxIDirectFBSurfacePtr GetDirectFBSurface() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
bool CreateWithFormat(int width, int height, int dfbFormat);
|
bool CreateWithFormat(int width, int height, int dfbFormat);
|
||||||
|
|
||||||
|
@@ -28,20 +28,18 @@ class WXDLLIMPEXP_FWD_CORE wxBrush;
|
|||||||
// wxBrush
|
// wxBrush
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase
|
class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxBrush() {}
|
wxBrush() {}
|
||||||
wxBrush(const wxColour &colour, int style = wxSOLID);
|
wxBrush(const wxColour &colour, int style = wxSOLID);
|
||||||
wxBrush(const wxBitmap &stippleBitmap);
|
wxBrush(const wxBitmap &stippleBitmap);
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
bool operator==(const wxBrush& brush) const;
|
bool operator==(const wxBrush& brush) const;
|
||||||
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
||||||
|
|
||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxColour &GetColour() const;
|
wxColour& GetColour() const;
|
||||||
wxBitmap *GetStipple() const;
|
wxBitmap *GetStipple() const;
|
||||||
|
|
||||||
void SetColour(const wxColour& col);
|
void SetColour(const wxColour& col);
|
||||||
@@ -50,9 +48,8 @@ public:
|
|||||||
void SetStipple(const wxBitmap& stipple);
|
void SetStipple(const wxBitmap& stipple);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#ifndef _WX_DFB_CURSOR_H_
|
#ifndef _WX_DFB_CURSOR_H_
|
||||||
#define _WX_DFB_CURSOR_H_
|
#define _WX_DFB_CURSOR_H_
|
||||||
|
|
||||||
#include "wx/object.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||||
@@ -20,7 +20,7 @@ class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
|||||||
// wxCursor
|
// wxCursor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxCursor: public wxObject
|
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxCursor() {}
|
wxCursor() {}
|
||||||
@@ -32,16 +32,13 @@ public:
|
|||||||
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
||||||
int hotSpotX = 0, int hotSpotY = 0);
|
int hotSpotX = 0, int hotSpotY = 0);
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
wxBitmap GetBitmap() const;
|
wxBitmap GetBitmap() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
// ref counting code
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
};
|
};
|
||||||
|
@@ -71,9 +71,8 @@ public:
|
|||||||
wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const;
|
wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
|
@@ -57,13 +57,9 @@ public:
|
|||||||
wxDash* GetDash() const;
|
wxDash* GetDash() const;
|
||||||
wxBitmap *GetStipple() const;
|
wxBitmap *GetStipple() const;
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
};
|
};
|
||||||
|
@@ -40,9 +40,8 @@ public:
|
|||||||
wxRect AsRect() const { return GetBox(); }
|
wxRect AsRect() const { return GetBox(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
// wxRegionBase pure virtuals
|
// wxRegionBase pure virtuals
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
|
@@ -155,13 +155,9 @@ public:
|
|||||||
// from the string representation of wxNativeFontInfo
|
// from the string representation of wxNativeFontInfo
|
||||||
static wxFont *New(const wxString& strNativeFontDesc);
|
static wxFont *New(const wxString& strNativeFontDesc);
|
||||||
|
|
||||||
// was the font successfully created?
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
|
||||||
|
|
||||||
// comparison
|
// comparison
|
||||||
bool operator == (const wxFont& font) const;
|
bool operator==(const wxFont& font) const;
|
||||||
bool operator != (const wxFont& font) const;
|
bool operator!=(const wxFont& font) const { return !(*this == font); }
|
||||||
|
|
||||||
// accessors: get the font characteristics
|
// accessors: get the font characteristics
|
||||||
virtual int GetPointSize() const = 0;
|
virtual int GetPointSize() const = 0;
|
||||||
|
@@ -20,21 +20,35 @@
|
|||||||
// the same native GDI object
|
// the same native GDI object
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxGDIRefData: public wxObjectRefData { };
|
class WXDLLIMPEXP_FWD_CORE wxGDIRefData : public wxObjectRefData
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// wxGDIObject
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxGDIObject: public wxObject
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// override this in the derived classes to check if this data object is
|
||||||
|
// really fully initialized
|
||||||
|
virtual bool IsOk() const { return true; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxGDIObject: base class for bitmaps, pens, brushes, ...
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxGDIObject : public wxObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// checks if the object can be used
|
||||||
|
bool IsOk() const
|
||||||
|
{
|
||||||
|
// the cast here is safe because the derived classes always create
|
||||||
|
// wxGDIRefData objects
|
||||||
|
return m_refData && wx_static_cast(wxGDIRefData *, m_refData)->IsOk();
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't use in the new code, use IsOk() instead
|
||||||
bool IsNull() const { return m_refData == NULL; }
|
bool IsNull() const { return m_refData == NULL; }
|
||||||
|
|
||||||
// older version, for backwards compat
|
// older version, for backwards compatibility only (but not deprecated
|
||||||
|
// because it's still widely used)
|
||||||
bool Ok() const { return IsOk(); }
|
bool Ok() const { return IsOk(); }
|
||||||
|
|
||||||
virtual bool IsOk() const { return (m_refData != NULL) ; }
|
|
||||||
|
|
||||||
#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXPALMOS__)
|
#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXPALMOS__)
|
||||||
// Creates the resource
|
// Creates the resource
|
||||||
@@ -49,8 +63,24 @@ public:
|
|||||||
virtual WXHANDLE GetResourceHandle() const { return 0; }
|
virtual WXHANDLE GetResourceHandle() const { return 0; }
|
||||||
#endif // defined(__WXMSW__) || defined(__WXPM__)
|
#endif // defined(__WXMSW__) || defined(__WXPM__)
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// replace base class functions using wxObjectRefData with our own which
|
||||||
|
// use wxGDIRefData to ensure that we always work with data objects of the
|
||||||
|
// correct type (i.e. derived from wxGDIRefData)
|
||||||
|
virtual wxObjectRefData *CreateRefData() const
|
||||||
|
{
|
||||||
|
return CreateGDIRefData();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const
|
||||||
|
{
|
||||||
|
return CloneGDIRefData(wx_static_cast(const wxGDIRefData *, data));
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const = 0;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const = 0;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxGDIObject)
|
DECLARE_DYNAMIC_CLASS(wxGDIObject)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_GDIOBJ_H_BASE_
|
||||||
// _WX_GDIOBJ_H_BASE_
|
|
||||||
|
@@ -33,7 +33,7 @@ public:
|
|||||||
virtual ~wxColour();
|
virtual ~wxColour();
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool IsOk() const { return m_isInit; }
|
virtual bool IsOk() const { return m_isInit; }
|
||||||
|
|
||||||
unsigned char Red() const { return m_red; }
|
unsigned char Red() const { return m_red; }
|
||||||
unsigned char Green() const { return m_green; }
|
unsigned char Green() const { return m_green; }
|
||||||
|
@@ -33,8 +33,6 @@ public:
|
|||||||
wxPalette();
|
wxPalette();
|
||||||
wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
|
wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
|
||||||
virtual ~wxPalette();
|
virtual ~wxPalette();
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const;
|
|
||||||
|
|
||||||
bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
int GetPixel( unsigned char red, unsigned char green, unsigned char blue ) const;
|
int GetPixel( unsigned char red, unsigned char green, unsigned char blue ) const;
|
||||||
@@ -42,6 +40,10 @@ public:
|
|||||||
|
|
||||||
virtual int GetColoursCount() const;
|
virtual int GetColoursCount() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||||
};
|
};
|
||||||
|
@@ -26,8 +26,8 @@ public:
|
|||||||
virtual bool IsEmpty() const;
|
virtual bool IsEmpty() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
// wxRegionBase pure virtuals
|
// wxRegionBase pure virtuals
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
|
@@ -66,14 +66,12 @@ public:
|
|||||||
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
|
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
|
||||||
#endif // wxUSE_IMAGE
|
#endif // wxUSE_IMAGE
|
||||||
virtual ~wxBitmap();
|
virtual ~wxBitmap();
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
bool Create(int width, int height, int depth = -1);
|
bool Create(int width, int height, int depth = -1);
|
||||||
|
|
||||||
int GetHeight() const;
|
virtual int GetHeight() const;
|
||||||
int GetWidth() const;
|
virtual int GetWidth() const;
|
||||||
int GetDepth() const;
|
virtual int GetDepth() const;
|
||||||
|
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
wxImage ConvertToImage() const;
|
wxImage ConvertToImage() const;
|
||||||
@@ -127,8 +125,8 @@ protected:
|
|||||||
bool CreateFromImage(const wxImage& image, int depth);
|
bool CreateFromImage(const wxImage& image, int depth);
|
||||||
#endif // wxUSE_IMAGE
|
#endif // wxUSE_IMAGE
|
||||||
|
|
||||||
virtual wxObjectRefData* CreateRefData() const;
|
virtual wxGDIRefData* CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const;
|
virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
|
@@ -26,11 +26,8 @@ public:
|
|||||||
wxBrush( const wxBitmap &stippleBitmap );
|
wxBrush( const wxBitmap &stippleBitmap );
|
||||||
virtual ~wxBrush();
|
virtual ~wxBrush();
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
bool operator==(const wxBrush& brush) const;
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
||||||
|
|
||||||
bool operator == ( const wxBrush& brush ) const;
|
|
||||||
bool operator != (const wxBrush& brush) const { return !(*this == brush); }
|
|
||||||
|
|
||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxColour &GetColour() const;
|
wxColour &GetColour() const;
|
||||||
@@ -42,9 +39,8 @@ public:
|
|||||||
void SetStipple( const wxBitmap& stipple );
|
void SetStipple( const wxBitmap& stipple );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
@@ -27,10 +27,8 @@ public:
|
|||||||
|
|
||||||
virtual ~wxColour();
|
virtual ~wxColour();
|
||||||
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator==(const wxColour& col) const;
|
||||||
|
bool operator!=(const wxColour& col) const { return !(*this == col); }
|
||||||
bool operator == ( const wxColour& col ) const;
|
|
||||||
bool operator != ( const wxColour& col ) const { return !(*this == col); }
|
|
||||||
|
|
||||||
unsigned char Red() const;
|
unsigned char Red() const;
|
||||||
unsigned char Green() const;
|
unsigned char Green() const;
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#ifndef _WX_GTK_CURSOR_H_
|
#ifndef _WX_GTK_CURSOR_H_
|
||||||
#define _WX_GTK_CURSOR_H_
|
#define _WX_GTK_CURSOR_H_
|
||||||
|
|
||||||
#include "wx/object.h"
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxColour;
|
class WXDLLIMPEXP_FWD_CORE wxColour;
|
||||||
class WXDLLIMPEXP_FWD_CORE wxImage;
|
class WXDLLIMPEXP_FWD_CORE wxImage;
|
||||||
@@ -19,10 +19,9 @@ class WXDLLIMPEXP_FWD_CORE wxImage;
|
|||||||
// wxCursor
|
// wxCursor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxCursor: public wxObject
|
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxCursor();
|
wxCursor();
|
||||||
wxCursor( int cursorId );
|
wxCursor( int cursorId );
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
@@ -30,15 +29,18 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
wxCursor( const char bits[], int width, int height,
|
wxCursor( const char bits[], int width, int height,
|
||||||
int hotSpotX=-1, int hotSpotY=-1,
|
int hotSpotX=-1, int hotSpotY=-1,
|
||||||
const char maskBits[] = NULL, const wxColour *fg = NULL, const wxColour *bg = NULL );
|
const char maskBits[] = NULL,
|
||||||
|
const wxColour *fg = NULL, const wxColour *bg = NULL );
|
||||||
virtual ~wxCursor();
|
virtual ~wxCursor();
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
GdkCursor *GetCursor() const;
|
GdkCursor *GetCursor() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
};
|
};
|
||||||
|
@@ -84,8 +84,8 @@ protected:
|
|||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
virtual wxObjectRefData* CreateRefData() const;
|
virtual wxGDIRefData* CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const;
|
virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
|
@@ -27,11 +27,8 @@ public:
|
|||||||
wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
|
wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
|
||||||
virtual ~wxPen();
|
virtual ~wxPen();
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
bool operator==(const wxPen& pen) const;
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
bool operator == ( const wxPen& pen ) const;
|
|
||||||
bool operator != (const wxPen& pen) const { return !(*this == pen); }
|
|
||||||
|
|
||||||
void SetColour( const wxColour &colour );
|
void SetColour( const wxColour &colour );
|
||||||
void SetColour( unsigned char red, unsigned char green, unsigned char blue );
|
void SetColour( unsigned char red, unsigned char green, unsigned char blue );
|
||||||
@@ -51,9 +48,8 @@ public:
|
|||||||
wxDash* GetDash() const;
|
wxDash* GetDash() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
};
|
};
|
||||||
|
@@ -63,9 +63,8 @@ public:
|
|||||||
GdkRegion *GetRegion() const;
|
GdkRegion *GetRegion() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
// wxRegionBase pure virtuals
|
// wxRegionBase pure virtuals
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
|
@@ -78,14 +78,12 @@ public:
|
|||||||
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
||||||
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
|
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
|
||||||
virtual ~wxBitmap();
|
virtual ~wxBitmap();
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
bool Create(int width, int height, int depth = -1);
|
bool Create(int width, int height, int depth = -1);
|
||||||
|
|
||||||
int GetHeight() const;
|
virtual int GetHeight() const;
|
||||||
int GetWidth() const;
|
virtual int GetWidth() const;
|
||||||
int GetDepth() const;
|
virtual int GetDepth() const;
|
||||||
|
|
||||||
wxImage ConvertToImage() const;
|
wxImage ConvertToImage() const;
|
||||||
|
|
||||||
@@ -134,8 +132,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool CreateFromImage(const wxImage& image, int depth);
|
bool CreateFromImage(const wxImage& image, int depth);
|
||||||
|
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// to be called from CreateFromImage only!
|
// to be called from CreateFromImage only!
|
||||||
|
@@ -36,11 +36,8 @@ public:
|
|||||||
wxBrush( const wxBitmap &stippleBitmap );
|
wxBrush( const wxBitmap &stippleBitmap );
|
||||||
virtual ~wxBrush();
|
virtual ~wxBrush();
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
bool operator==(const wxBrush& brush) const;
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
||||||
|
|
||||||
bool operator == ( const wxBrush& brush ) const;
|
|
||||||
bool operator != (const wxBrush& brush) const { return !(*this == brush); }
|
|
||||||
|
|
||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxColour &GetColour() const;
|
wxColour &GetColour() const;
|
||||||
@@ -52,9 +49,8 @@ public:
|
|||||||
void SetStipple( const wxBitmap& stipple );
|
void SetStipple( const wxBitmap& stipple );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
@@ -45,10 +45,8 @@ public:
|
|||||||
|
|
||||||
virtual bool FromString(const wxString& str);
|
virtual bool FromString(const wxString& str);
|
||||||
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator==(const wxColour& col) const;
|
||||||
|
bool operator!=(const wxColour& col) const { return !(*this == col); }
|
||||||
bool operator == ( const wxColour& col ) const;
|
|
||||||
bool operator != ( const wxColour& col ) const { return !(*this == col); }
|
|
||||||
|
|
||||||
unsigned char Red() const;
|
unsigned char Red() const;
|
||||||
unsigned char Green() const;
|
unsigned char Green() const;
|
||||||
@@ -62,8 +60,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
// ref counting code
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
||||||
|
@@ -10,8 +10,7 @@
|
|||||||
#ifndef __GTKCURSORH__
|
#ifndef __GTKCURSORH__
|
||||||
#define __GTKCURSORH__
|
#define __GTKCURSORH__
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
@@ -22,10 +21,9 @@
|
|||||||
// wxCursor
|
// wxCursor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxCursor: public wxObject
|
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxCursor();
|
wxCursor();
|
||||||
wxCursor( int cursorId );
|
wxCursor( int cursorId );
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
@@ -35,13 +33,15 @@ public:
|
|||||||
int hotSpotX=-1, int hotSpotY=-1,
|
int hotSpotX=-1, int hotSpotY=-1,
|
||||||
const char maskBits[] = NULL, const wxColour *fg = NULL, const wxColour *bg = NULL );
|
const char maskBits[] = NULL, const wxColour *fg = NULL, const wxColour *bg = NULL );
|
||||||
virtual ~wxCursor();
|
virtual ~wxCursor();
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
GdkCursor *GetCursor() const;
|
GdkCursor *GetCursor() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
};
|
};
|
||||||
|
@@ -91,9 +91,10 @@ public:
|
|||||||
|
|
||||||
GdkFont* GetInternalFont(float scale = 1.0) const;
|
GdkFont* GetInternalFont(float scale = 1.0) const;
|
||||||
|
|
||||||
// no data :-)
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
|
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -40,11 +40,8 @@ public:
|
|||||||
wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
|
wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
|
||||||
virtual ~wxPen();
|
virtual ~wxPen();
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
bool operator==(const wxPen& pen) const;
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
bool operator == ( const wxPen& pen ) const;
|
|
||||||
bool operator != (const wxPen& pen) const { return !(*this == pen); }
|
|
||||||
|
|
||||||
void SetColour( const wxColour &colour );
|
void SetColour( const wxColour &colour );
|
||||||
void SetColour( unsigned char red, unsigned char green, unsigned char blue );
|
void SetColour( unsigned char red, unsigned char green, unsigned char blue );
|
||||||
@@ -64,9 +61,8 @@ public:
|
|||||||
wxDash* GetDash() const;
|
wxDash* GetDash() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
};
|
};
|
||||||
|
@@ -63,9 +63,8 @@ public:
|
|||||||
GdkRegion *GetRegion() const;
|
GdkRegion *GetRegion() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
// wxRegionBase pure virtuals
|
// wxRegionBase pure virtuals
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
|
@@ -46,8 +46,6 @@ public:
|
|||||||
wxIconBundle& operator=(const wxIconBundle& ic)
|
wxIconBundle& operator=(const wxIconBundle& ic)
|
||||||
{ if ( this != &ic) Ref(ic); return *this; }
|
{ if ( this != &ic) Ref(ic); return *this; }
|
||||||
|
|
||||||
virtual bool IsOk() const;
|
|
||||||
|
|
||||||
|
|
||||||
// adds all the icons contained in the file to the collection,
|
// adds all the icons contained in the file to the collection,
|
||||||
// if the collection already contains icons with the same
|
// if the collection already contains icons with the same
|
||||||
@@ -87,8 +85,8 @@ public:
|
|||||||
bool IsEmpty() const { return GetIconCount() == 0; }
|
bool IsEmpty() const { return GetIconCount() == 0; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// delete all icons
|
// delete all icons
|
||||||
|
@@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
// Construct a mask from a mono bitmap (black meaning show pixels, white meaning transparent)
|
// Construct a mask from a mono bitmap (black meaning show pixels, white meaning transparent)
|
||||||
wxMask(const wxBitmap& bitmap);
|
wxMask(const wxBitmap& bitmap);
|
||||||
|
|
||||||
// implementation helper only : construct a mask from a 32 bit memory buffer
|
// implementation helper only : construct a mask from a 32 bit memory buffer
|
||||||
wxMask(const wxMemoryBuffer& buf, int width , int height , int bytesPerRow ) ;
|
wxMask(const wxMemoryBuffer& buf, int width , int height , int bytesPerRow ) ;
|
||||||
|
|
||||||
@@ -61,10 +61,10 @@ public:
|
|||||||
|
|
||||||
void Init() ;
|
void Init() ;
|
||||||
|
|
||||||
// a 8 bit depth mask
|
// a 8 bit depth mask
|
||||||
void* GetRawAccess() const;
|
void* GetRawAccess() const;
|
||||||
int GetBytesPerRow() const { return m_bytesPerRow ; }
|
int GetBytesPerRow() const { return m_bytesPerRow ; }
|
||||||
// renders/updates native representation when necessary
|
// renders/updates native representation when necessary
|
||||||
void RealizeNative() ;
|
void RealizeNative() ;
|
||||||
|
|
||||||
WXHBITMAP GetHBITMAP() const ;
|
WXHBITMAP GetHBITMAP() const ;
|
||||||
@@ -134,8 +134,6 @@ public:
|
|||||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||||
virtual bool CopyFromIcon(const wxIcon& icon);
|
virtual bool CopyFromIcon(const wxIcon& icon);
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
int GetWidth() const;
|
int GetWidth() const;
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
int GetDepth() const;
|
int GetDepth() const;
|
||||||
@@ -163,7 +161,7 @@ public:
|
|||||||
bool HasAlpha() const;
|
bool HasAlpha() const;
|
||||||
void UseAlpha();
|
void UseAlpha();
|
||||||
|
|
||||||
// returns the 'native' implementation, a GWorldPtr for the content and one for the mask
|
// returns the 'native' implementation, a GWorldPtr for the content and one for the mask
|
||||||
WXHBITMAP GetHBITMAP( WXHBITMAP * mask = NULL ) const;
|
WXHBITMAP GetHBITMAP( WXHBITMAP * mask = NULL ) const;
|
||||||
|
|
||||||
// returns a CGImageRef which must released after usage with CGImageRelease
|
// returns a CGImageRef which must released after usage with CGImageRelease
|
||||||
@@ -181,9 +179,8 @@ public:
|
|||||||
void EndRawAccess() ;
|
void EndRawAccess() ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
// _WX_BITMAP_H_
|
#endif // _WX_BITMAP_H_
|
||||||
|
@@ -21,7 +21,7 @@ class WXDLLIMPEXP_FWD_CORE wxBrush;
|
|||||||
// Brush
|
// Brush
|
||||||
class WXDLLEXPORT wxBrush: public wxBrushBase
|
class WXDLLEXPORT wxBrush: public wxBrushBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxBrush();
|
wxBrush();
|
||||||
wxBrush(const wxColour& col, int style = wxSOLID);
|
wxBrush(const wxColour& col, int style = wxSOLID);
|
||||||
wxBrush(const wxBitmap& stipple);
|
wxBrush(const wxBitmap& stipple);
|
||||||
@@ -32,20 +32,19 @@ class WXDLLEXPORT wxBrush: public wxBrushBase
|
|||||||
virtual void SetStyle(int style) ;
|
virtual void SetStyle(int style) ;
|
||||||
virtual void SetStipple(const wxBitmap& stipple) ;
|
virtual void SetStipple(const wxBitmap& stipple) ;
|
||||||
|
|
||||||
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); }
|
|
||||||
|
|
||||||
const wxColour& GetColour() const ;
|
const wxColour& GetColour() const ;
|
||||||
virtual int GetStyle() const ;
|
virtual int GetStyle() const ;
|
||||||
wxBitmap *GetStipple() const ;
|
wxBitmap *GetStipple() const ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_BRUSH_H_
|
||||||
// _WX_BRUSH_H_
|
|
||||||
|
@@ -34,7 +34,7 @@ public:
|
|||||||
virtual ~wxColour();
|
virtual ~wxColour();
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool IsOk() const;
|
virtual bool IsOk() const { return m_cgColour; }
|
||||||
|
|
||||||
ChannelType Red() const { return m_red; }
|
ChannelType Red() const { return m_red; }
|
||||||
ChannelType Green() const { return m_green; }
|
ChannelType Green() const { return m_green; }
|
||||||
|
@@ -15,38 +15,40 @@
|
|||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
// Cursor
|
// Cursor
|
||||||
class WXDLLEXPORT wxCursor: public wxGDIObject
|
class WXDLLEXPORT wxCursor : public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxCursor();
|
wxCursor();
|
||||||
|
|
||||||
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
|
wxCursor(const char bits[], int width, int height,
|
||||||
const char maskBits[] = NULL);
|
int hotSpotX = -1, int hotSpotY = -1,
|
||||||
|
const char maskBits[] = NULL);
|
||||||
|
|
||||||
wxCursor(const wxImage & image) ;
|
wxCursor(const wxImage & image) ;
|
||||||
wxCursor(const char **bits) ;
|
wxCursor(const char **bits) ;
|
||||||
wxCursor(char **bits) ;
|
wxCursor(char **bits) ;
|
||||||
wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE,
|
wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE,
|
||||||
int hotSpotX = 0, int hotSpotY = 0);
|
int hotSpotX = 0, int hotSpotY = 0);
|
||||||
|
|
||||||
wxCursor(int cursor_type);
|
wxCursor(int cursor_type);
|
||||||
virtual ~wxCursor();
|
virtual ~wxCursor();
|
||||||
|
|
||||||
bool CreateFromXpm(const char **bits) ;
|
bool CreateFromXpm(const char **bits) ;
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const ;
|
|
||||||
|
|
||||||
void MacInstall() const ;
|
void MacInstall() const ;
|
||||||
|
|
||||||
void SetHCURSOR(WXHCURSOR cursor);
|
void SetHCURSOR(WXHCURSOR cursor);
|
||||||
inline WXHCURSOR GetHCURSOR() const ;
|
WXHCURSOR GetHCURSOR() const;
|
||||||
private :
|
|
||||||
|
private:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
void CreateFromImage(const wxImage & image) ;
|
void CreateFromImage(const wxImage & image) ;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
||||||
|
|
||||||
#endif
|
#endif // _WX_CURSOR_H_
|
||||||
// _WX_CURSOR_H_
|
|
||||||
|
@@ -52,11 +52,11 @@ public:
|
|||||||
|
|
||||||
bool MacCreateFromThemeFont( wxUint16 themeFontID ) ;
|
bool MacCreateFromThemeFont( wxUint16 themeFontID ) ;
|
||||||
#if wxMAC_USE_CORE_TEXT
|
#if wxMAC_USE_CORE_TEXT
|
||||||
bool MacCreateFromUIFont( wxUint32 coreTextFontType );
|
bool MacCreateFromUIFont( wxUint32 coreTextFontType );
|
||||||
bool MacCreateFromCTFontDescriptor( const void * ctFontDescriptor, int pointSize = 0 );
|
bool MacCreateFromCTFontDescriptor( const void * ctFontDescriptor, int pointSize = 0 );
|
||||||
bool MacCreateFromCTFont( const void * ctFont );
|
bool MacCreateFromCTFont( const void * ctFont );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
virtual ~wxFont();
|
virtual ~wxFont();
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
@@ -88,13 +88,13 @@ public:
|
|||||||
virtual bool GetNoAntiAliasing() const ;
|
virtual bool GetNoAntiAliasing() const ;
|
||||||
|
|
||||||
// Mac-specific, risks to change, don't use in portable code
|
// Mac-specific, risks to change, don't use in portable code
|
||||||
|
|
||||||
#if wxMAC_USE_ATSU_TEXT
|
#if wxMAC_USE_ATSU_TEXT
|
||||||
// 'old' Quickdraw accessors
|
// 'old' Quickdraw accessors
|
||||||
short MacGetFontNum() const;
|
short MacGetFontNum() const;
|
||||||
short MacGetFontSize() const;
|
short MacGetFontSize() const;
|
||||||
wxByte MacGetFontStyle() const;
|
wxByte MacGetFontStyle() const;
|
||||||
|
|
||||||
// 'new' ATSUI accessors
|
// 'new' ATSUI accessors
|
||||||
wxUint32 MacGetATSUFontID() const;
|
wxUint32 MacGetATSUFontID() const;
|
||||||
wxUint32 MacGetATSUAdditionalQDStyles() const;
|
wxUint32 MacGetATSUAdditionalQDStyles() const;
|
||||||
@@ -107,14 +107,17 @@ public:
|
|||||||
const void * MacGetCTFontDescriptor() const;
|
const void * MacGetCTFontDescriptor() const;
|
||||||
#endif
|
#endif
|
||||||
#if wxMAC_USE_CORE_TEXT || wxMAC_USE_ATSU_TEXT
|
#if wxMAC_USE_CORE_TEXT || wxMAC_USE_ATSU_TEXT
|
||||||
void* MacGetATSUStyle() const ;
|
void* MacGetATSUStyle() const ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Unshare();
|
void Unshare();
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_FONT_H_
|
||||||
// _WX_FONT_H_
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
// Icon
|
// Icon
|
||||||
class WXDLLEXPORT wxIcon: public wxGDIObject
|
class WXDLLEXPORT wxIcon : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxIcon();
|
wxIcon();
|
||||||
@@ -45,8 +45,6 @@ public:
|
|||||||
// ctors, assignment operators...), but it's ok to have such function
|
// ctors, assignment operators...), but it's ok to have such function
|
||||||
void CopyFromBitmap(const wxBitmap& bmp);
|
void CopyFromBitmap(const wxBitmap& bmp);
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
int GetWidth() const;
|
int GetWidth() const;
|
||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
int GetDepth() const;
|
int GetDepth() const;
|
||||||
@@ -57,6 +55,11 @@ public:
|
|||||||
|
|
||||||
WXHICON GetHICON() const ;
|
WXHICON GetHICON() const ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -37,9 +37,8 @@ class wxMetafileRefData ;
|
|||||||
|
|
||||||
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
||||||
|
|
||||||
class WXDLLEXPORT wxMetafile: public wxGDIObject
|
class WXDLLEXPORT wxMetafile : public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMetafile)
|
|
||||||
public:
|
public:
|
||||||
wxMetafile(const wxString& file = wxEmptyString);
|
wxMetafile(const wxString& file = wxEmptyString);
|
||||||
virtual ~wxMetafile(void);
|
virtual ~wxMetafile(void);
|
||||||
@@ -49,8 +48,6 @@ public:
|
|||||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||||
|
|
||||||
virtual bool Play(wxDC *dc);
|
virtual bool Play(wxDC *dc);
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const ;
|
|
||||||
|
|
||||||
wxSize GetSize() const;
|
wxSize GetSize() const;
|
||||||
int GetWidth() const { return GetSize().x; }
|
int GetWidth() const { return GetSize().x; }
|
||||||
@@ -65,6 +62,12 @@ public:
|
|||||||
// backwards compatibility
|
// backwards compatibility
|
||||||
void SetPICT(void* pictHandle) ;
|
void SetPICT(void* pictHandle) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMetafile)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -89,7 +92,7 @@ protected:
|
|||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
|
|
||||||
wxMetafile* m_metaFile;
|
wxMetafile* m_metaFile;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_CLASS(wxMetafileDCImpl)
|
DECLARE_CLASS(wxMetafileDCImpl)
|
||||||
DECLARE_NO_COPY_CLASS(wxMetafileDCImpl)
|
DECLARE_NO_COPY_CLASS(wxMetafileDCImpl)
|
||||||
@@ -105,19 +108,19 @@ class WXDLLEXPORT wxMetafileDC: public wxDC
|
|||||||
const wxString& description = wxEmptyString ) :
|
const wxString& description = wxEmptyString ) :
|
||||||
wxDC( new wxMetafileDCImpl( this, filename, width, height, description) )
|
wxDC( new wxMetafileDCImpl( this, filename, width, height, description) )
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
wxMetafile *GetMetafile() const
|
wxMetafile *GetMetafile() const
|
||||||
{ return ((wxMetafileDCImpl*)m_pimpl)->GetMetaFile(); }
|
{ return ((wxMetafileDCImpl*)m_pimpl)->GetMetaFile(); }
|
||||||
|
|
||||||
wxMetafile *Close()
|
wxMetafile *Close()
|
||||||
{ return ((wxMetafileDCImpl*)m_pimpl)->Close(); }
|
{ return ((wxMetafileDCImpl*)m_pimpl)->Close(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_CLASS(wxMetafileDC)
|
DECLARE_CLASS(wxMetafileDC)
|
||||||
DECLARE_NO_COPY_CLASS(wxMetafileDC)
|
DECLARE_NO_COPY_CLASS(wxMetafileDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pass filename of existing non-placeable metafile, and bounding box.
|
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||||
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||||
@@ -141,7 +144,7 @@ class WXDLLEXPORT wxMetafileDataObject : public wxDataObjectSimple
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// ctors
|
// ctors
|
||||||
wxMetafileDataObject()
|
wxMetafileDataObject()
|
||||||
: wxDataObjectSimple(wxDF_METAFILE) { };
|
: wxDataObjectSimple(wxDF_METAFILE) { };
|
||||||
wxMetafileDataObject(const wxMetafile& metafile)
|
wxMetafileDataObject(const wxMetafile& metafile)
|
||||||
: wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { }
|
: wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { }
|
||||||
|
@@ -12,27 +12,11 @@
|
|||||||
#ifndef _WX_PALETTE_H_
|
#ifndef _WX_PALETTE_H_
|
||||||
#define _WX_PALETTE_H_
|
#define _WX_PALETTE_H_
|
||||||
|
|
||||||
#include "wx/colour.h"
|
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
|
||||||
{
|
|
||||||
DECLARE_NO_COPY_CLASS(wxPaletteRefData)
|
|
||||||
|
|
||||||
friend class WXDLLIMPEXP_FWD_CORE wxPalette;
|
|
||||||
public:
|
|
||||||
wxPaletteRefData();
|
|
||||||
virtual ~wxPaletteRefData();
|
|
||||||
protected:
|
|
||||||
wxColour* m_palette;
|
|
||||||
wxInt32 m_count ;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
||||||
|
|
||||||
class WXDLLEXPORT wxPalette: public wxPaletteBase
|
class WXDLLEXPORT wxPalette : public wxPaletteBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPalette();
|
wxPalette();
|
||||||
@@ -40,18 +24,18 @@ public:
|
|||||||
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
virtual ~wxPalette();
|
virtual ~wxPalette();
|
||||||
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
|
|
||||||
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
||||||
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const { return (m_refData != NULL) ; }
|
|
||||||
|
|
||||||
virtual int GetColoursCount() const;
|
virtual int GetColoursCount() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_PALETTE_H_
|
||||||
// _WX_PALETTE_H_
|
|
||||||
|
@@ -16,48 +16,51 @@
|
|||||||
#include "wx/colour.h"
|
#include "wx/colour.h"
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxPen;
|
|
||||||
|
|
||||||
// Pen
|
// Pen
|
||||||
class WXDLLEXPORT wxPen: public wxGDIObject
|
class WXDLLEXPORT wxPen : public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
|
||||||
public:
|
public:
|
||||||
wxPen();
|
wxPen();
|
||||||
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
|
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
|
||||||
wxPen(const wxBitmap& stipple, int width);
|
wxPen(const wxBitmap& stipple, int width);
|
||||||
virtual ~wxPen();
|
virtual ~wxPen();
|
||||||
|
|
||||||
bool operator == (const wxPen& pen) const;
|
bool operator==(const wxPen& pen) const;
|
||||||
bool operator != (const wxPen& pen) const { return !(*this == pen); }
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
// Override in order to recreate the pen
|
// Override in order to recreate the pen
|
||||||
void SetColour(const wxColour& col) ;
|
void SetColour(const wxColour& col) ;
|
||||||
void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||||
|
|
||||||
void SetWidth(int width) ;
|
void SetWidth(int width) ;
|
||||||
void SetStyle(int style) ;
|
void SetStyle(int style) ;
|
||||||
void SetStipple(const wxBitmap& stipple) ;
|
void SetStipple(const wxBitmap& stipple) ;
|
||||||
void SetDashes(int nb_dashes, const wxDash *dash) ;
|
void SetDashes(int nb_dashes, const wxDash *dash) ;
|
||||||
void SetJoin(int join) ;
|
void SetJoin(int join) ;
|
||||||
void SetCap(int cap) ;
|
void SetCap(int cap) ;
|
||||||
|
|
||||||
wxColour& GetColour() const ;
|
wxColour& GetColour() const ;
|
||||||
int GetWidth() const;
|
int GetWidth() const;
|
||||||
int GetStyle() const;
|
int GetStyle() const;
|
||||||
int GetJoin() const;
|
int GetJoin() const;
|
||||||
int GetCap() const;
|
int GetCap() const;
|
||||||
int GetDashes(wxDash **ptr) const;
|
int GetDashes(wxDash **ptr) const;
|
||||||
|
|
||||||
wxBitmap *GetStipple() const ;
|
wxBitmap *GetStipple() const ;
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
|
||||||
// Useful helper: create the brush resource
|
// Useful helper: create the brush resource
|
||||||
bool RealizeResource();
|
bool RealizeResource();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Unshare();
|
void Unshare();
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -43,6 +43,9 @@ public:
|
|||||||
const WXHRGN GetWXHRGN() const ;
|
const WXHRGN GetWXHRGN() const ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
||||||
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
|
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
|
||||||
|
@@ -38,8 +38,6 @@ public:
|
|||||||
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
|
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
|
||||||
wxBitmap(const wxImage& image, int depth = -1);
|
wxBitmap(const wxImage& image, int depth = -1);
|
||||||
virtual ~wxBitmap() {}
|
virtual ~wxBitmap() {}
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
bool Create(int width, int height, int depth = -1);
|
bool Create(int width, int height, int depth = -1);
|
||||||
|
|
||||||
|
@@ -27,17 +27,15 @@ class WXDLLIMPEXP_FWD_CORE wxBrush;
|
|||||||
// wxBrush
|
// wxBrush
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxBrush: public wxBrushBase
|
class WXDLLEXPORT wxBrush : public wxBrushBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxBrush() {}
|
wxBrush() {}
|
||||||
wxBrush(const wxColour &colour, int style = wxSOLID);
|
wxBrush(const wxColour &colour, int style = wxSOLID);
|
||||||
wxBrush(const wxBitmap &stippleBitmap);
|
wxBrush(const wxBitmap &stippleBitmap);
|
||||||
virtual ~wxBrush() {}
|
|
||||||
bool operator == (const wxBrush& brush) const;
|
bool operator==(const wxBrush& brush) const;
|
||||||
bool operator != (const wxBrush& brush) const;
|
bool operator!=(const wxBrush& brush) const;
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxColour &GetColour() const;
|
wxColour &GetColour() const;
|
||||||
@@ -54,9 +52,8 @@ public:
|
|||||||
void* GetPixPattern() const;
|
void* GetPixPattern() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
|
@@ -10,8 +10,7 @@
|
|||||||
#ifndef __WX_CURSOR_H__
|
#ifndef __WX_CURSOR_H__
|
||||||
#define __WX_CURSOR_H__
|
#define __WX_CURSOR_H__
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
class MGLCursor;
|
class MGLCursor;
|
||||||
@@ -20,7 +19,7 @@ class MGLCursor;
|
|||||||
// wxCursor
|
// wxCursor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxCursor: public wxObject
|
class WXDLLEXPORT wxCursor : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -33,8 +32,6 @@ public:
|
|||||||
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
||||||
int hotSpotX = 0, int hotSpotY = 0);
|
int hotSpotX = 0, int hotSpotY = 0);
|
||||||
virtual ~wxCursor();
|
virtual ~wxCursor();
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
MGLCursor *GetMGLCursor() const;
|
MGLCursor *GetMGLCursor() const;
|
||||||
|
@@ -87,8 +87,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
// ref counting code
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
|
@@ -27,16 +27,12 @@ struct palette_t;
|
|||||||
// wxPalette
|
// wxPalette
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxPalette: public wxPaletteBase
|
class WXDLLEXPORT wxPalette : public wxPaletteBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxPalette();
|
wxPalette();
|
||||||
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
virtual ~wxPalette();
|
virtual ~wxPalette();
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const;
|
|
||||||
|
|
||||||
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
||||||
@@ -46,6 +42,8 @@ public:
|
|||||||
virtual int GetColoursCount() const;
|
virtual int GetColoursCount() const;
|
||||||
|
|
||||||
palette_t *GetMGLpalette_t() const;
|
palette_t *GetMGLpalette_t() const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __WX_PALETTE_H__
|
#endif // __WX_PALETTE_H__
|
||||||
|
@@ -27,7 +27,7 @@ class WXDLLIMPEXP_FWD_CORE wxPen;
|
|||||||
// wxPen
|
// wxPen
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxPen: public wxGDIObject
|
class WXDLLEXPORT wxPen : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPen() {}
|
wxPen() {}
|
||||||
@@ -56,16 +56,12 @@ public:
|
|||||||
wxDash* GetDash() const;
|
wxDash* GetDash() const;
|
||||||
wxBitmap *GetStipple() const;
|
wxBitmap *GetStipple() const;
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
// implementation:
|
// implementation:
|
||||||
void* GetPixPattern() const;
|
void* GetPixPattern() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
|
@@ -44,9 +44,8 @@ public:
|
|||||||
const MGLRegion& GetMGLRegion() const;
|
const MGLRegion& GetMGLRegion() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
// wxRegionBase pure virtuals
|
// wxRegionBase pure virtuals
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool IsOk() const {return m_isInit; }
|
virtual bool IsOk() const {return m_isInit; }
|
||||||
unsigned char Red() const { return m_red; }
|
unsigned char Red() const { return m_red; }
|
||||||
unsigned char Green() const { return m_green; }
|
unsigned char Green() const { return m_green; }
|
||||||
unsigned char Blue() const { return m_blue; }
|
unsigned char Blue() const { return m_blue; }
|
||||||
|
@@ -12,16 +12,14 @@
|
|||||||
#ifndef _WX_CURSOR_H_
|
#ifndef _WX_CURSOR_H_
|
||||||
#define _WX_CURSOR_H_
|
#define _WX_CURSOR_H_
|
||||||
|
|
||||||
#include "wx/object.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxImage;
|
class WXDLLIMPEXP_FWD_CORE wxImage;
|
||||||
|
|
||||||
// Cursor
|
// Cursor
|
||||||
class WXDLLEXPORT wxCursor: public wxObject
|
class WXDLLEXPORT wxCursor : public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxCursor();
|
wxCursor();
|
||||||
|
|
||||||
@@ -39,12 +37,14 @@ public:
|
|||||||
wxCursor(wxStockCursor id);
|
wxCursor(wxStockCursor id);
|
||||||
virtual ~wxCursor();
|
virtual ~wxCursor();
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const;
|
|
||||||
|
|
||||||
// Motif-specific.
|
// Motif-specific.
|
||||||
// Create/get a cursor for the current display
|
// Create/get a cursor for the current display
|
||||||
WXCursor GetXCursor(WXDisplay* display) const;
|
WXCursor GetXCursor(WXDisplay* display) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Create(const char bits[], int width, int height,
|
void Create(const char bits[], int width, int height,
|
||||||
int hotSpotX = -1, int hotSpotY = -1,
|
int hotSpotX = -1, int hotSpotY = -1,
|
||||||
@@ -53,6 +53,8 @@ private:
|
|||||||
|
|
||||||
// Make a cursor from standard id
|
// Make a cursor from standard id
|
||||||
WXCursor MakeCursor(WXDisplay* display, wxStockCursor id) const;
|
WXCursor MakeCursor(WXDisplay* display, wxStockCursor id) const;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
||||||
|
@@ -107,7 +107,11 @@ public:
|
|||||||
// like the function above but does a copy for XmFontList
|
// like the function above but does a copy for XmFontList
|
||||||
WXFontType GetFontTypeC(WXDisplay* display) const;
|
WXFontType GetFontTypeC(WXDisplay* display) const;
|
||||||
static WXString GetFontTag();
|
static WXString GetFontTag();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
|
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
|
||||||
|
|
||||||
void Unshare();
|
void Unshare();
|
||||||
@@ -116,5 +120,4 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_FONT_H_
|
||||||
// _WX_FONT_H_
|
|
||||||
|
@@ -176,7 +176,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxGDIImageRefData *CreateData() const;
|
virtual wxGDIImageRefData *CreateData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
// creates an uninitialized bitmap, called from Create()s above
|
// creates an uninitialized bitmap, called from Create()s above
|
||||||
bool DoCreate(int w, int h, int depth, WXHDC hdc);
|
bool DoCreate(int w, int h, int depth, WXHDC hdc);
|
||||||
|
@@ -42,19 +42,15 @@ public:
|
|||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxBitmap *GetStipple() const;
|
wxBitmap *GetStipple() const;
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
|
||||||
|
|
||||||
// return the HBRUSH for this brush
|
// return the HBRUSH for this brush
|
||||||
virtual WXHANDLE GetResourceHandle() const;
|
virtual WXHANDLE GetResourceHandle() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_BRUSH_H_
|
||||||
// _WX_BRUSH_H_
|
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
// accessors
|
// accessors
|
||||||
// ---------
|
// ---------
|
||||||
|
|
||||||
bool IsOk() const { return m_isInit; }
|
virtual bool IsOk() const { return m_isInit; }
|
||||||
|
|
||||||
unsigned char Red() const { return m_red; }
|
unsigned char Red() const { return m_red; }
|
||||||
unsigned char Green() const { return m_green; }
|
unsigned char Green() const { return m_green; }
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#define _WX_MSW_ENHMETA_H_
|
#define _WX_MSW_ENHMETA_H_
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
#include "wx/dataobj.h"
|
#include "wx/dataobj.h"
|
||||||
@@ -22,12 +23,12 @@
|
|||||||
// wxEnhMetaFile: encapsulation of Win32 HENHMETAFILE
|
// wxEnhMetaFile: encapsulation of Win32 HENHMETAFILE
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxEnhMetaFile : public wxObject
|
class WXDLLEXPORT wxEnhMetaFile : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxEnhMetaFile(const wxString& file = wxEmptyString) : m_filename(file)
|
wxEnhMetaFile(const wxString& file = wxEmptyString) : m_filename(file)
|
||||||
{ Init(); }
|
{ Init(); }
|
||||||
wxEnhMetaFile(const wxEnhMetaFile& metafile) : wxObject()
|
wxEnhMetaFile(const wxEnhMetaFile& metafile) : wxGDIObject()
|
||||||
{ Init(); Assign(metafile); }
|
{ Init(); Assign(metafile); }
|
||||||
wxEnhMetaFile& operator=(const wxEnhMetaFile& metafile)
|
wxEnhMetaFile& operator=(const wxEnhMetaFile& metafile)
|
||||||
{ Free(); Assign(metafile); return *this; }
|
{ Free(); Assign(metafile); return *this; }
|
||||||
@@ -39,8 +40,7 @@ public:
|
|||||||
bool Play(wxDC *dc, wxRect *rectBound = (wxRect *)NULL);
|
bool Play(wxDC *dc, wxRect *rectBound = (wxRect *)NULL);
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool Ok() const { return IsOk(); }
|
virtual bool IsOk() const { return m_hMF != 0; }
|
||||||
bool IsOk() const { return m_hMF != 0; }
|
|
||||||
|
|
||||||
wxSize GetSize() const;
|
wxSize GetSize() const;
|
||||||
int GetWidth() const { return GetSize().x; }
|
int GetWidth() const { return GetSize().x; }
|
||||||
@@ -62,6 +62,11 @@ protected:
|
|||||||
void Free();
|
void Free();
|
||||||
void Assign(const wxEnhMetaFile& mf);
|
void Assign(const wxEnhMetaFile& mf);
|
||||||
|
|
||||||
|
// we don't use these functions (but probably should) but have to implement
|
||||||
|
// them as they're pure virtual in the base class
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_filename;
|
wxString m_filename;
|
||||||
WXHANDLE m_hMF;
|
WXHANDLE m_hMF;
|
||||||
|
@@ -135,8 +135,8 @@ protected:
|
|||||||
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
|
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
|
||||||
|
|
||||||
// implement wxObject virtuals which are used by AllocExclusive()
|
// implement wxObject virtuals which are used by AllocExclusive()
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
|
@@ -51,7 +51,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool IsOk() const { return m_handle != 0; }
|
virtual bool IsOk() const { return m_handle != 0; }
|
||||||
|
|
||||||
void SetSize(int w, int h) { m_width = w; m_height = h; }
|
void SetSize(int w, int h) { m_width = w; m_height = h; }
|
||||||
|
|
||||||
@@ -154,9 +154,6 @@ public:
|
|||||||
void SetHandle(WXHANDLE handle)
|
void SetHandle(WXHANDLE handle)
|
||||||
{ AllocExclusive(); GetGDIImageData()->m_handle = handle; }
|
{ AllocExclusive(); GetGDIImageData()->m_handle = handle; }
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return GetHandle() != 0; }
|
|
||||||
|
|
||||||
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; }
|
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; }
|
||||||
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; }
|
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; }
|
||||||
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; }
|
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; }
|
||||||
@@ -180,8 +177,17 @@ protected:
|
|||||||
// create the data for the derived class here
|
// create the data for the derived class here
|
||||||
virtual wxGDIImageRefData *CreateData() const = 0;
|
virtual wxGDIImageRefData *CreateData() const = 0;
|
||||||
|
|
||||||
// implement the wxObject method in terms of our, more specific, one
|
// implement the wxGDIObject method in terms of our, more specific, one
|
||||||
virtual wxObjectRefData *CreateRefData() const { return CreateData(); }
|
virtual wxGDIRefData *CreateGDIRefData() const { return CreateData(); }
|
||||||
|
|
||||||
|
// we can't [efficiently] clone objects of this class
|
||||||
|
virtual wxGDIRefData *
|
||||||
|
CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( _T("must be implemented if used") );
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static wxGDIImageHandlerList ms_handlers;
|
static wxGDIImageHandlerList ms_handlers;
|
||||||
};
|
};
|
||||||
|
@@ -27,15 +27,18 @@ class WXDLLIMPEXP_FWD_CORE wxMetafile;
|
|||||||
|
|
||||||
class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData
|
class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData
|
||||||
{
|
{
|
||||||
friend class WXDLLIMPEXP_FWD_CORE wxMetafile;
|
|
||||||
public:
|
public:
|
||||||
wxMetafileRefData();
|
wxMetafileRefData();
|
||||||
virtual ~wxMetafileRefData();
|
virtual ~wxMetafileRefData();
|
||||||
|
|
||||||
|
virtual bool IsOk() const { return m_metafile != 0; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WXHANDLE m_metafile;
|
WXHANDLE m_metafile;
|
||||||
int m_windowsMappingMode;
|
int m_windowsMappingMode;
|
||||||
int m_width, m_height;
|
int m_width, m_height;
|
||||||
|
|
||||||
|
friend class WXDLLIMPEXP_FWD_CORE wxMetafile;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
||||||
@@ -51,8 +54,6 @@ public:
|
|||||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||||
|
|
||||||
virtual bool Play(wxDC *dc);
|
virtual bool Play(wxDC *dc);
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
|
|
||||||
|
|
||||||
// set/get the size of metafile for clipboard operations
|
// set/get the size of metafile for clipboard operations
|
||||||
wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); }
|
wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); }
|
||||||
@@ -96,6 +97,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
|
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
int m_windowsMappingMode;
|
int m_windowsMappingMode;
|
||||||
wxMetafile* m_metaFile;
|
wxMetafile* m_metaFile;
|
||||||
|
|
||||||
|
@@ -14,45 +14,38 @@
|
|||||||
|
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
class WXDLLEXPORT wxPalette : public wxPaletteBase
|
||||||
|
|
||||||
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
|
||||||
{
|
|
||||||
friend class WXDLLIMPEXP_FWD_CORE wxPalette;
|
|
||||||
public:
|
|
||||||
wxPaletteRefData(void);
|
|
||||||
virtual ~wxPaletteRefData(void);
|
|
||||||
protected:
|
|
||||||
WXHPALETTE m_hPalette;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxPalette: public wxPaletteBase
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPalette();
|
wxPalette() { }
|
||||||
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
wxPalette(int n,
|
||||||
virtual ~wxPalette(void);
|
unsigned char *red, unsigned char *green, unsigned char *blue)
|
||||||
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
{
|
||||||
|
Create(n, red, green, blue);
|
||||||
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
}
|
||||||
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
|
||||||
|
bool Create(int n,
|
||||||
|
unsigned char *red, unsigned char *green, unsigned char *blue);
|
||||||
|
|
||||||
virtual int GetColoursCount() const;
|
virtual int GetColoursCount() const;
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
int
|
||||||
virtual bool IsOk(void) const { return (m_refData != NULL) ; }
|
GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
||||||
|
|
||||||
virtual bool FreeResource(bool force = false);
|
bool
|
||||||
|
GetRGB(int pixel,
|
||||||
|
unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||||
|
|
||||||
// implemetation
|
// implemetation
|
||||||
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
WXHPALETTE GetHPALETTE() const;
|
||||||
void SetHPALETTE(WXHPALETTE pal);
|
void SetHPALETTE(WXHPALETTE pal);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_PALETTE_H_
|
||||||
// _WX_PALETTE_H_
|
|
||||||
|
@@ -30,9 +30,6 @@ public:
|
|||||||
bool operator==(const wxPen& pen) const;
|
bool operator==(const wxPen& pen) const;
|
||||||
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const { return (m_refData != NULL); }
|
|
||||||
|
|
||||||
// Override in order to recreate the pen
|
// Override in order to recreate the pen
|
||||||
void SetColour(const wxColour& col);
|
void SetColour(const wxColour& col);
|
||||||
void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
||||||
@@ -61,8 +58,8 @@ public:
|
|||||||
virtual bool IsFree() const;
|
virtual bool IsFree() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData* CreateRefData() const;
|
virtual wxGDIRefData* CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const;
|
virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
|
||||||
|
|
||||||
// same as FreeResource() + RealizeResource()
|
// same as FreeResource() + RealizeResource()
|
||||||
bool Recreate();
|
bool Recreate();
|
||||||
|
@@ -43,8 +43,8 @@ public:
|
|||||||
WXHRGN GetHRGN() const;
|
WXHRGN GetHRGN() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
||||||
|
@@ -216,9 +216,8 @@ protected:
|
|||||||
|
|
||||||
bool CreateFromImage(const wxImage& image, int depth);
|
bool CreateFromImage(const wxImage& image, int depth);
|
||||||
|
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool CopyFromIconOrCursor(const wxGDIImage& rIcon);
|
bool CopyFromIconOrCursor(const wxGDIImage& rIcon);
|
||||||
|
@@ -68,9 +68,6 @@ public:
|
|||||||
inline wxBitmap* GetStipple(void) const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_vStipple : 0); };
|
inline wxBitmap* GetStipple(void) const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_vStipple : 0); };
|
||||||
inline int GetPS(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_hBrush : 0); };
|
inline int GetPS(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_hBrush : 0); };
|
||||||
|
|
||||||
inline virtual bool Ok() const { return IsOk(); }
|
|
||||||
inline virtual bool IsOk(void) const { return (m_refData != NULL) ; }
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Implementation
|
// Implementation
|
||||||
//
|
//
|
||||||
|
@@ -34,7 +34,7 @@ public:
|
|||||||
virtual ~wxColour();
|
virtual ~wxColour();
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
bool IsOk(void) const {return m_bIsInit; }
|
virtual bool IsOk(void) const { return m_bIsInit; }
|
||||||
|
|
||||||
unsigned char Red(void) const { return m_cRed; }
|
unsigned char Red(void) const { return m_cRed; }
|
||||||
unsigned char Green(void) const { return m_cGreen; }
|
unsigned char Green(void) const { return m_cGreen; }
|
||||||
|
@@ -41,7 +41,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool IsOk() const
|
virtual bool IsOk() const
|
||||||
{
|
{
|
||||||
if (m_hHandle == 0)
|
if (m_hHandle == 0)
|
||||||
return false;
|
return false;
|
||||||
@@ -187,9 +187,6 @@ public:
|
|||||||
pData->m_hHandle = hHandle;
|
pData->m_hHandle = hHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return GetHandle() != 0; }
|
|
||||||
|
|
||||||
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_nWidth; }
|
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_nWidth; }
|
||||||
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_nHeight; }
|
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_nHeight; }
|
||||||
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_nDepth; }
|
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_nDepth; }
|
||||||
@@ -232,6 +229,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// create the data for the derived class here
|
// create the data for the derived class here
|
||||||
virtual wxGDIImageRefData* CreateData() const = 0;
|
virtual wxGDIImageRefData* CreateData() const = 0;
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const { return CreateData(); }
|
||||||
|
|
||||||
static wxGDIImageHandlerList ms_handlers;
|
static wxGDIImageHandlerList ms_handlers;
|
||||||
};
|
};
|
||||||
|
@@ -39,6 +39,8 @@ public:
|
|||||||
wxMetafileRefData(void);
|
wxMetafileRefData(void);
|
||||||
virtual ~wxMetafileRefData(void);
|
virtual ~wxMetafileRefData(void);
|
||||||
|
|
||||||
|
virtual bool IsOk() const { return m_metafile != 0; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WXHANDLE m_metafile;
|
WXHANDLE m_metafile;
|
||||||
int m_windowsMappingMode;
|
int m_windowsMappingMode;
|
||||||
@@ -58,8 +60,6 @@ public:
|
|||||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||||
|
|
||||||
virtual bool Play(wxDC *dc);
|
virtual bool Play(wxDC *dc);
|
||||||
inline bool Ok() const { return IsOk(); }
|
|
||||||
inline bool IsOk(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
|
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
inline WXHANDLE GetHMETAFILE(void) { return M_METAFILEDATA->m_metafile; }
|
inline WXHANDLE GetHMETAFILE(void) { return M_METAFILEDATA->m_metafile; }
|
||||||
|
@@ -59,9 +59,6 @@ public:
|
|||||||
,unsigned char* pBlue
|
,unsigned char* pBlue
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk(void) const { return (m_refData != NULL) ; }
|
|
||||||
|
|
||||||
virtual bool FreeResource(bool bForce = false);
|
virtual bool FreeResource(bool bForce = false);
|
||||||
|
|
||||||
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
||||||
|
@@ -81,9 +81,6 @@ public:
|
|||||||
inline bool operator != (const wxPen& rPen) const
|
inline bool operator != (const wxPen& rPen) const
|
||||||
{ return !(*this == rPen); }
|
{ return !(*this == rPen); }
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk(void) const { return (m_refData != NULL); }
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Override in order to recreate the pen
|
// Override in order to recreate the pen
|
||||||
//
|
//
|
||||||
|
@@ -64,8 +64,8 @@ public:
|
|||||||
void SetPS(HPS hPS);
|
void SetPS(HPS hPS);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData* CreateData(void) const;
|
virtual wxGDIRefData* CreateData(void) const;
|
||||||
virtual wxObjectRefData* CloneData(const wxObjectRefData* pData) const;
|
virtual wxGDIRefData* CloneData(const wxGDIRefData* pData) const;
|
||||||
|
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
||||||
|
@@ -25,8 +25,6 @@ class WXDLLEXPORT wxPaletteBase: public wxGDIObject
|
|||||||
public:
|
public:
|
||||||
virtual ~wxPaletteBase() { }
|
virtual ~wxPaletteBase() { }
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const = 0;
|
|
||||||
virtual int GetColoursCount() const { wxFAIL_MSG( _T("not implemented") ); return 0; }
|
virtual int GetColoursCount() const { wxFAIL_MSG( _T("not implemented") ); return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -42,19 +42,15 @@ public:
|
|||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxBitmap *GetStipple() const;
|
wxBitmap *GetStipple() const;
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
|
||||||
|
|
||||||
// return the HBRUSH for this brush
|
// return the HBRUSH for this brush
|
||||||
virtual WXHANDLE GetResourceHandle() const;
|
virtual WXHANDLE GetResourceHandle() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_BRUSH_H_
|
||||||
// _WX_BRUSH_H_
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#define _WX_PALMOS_ENHMETA_H_
|
#define _WX_PALMOS_ENHMETA_H_
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
#include "wx/dataobj.h"
|
#include "wx/dataobj.h"
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
// wxEnhMetaFile: encapsulation of Win32 HENHMETAFILE
|
// wxEnhMetaFile: encapsulation of Win32 HENHMETAFILE
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxEnhMetaFile : public wxObject
|
class WXDLLEXPORT wxEnhMetaFile : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxEnhMetaFile(const wxString& file = wxEmptyString) : m_filename(file)
|
wxEnhMetaFile(const wxString& file = wxEmptyString) : m_filename(file)
|
||||||
@@ -39,8 +40,7 @@ public:
|
|||||||
bool Play(wxDC *dc, wxRect *rectBound = (wxRect *)NULL);
|
bool Play(wxDC *dc, wxRect *rectBound = (wxRect *)NULL);
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool Ok() const { return IsOk(); }
|
virtual bool IsOk() const { return m_hMF != 0; }
|
||||||
bool IsOk() const { return m_hMF != 0; }
|
|
||||||
|
|
||||||
wxSize GetSize() const;
|
wxSize GetSize() const;
|
||||||
int GetWidth() const { return GetSize().x; }
|
int GetWidth() const { return GetSize().x; }
|
||||||
|
@@ -41,7 +41,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
bool IsOk() const { return m_handle != 0; }
|
virtual bool IsOk() const { return m_handle != 0; }
|
||||||
|
|
||||||
void SetSize(int w, int h) { m_width = w; m_height = h; }
|
void SetSize(int w, int h) { m_width = w; m_height = h; }
|
||||||
|
|
||||||
@@ -147,9 +147,6 @@ public:
|
|||||||
void SetHandle(WXHANDLE handle)
|
void SetHandle(WXHANDLE handle)
|
||||||
{ EnsureHasData(); GetGDIImageData()->m_handle = handle; }
|
{ EnsureHasData(); GetGDIImageData()->m_handle = handle; }
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return GetHandle() != 0; }
|
|
||||||
|
|
||||||
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; }
|
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; }
|
||||||
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; }
|
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; }
|
||||||
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; }
|
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; }
|
||||||
@@ -172,6 +169,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// create the data for the derived class here
|
// create the data for the derived class here
|
||||||
virtual wxGDIImageRefData *CreateData() const = 0;
|
virtual wxGDIImageRefData *CreateData() const = 0;
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const { return CreateData(); }
|
||||||
|
|
||||||
static wxGDIImageHandlerList ms_handlers;
|
static wxGDIImageHandlerList ms_handlers;
|
||||||
};
|
};
|
||||||
|
@@ -27,15 +27,18 @@ class WXDLLIMPEXP_FWD_CORE wxMetafile;
|
|||||||
|
|
||||||
class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData
|
class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData
|
||||||
{
|
{
|
||||||
friend class WXDLLIMPEXP_FWD_CORE wxMetafile;
|
|
||||||
public:
|
public:
|
||||||
wxMetafileRefData();
|
wxMetafileRefData();
|
||||||
virtual ~wxMetafileRefData();
|
virtual ~wxMetafileRefData();
|
||||||
|
|
||||||
|
virtual bool IsOk() const { return m_metafile != 0; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WXHANDLE m_metafile;
|
WXHANDLE m_metafile;
|
||||||
int m_windowsMappingMode;
|
int m_windowsMappingMode;
|
||||||
int m_width, m_height;
|
int m_width, m_height;
|
||||||
|
|
||||||
|
friend class WXDLLIMPEXP_FWD_CORE wxMetafile;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
#define M_METAFILEDATA ((wxMetafileRefData *)m_refData)
|
||||||
@@ -51,8 +54,6 @@ public:
|
|||||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||||
|
|
||||||
virtual bool Play(wxDC *dc);
|
virtual bool Play(wxDC *dc);
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
|
|
||||||
|
|
||||||
// set/get the size of metafile for clipboard operations
|
// set/get the size of metafile for clipboard operations
|
||||||
wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); }
|
wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); }
|
||||||
|
@@ -41,9 +41,6 @@ public:
|
|||||||
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
||||||
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk(void) const { return (m_refData != NULL) ; }
|
|
||||||
|
|
||||||
virtual bool FreeResource(bool force = false);
|
virtual bool FreeResource(bool force = false);
|
||||||
|
|
||||||
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
||||||
|
@@ -89,9 +89,6 @@ public:
|
|||||||
|
|
||||||
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const { return (m_refData != NULL); }
|
|
||||||
|
|
||||||
// Override in order to recreate the pen
|
// Override in order to recreate the pen
|
||||||
void SetColour(const wxColour& col);
|
void SetColour(const wxColour& col);
|
||||||
void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
||||||
|
@@ -44,8 +44,8 @@ public:
|
|||||||
WXHRGN GetHRGN() const;
|
WXHRGN GetHRGN() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
||||||
|
@@ -201,7 +201,7 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
/// wxFontMgrFontRefData implementation using wxFontsManager classes
|
/// wxFontMgrFontRefData implementation using wxFontsManager classes
|
||||||
class wxFontMgrFontRefData : public wxObjectRefData
|
class wxFontMgrFontRefData : public wxGDIRefData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxFontMgrFontRefData(int size = wxDEFAULT,
|
wxFontMgrFontRefData(int size = wxDEFAULT,
|
||||||
|
@@ -82,9 +82,6 @@ public:
|
|||||||
// accessors
|
// accessors
|
||||||
// ---------
|
// ---------
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
|
||||||
|
|
||||||
// Is region empty?
|
// Is region empty?
|
||||||
virtual bool IsEmpty() const = 0;
|
virtual bool IsEmpty() const = 0;
|
||||||
bool Empty() const { return IsEmpty(); }
|
bool Empty() const { return IsEmpty(); }
|
||||||
|
@@ -84,9 +84,6 @@ public:
|
|||||||
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
||||||
virtual ~wxBitmap();
|
virtual ~wxBitmap();
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
static void InitStandardHandlers();
|
static void InitStandardHandlers();
|
||||||
|
|
||||||
bool Create(int width, int height, int depth = -1);
|
bool Create(int width, int height, int depth = -1);
|
||||||
@@ -138,8 +135,8 @@ public:
|
|||||||
WXDisplay *GetDisplay() const;
|
WXDisplay *GetDisplay() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||||
|
@@ -26,7 +26,7 @@ class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
|||||||
// wxBrush
|
// wxBrush
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase
|
class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxBrush() { }
|
wxBrush() { }
|
||||||
@@ -35,11 +35,8 @@ public:
|
|||||||
wxBrush( const wxBitmap &stippleBitmap );
|
wxBrush( const wxBitmap &stippleBitmap );
|
||||||
virtual ~wxBrush();
|
virtual ~wxBrush();
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
bool operator==(const wxBrush& brush) const;
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
|
||||||
|
|
||||||
bool operator == ( const wxBrush& brush ) const;
|
|
||||||
bool operator != (const wxBrush& brush) const { return !(*this == brush); }
|
|
||||||
|
|
||||||
virtual int GetStyle() const;
|
virtual int GetStyle() const;
|
||||||
wxColour &GetColour() const;
|
wxColour &GetColour() const;
|
||||||
@@ -51,12 +48,10 @@ public:
|
|||||||
void SetStipple( const wxBitmap& stipple );
|
void SetStipple( const wxBitmap& stipple );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_BRUSH_H_
|
||||||
// _WX_BRUSH_H_
|
|
||||||
|
@@ -44,10 +44,8 @@ public:
|
|||||||
|
|
||||||
virtual ~wxColour();
|
virtual ~wxColour();
|
||||||
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
bool operator==(const wxColour& col) const;
|
||||||
|
bool operator!=(const wxColour& col) const { return !(*this == col); }
|
||||||
bool operator == ( const wxColour& col ) const;
|
|
||||||
bool operator != ( const wxColour& col ) const { return !(*this == col); }
|
|
||||||
|
|
||||||
unsigned char Red() const;
|
unsigned char Red() const;
|
||||||
unsigned char Green() const;
|
unsigned char Green() const;
|
||||||
@@ -60,9 +58,8 @@ public:
|
|||||||
WXColor *GetColor() const;
|
WXColor *GetColor() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
||||||
@@ -73,6 +70,4 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_COLOUR_H_
|
||||||
|
|
||||||
// _WX_COLOUR_H_
|
|
||||||
|
@@ -12,40 +12,38 @@
|
|||||||
#ifndef _WX_CURSOR_H_
|
#ifndef _WX_CURSOR_H_
|
||||||
#define _WX_CURSOR_H_
|
#define _WX_CURSOR_H_
|
||||||
|
|
||||||
#include "wx/bitmap.h"
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
#if wxUSE_IMAGE
|
class WXDLLIMPEXP_FWD_CORE wxImage;
|
||||||
#include "wx/image.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxCursor
|
// wxCursor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxCursor: public wxObject
|
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxCursor();
|
wxCursor();
|
||||||
wxCursor( int cursorId );
|
wxCursor( int cursorId );
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
wxCursor( const wxImage & image );
|
wxCursor( const wxImage & image );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxCursor( const char bits[], int width, int height,
|
wxCursor( const char bits[], int width, int height,
|
||||||
int hotSpotX=-1, int hotSpotY=-1,
|
int hotSpotX=-1, int hotSpotY=-1,
|
||||||
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 );
|
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 );
|
||||||
virtual ~wxCursor();
|
virtual ~wxCursor();
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const;
|
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
WXCursor GetCursor() const;
|
WXCursor GetCursor() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // _WX_CURSOR_H_
|
||||||
#endif
|
|
||||||
// _WX_CURSOR_H_
|
|
||||||
|
@@ -101,6 +101,9 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
|
|
||||||
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
|
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
|
||||||
|
|
||||||
void Unshare();
|
void Unshare();
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
#ifndef _WX_PALETTE_H_
|
#ifndef _WX_PALETTE_H_
|
||||||
#define _WX_PALETTE_H_
|
#define _WX_PALETTE_H_
|
||||||
|
|
||||||
#include "wx/gdiobj.h"
|
|
||||||
#include "wx/list.h"
|
#include "wx/list.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
||||||
@@ -45,7 +44,7 @@ protected:
|
|||||||
|
|
||||||
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
||||||
|
|
||||||
class WXDLLEXPORT wxPalette: public wxPaletteBase
|
class WXDLLEXPORT wxPalette : public wxPaletteBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||||
|
|
||||||
@@ -58,16 +57,16 @@ public:
|
|||||||
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
||||||
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||||
|
|
||||||
virtual bool Ok() const { return IsOk(); }
|
|
||||||
virtual bool IsOk() const { return (m_refData != NULL) ; }
|
|
||||||
|
|
||||||
// X-specific
|
// X-specific
|
||||||
WXColormap GetXColormap(WXDisplay* display = NULL) const;
|
WXColormap GetXColormap(WXDisplay* display = NULL) const;
|
||||||
bool TransferBitmap(void *data, int depth, int size);
|
bool TransferBitmap(void *data, int depth, int size);
|
||||||
bool TransferBitmap8(unsigned char *data, unsigned long size, void *dest, unsigned int bpp);
|
bool TransferBitmap8(unsigned char *data, unsigned long size, void *dest, unsigned int bpp);
|
||||||
unsigned long *GetXPixArray(WXDisplay* display, int *pix_array_n);
|
unsigned long *GetXPixArray(WXDisplay* display, int *pix_array_n);
|
||||||
void PutXColormap(WXDisplay* display, WXColormap cmap, bool destroyable);
|
void PutXColormap(WXDisplay* display, WXColormap cmap, bool destroyable);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_PALETTE_H_
|
||||||
// _WX_PALETTE_H_
|
|
||||||
|
@@ -38,9 +38,6 @@ public:
|
|||||||
wxPen( const wxBitmap &stipple, int width );
|
wxPen( const wxBitmap &stipple, int width );
|
||||||
virtual ~wxPen();
|
virtual ~wxPen();
|
||||||
|
|
||||||
bool Ok() const { return IsOk(); }
|
|
||||||
bool IsOk() const { return m_refData != NULL; }
|
|
||||||
|
|
||||||
bool operator == ( const wxPen& pen ) const;
|
bool operator == ( const wxPen& pen ) const;
|
||||||
bool operator != (const wxPen& pen) const { return !(*this == pen); }
|
bool operator != (const wxPen& pen) const { return !(*this == pen); }
|
||||||
|
|
||||||
@@ -64,12 +61,10 @@ public:
|
|||||||
wxBitmap* GetStipple() const;
|
wxBitmap* GetStipple() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_PEN_H_
|
||||||
// _WX_PEN_H_
|
|
||||||
|
@@ -61,9 +61,8 @@ public:
|
|||||||
WXRegion *GetX11Region() const;
|
WXRegion *GetX11Region() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ref counting code
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
virtual wxObjectRefData *CreateRefData() const;
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
|
||||||
|
|
||||||
// wxRegionBase pure virtuals
|
// wxRegionBase pure virtuals
|
||||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||||
|
@@ -46,6 +46,8 @@ public:
|
|||||||
wxBitmapRefData( const wxBitmapRefData& data );
|
wxBitmapRefData( const wxBitmapRefData& data );
|
||||||
virtual ~wxBitmapRefData();
|
virtual ~wxBitmapRefData();
|
||||||
|
|
||||||
|
virtual bool IsOk() const { return m_ok; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_width;
|
int m_width;
|
||||||
int m_height;
|
int m_height;
|
||||||
@@ -145,12 +147,12 @@ wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
|
|||||||
LoadFile(filename, type);
|
LoadFile(filename, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxBitmap::CreateRefData() const
|
wxGDIRefData *wxBitmap::CreateGDIRefData() const
|
||||||
{
|
{
|
||||||
return new wxBitmapRefData;
|
return new wxBitmapRefData;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *data) const
|
wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const
|
||||||
{
|
{
|
||||||
return new wxBitmapRefData(*(wxBitmapRefData*)data);
|
return new wxBitmapRefData(*(wxBitmapRefData*)data);
|
||||||
}
|
}
|
||||||
@@ -254,11 +256,6 @@ void wxBitmap::SetMask(wxMask *mask)
|
|||||||
M_BITMAPDATA->m_bitmapMask = mask ;
|
M_BITMAPDATA->m_bitmapMask = mask ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxBitmap::IsOk() const
|
|
||||||
{
|
|
||||||
return m_refData && M_BITMAPDATA->m_ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxPalette* wxBitmap::GetPalette() const
|
wxPalette* wxBitmap::GetPalette() const
|
||||||
{
|
{
|
||||||
if(!m_refData)
|
if(!m_refData)
|
||||||
|
@@ -159,12 +159,12 @@ wxBrush::wxBrush(const wxBitmap& stipple)
|
|||||||
m_refData = new wxBrushRefData(stipple);
|
m_refData = new wxBrushRefData(stipple);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxBrush::CreateRefData() const
|
wxGDIRefData *wxBrush::CreateGDIRefData() const
|
||||||
{
|
{
|
||||||
return new wxBrushRefData;
|
return new wxBrushRefData;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const
|
wxGDIRefData *wxBrush::CloneGDIRefData(const wxGDIRefData *data) const
|
||||||
{
|
{
|
||||||
return new wxBrushRefData(*(wxBrushRefData *)data);
|
return new wxBrushRefData(*(wxBrushRefData *)data);
|
||||||
}
|
}
|
||||||
|
@@ -319,7 +319,7 @@ bool wxFont::Create(wxFontRefData *refData)
|
|||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
m_refData = refData;
|
m_refData = refData;
|
||||||
|
|
||||||
return m_refData != NULL;
|
return m_refData != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,10 +327,20 @@ bool wxFont::Create(const wxNativeFontInfo& nativeFontInfo)
|
|||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
m_refData = new wxFontRefData(nativeFontInfo);
|
m_refData = new wxFontRefData(nativeFontInfo);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxGDIRefData *wxFont::CreateGDIRefData() const
|
||||||
|
{
|
||||||
|
return new wxFontRefData;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
|
||||||
|
{
|
||||||
|
return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
|
||||||
|
}
|
||||||
|
|
||||||
void wxFont::SetEncoding(wxFontEncoding)
|
void wxFont::SetEncoding(wxFontEncoding)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -398,24 +408,9 @@ bool wxFont::RealizeResource()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFont::Unshare()
|
|
||||||
{
|
|
||||||
// Don't change shared data
|
|
||||||
if (!m_refData)
|
|
||||||
{
|
|
||||||
m_refData = new wxFontRefData();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData);
|
|
||||||
UnRef();
|
|
||||||
m_refData = ref;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxFont::SetPointSize(int pointSize)
|
void wxFont::SetPointSize(int pointSize)
|
||||||
{
|
{
|
||||||
Unshare();
|
AllocExclusive();
|
||||||
|
|
||||||
M_FONTDATA->m_info.pointSize = pointSize;
|
M_FONTDATA->m_info.pointSize = pointSize;
|
||||||
|
|
||||||
@@ -424,7 +419,7 @@ void wxFont::SetPointSize(int pointSize)
|
|||||||
|
|
||||||
void wxFont::SetFamily(int family)
|
void wxFont::SetFamily(int family)
|
||||||
{
|
{
|
||||||
Unshare();
|
AllocExclusive();
|
||||||
|
|
||||||
M_FONTDATA->m_info.family = static_cast<wxFontFamily>(family);
|
M_FONTDATA->m_info.family = static_cast<wxFontFamily>(family);
|
||||||
|
|
||||||
@@ -433,7 +428,7 @@ void wxFont::SetFamily(int family)
|
|||||||
|
|
||||||
void wxFont::SetStyle(int style)
|
void wxFont::SetStyle(int style)
|
||||||
{
|
{
|
||||||
Unshare();
|
AllocExclusive();
|
||||||
|
|
||||||
M_FONTDATA->m_info.style = static_cast<wxFontStyle>(style);
|
M_FONTDATA->m_info.style = static_cast<wxFontStyle>(style);
|
||||||
|
|
||||||
@@ -442,7 +437,7 @@ void wxFont::SetStyle(int style)
|
|||||||
|
|
||||||
void wxFont::SetWeight(int weight)
|
void wxFont::SetWeight(int weight)
|
||||||
{
|
{
|
||||||
Unshare();
|
AllocExclusive();
|
||||||
|
|
||||||
M_FONTDATA->m_info.weight = static_cast<wxFontWeight>(weight);
|
M_FONTDATA->m_info.weight = static_cast<wxFontWeight>(weight);
|
||||||
|
|
||||||
@@ -451,7 +446,7 @@ void wxFont::SetWeight(int weight)
|
|||||||
|
|
||||||
bool wxFont::SetFaceName(const wxString& faceName)
|
bool wxFont::SetFaceName(const wxString& faceName)
|
||||||
{
|
{
|
||||||
Unshare();
|
AllocExclusive();
|
||||||
|
|
||||||
M_FONTDATA->m_info.faceName = faceName;
|
M_FONTDATA->m_info.faceName = faceName;
|
||||||
|
|
||||||
@@ -462,7 +457,7 @@ bool wxFont::SetFaceName(const wxString& faceName)
|
|||||||
|
|
||||||
void wxFont::SetUnderlined(bool underlined)
|
void wxFont::SetUnderlined(bool underlined)
|
||||||
{
|
{
|
||||||
Unshare();
|
AllocExclusive();
|
||||||
|
|
||||||
M_FONTDATA->m_info.underlined = underlined;
|
M_FONTDATA->m_info.underlined = underlined;
|
||||||
|
|
||||||
|
@@ -32,6 +32,8 @@ public:
|
|||||||
wxIconRefData( const wxIconRefData& data );
|
wxIconRefData( const wxIconRefData& data );
|
||||||
virtual ~wxIconRefData();
|
virtual ~wxIconRefData();
|
||||||
|
|
||||||
|
virtual bool IsOk() const { return m_ok; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_width;
|
int m_width;
|
||||||
int m_height;
|
int m_height;
|
||||||
@@ -98,6 +100,16 @@ wxIcon::~wxIcon()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxGDIRefData *wxIcon::CreateGDIRefData() const
|
||||||
|
{
|
||||||
|
return new wxIconRefData;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const
|
||||||
|
{
|
||||||
|
return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data));
|
||||||
|
}
|
||||||
|
|
||||||
bool wxIcon::CreateFromXpm(const char **xpm)
|
bool wxIcon::CreateFromXpm(const char **xpm)
|
||||||
{
|
{
|
||||||
wxBitmap bitmap(xpm);
|
wxBitmap bitmap(xpm);
|
||||||
@@ -126,11 +138,6 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
|
|||||||
M_ICONDATA->m_quality = 0;
|
M_ICONDATA->m_quality = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIcon::IsOk() const
|
|
||||||
{
|
|
||||||
return m_refData && M_ICONDATA->m_ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
int wxIcon::GetWidth() const
|
int wxIcon::GetWidth() const
|
||||||
{
|
{
|
||||||
if(!m_refData)
|
if(!m_refData)
|
||||||
|
@@ -266,12 +266,12 @@ wxPen::wxPen(const wxBitmap& stipple, int width)
|
|||||||
m_refData = new wxPenRefData(wxNullColour,width,wxSTIPPLE,stipple);
|
m_refData = new wxPenRefData(wxNullColour,width,wxSTIPPLE,stipple);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxPen::CreateRefData() const
|
wxGDIRefData *wxPen::CreateGDIRefData() const
|
||||||
{
|
{
|
||||||
return new wxPenRefData;
|
return new wxPenRefData;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxPen::CloneRefData(const wxObjectRefData *data) const
|
wxGDIRefData *wxPen::CloneGDIRefData(const wxGDIRefData *data) const
|
||||||
{
|
{
|
||||||
return new wxPenRefData(*(wxPenRefData *)data);
|
return new wxPenRefData(*(wxPenRefData *)data);
|
||||||
}
|
}
|
||||||
|
@@ -341,11 +341,6 @@ bool wxFontBase::operator==(const wxFont& font) const
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFontBase::operator!=(const wxFont& font) const
|
|
||||||
{
|
|
||||||
return !(*this == font);
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString wxFontBase::GetFamilyString() const
|
wxString wxFontBase::GetFamilyString() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") );
|
wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") );
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
|
IMPLEMENT_ABSTRACT_CLASS(wxGDIObject, wxObject)
|
||||||
|
|
||||||
|
|
||||||
WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList;
|
WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList;
|
||||||
|
@@ -51,6 +51,8 @@ class WXDLLEXPORT wxIconBundleRefData : public wxGDIRefData
|
|||||||
public:
|
public:
|
||||||
// default and copy ctors and assignment operators are ok
|
// default and copy ctors and assignment operators are ok
|
||||||
|
|
||||||
|
virtual bool IsOk() const { return !m_icons.empty(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxIconArray m_icons;
|
wxIconArray m_icons;
|
||||||
|
|
||||||
@@ -84,12 +86,12 @@ wxIconBundle::wxIconBundle(const wxIcon& icon)
|
|||||||
AddIcon(icon);
|
AddIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxIconBundle::CreateRefData() const
|
wxGDIRefData *wxIconBundle::CreateGDIRefData() const
|
||||||
{
|
{
|
||||||
return new wxIconBundleRefData;
|
return new wxIconBundleRefData;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObjectRefData *wxIconBundle::CloneRefData(const wxObjectRefData *data) const
|
wxGDIRefData *wxIconBundle::CloneGDIRefData(const wxGDIRefData *data) const
|
||||||
{
|
{
|
||||||
return new wxIconBundleRefData(*wx_static_cast(const wxIconBundleRefData *, data));
|
return new wxIconBundleRefData(*wx_static_cast(const wxIconBundleRefData *, data));
|
||||||
}
|
}
|
||||||
@@ -99,11 +101,6 @@ void wxIconBundle::DeleteIcons()
|
|||||||
UnRef();
|
UnRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIconBundle::IsOk() const
|
|
||||||
{
|
|
||||||
return M_ICONBUNDLEDATA && !M_ICONBUNDLEDATA->m_icons.IsEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxIconBundle::AddIcon(const wxString& file, long type)
|
void wxIconBundle::AddIcon(const wxString& file, long type)
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user