make XPM data pointer parameter fully const
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -78,9 +78,7 @@ Creates an icon from an array of bits.
|
|||||||
|
|
||||||
Creates a new icon.
|
Creates a new icon.
|
||||||
|
|
||||||
\func{}{wxIcon}{\param{char**}{ bits}}
|
\func{}{wxIcon}{\param{const char* const*}{ bits}}
|
||||||
|
|
||||||
\func{}{wxIcon}{\param{const char**}{ bits}}
|
|
||||||
|
|
||||||
Creates an icon from XPM data.
|
Creates an icon from XPM data.
|
||||||
|
|
||||||
|
@@ -23,8 +23,7 @@ class WXDLLEXPORT wxIcon : public wxGDIObject
|
|||||||
public:
|
public:
|
||||||
wxIcon();
|
wxIcon();
|
||||||
|
|
||||||
wxIcon(const char **data) { CreateFromXpm(data); }
|
wxIcon(const char* const* data) { CreateFromXpm(data); }
|
||||||
wxIcon(char **data) { CreateFromXpm((const char**)data); }
|
|
||||||
wxIcon(const char bits[], int width , int height );
|
wxIcon(const char bits[], int width , int height );
|
||||||
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
|
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
|
||||||
int desiredWidth = -1, int desiredHeight = -1);
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
@@ -52,7 +51,7 @@ public:
|
|||||||
int GetHeight() const;
|
int GetHeight() const;
|
||||||
|
|
||||||
WX_NSImage GetNSImage() const;
|
WX_NSImage GetNSImage() const;
|
||||||
bool CreateFromXpm(const char **bits);
|
bool CreateFromXpm(const char* const* bits);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||||
|
@@ -158,16 +158,16 @@ enum wxStockCursor
|
|||||||
#define wxICON(X) wxIcon(wxT(#X))
|
#define wxICON(X) wxIcon(wxT(#X))
|
||||||
#elif defined(__WXMGL__)
|
#elif defined(__WXMGL__)
|
||||||
// Initialize from an included XPM
|
// Initialize from an included XPM
|
||||||
#define wxICON(X) wxIcon( (const char**) X##_xpm )
|
#define wxICON(X) wxIcon( X##_xpm )
|
||||||
#elif defined(__WXDFB__)
|
#elif defined(__WXDFB__)
|
||||||
// Initialize from an included XPM
|
// Initialize from an included XPM
|
||||||
#define wxICON(X) wxIcon( (const char**) X##_xpm )
|
#define wxICON(X) wxIcon( X##_xpm )
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
// Initialize from an included XPM
|
// Initialize from an included XPM
|
||||||
#define wxICON(X) wxIcon( (const char**) X##_xpm )
|
#define wxICON(X) wxIcon( X##_xpm )
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
// Initialize from an included XPM
|
// Initialize from an included XPM
|
||||||
#define wxICON(X) wxIcon( (const char**) X##_xpm )
|
#define wxICON(X) wxIcon( X##_xpm )
|
||||||
#elif defined(__WXMOTIF__)
|
#elif defined(__WXMOTIF__)
|
||||||
// Initialize from an included XPM
|
// Initialize from an included XPM
|
||||||
#define wxICON(X) wxIcon( X##_xpm )
|
#define wxICON(X) wxIcon( X##_xpm )
|
||||||
@@ -193,7 +193,7 @@ enum wxStockCursor
|
|||||||
defined(__WXDFB__) || \
|
defined(__WXDFB__) || \
|
||||||
defined(__WXCOCOA__)
|
defined(__WXCOCOA__)
|
||||||
// Initialize from an included XPM
|
// Initialize from an included XPM
|
||||||
#define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )
|
#define wxBITMAP(name) wxBitmap(name##_xpm)
|
||||||
#else // other platforms
|
#else // other platforms
|
||||||
#define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
|
#define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
|
||||||
#endif // platform
|
#endif // platform
|
||||||
|
@@ -27,8 +27,10 @@ class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
|
|||||||
public:
|
public:
|
||||||
wxIcon();
|
wxIcon();
|
||||||
|
|
||||||
wxIcon( const char **bits, int width=-1, int height=-1 );
|
wxIcon(const char* const* bits);
|
||||||
wxIcon( char **bits, int width=-1, int height=-1 );
|
#ifdef wxNEEDS_CHARPP
|
||||||
|
wxIcon(char **bits);
|
||||||
|
#endif
|
||||||
|
|
||||||
// For compatibility with wxMSW where desired size is sometimes required to
|
// For compatibility with wxMSW where desired size is sometimes required to
|
||||||
// distinguish between multiple icons in a resource.
|
// distinguish between multiple icons in a resource.
|
||||||
|
@@ -25,15 +25,14 @@ public:
|
|||||||
const char maskBits[] = NULL);
|
const char maskBits[] = NULL);
|
||||||
|
|
||||||
wxCursor(const wxImage & image) ;
|
wxCursor(const wxImage & image) ;
|
||||||
wxCursor(const char **bits) ;
|
wxCursor(const char* const* 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* const* bits);
|
||||||
|
|
||||||
void MacInstall() const ;
|
void MacInstall() const ;
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@ class WXDLLIMPEXP_FWD_CORE wxDropSource;
|
|||||||
// the icon 'name' from an XPM file under GTK, but will expand to something
|
// the icon 'name' from an XPM file under GTK, but will expand to something
|
||||||
// else under MSW. If you don't use it, you will have to use #ifdef in the
|
// else under MSW. If you don't use it, you will have to use #ifdef in the
|
||||||
// application code.
|
// application code.
|
||||||
#define wxDROP_ICON(X) wxCursor( (const char**) X##_xpm )
|
#define wxDROP_ICON(X) wxCursor(X##_xpm)
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// wxDropTarget
|
// wxDropTarget
|
||||||
|
@@ -20,8 +20,7 @@ class WXDLLEXPORT wxIcon : public wxGDIObject
|
|||||||
public:
|
public:
|
||||||
wxIcon();
|
wxIcon();
|
||||||
|
|
||||||
wxIcon(const char **data);
|
wxIcon(const char* const* data);
|
||||||
wxIcon(char **data);
|
|
||||||
wxIcon(const char bits[], int width , int height );
|
wxIcon(const char bits[], int width , int height );
|
||||||
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
|
wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE,
|
||||||
int desiredWidth = -1, int desiredHeight = -1);
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
@@ -24,8 +24,10 @@ public:
|
|||||||
wxIcon(const char bits[], int width, int height);
|
wxIcon(const char bits[], int width, int height);
|
||||||
|
|
||||||
// Initialize with XPM data
|
// Initialize with XPM data
|
||||||
wxIcon(const char **data);
|
wxIcon(const char* const* data);
|
||||||
|
#ifdef wxNEEDS_CHARPP
|
||||||
wxIcon(char **data);
|
wxIcon(char **data);
|
||||||
|
#endif
|
||||||
|
|
||||||
wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
||||||
int desiredWidth = -1, int desiredHeight = -1)
|
int desiredWidth = -1, int desiredHeight = -1)
|
||||||
|
@@ -48,10 +48,10 @@ public:
|
|||||||
wxIcon(const char bits[], int width, int height);
|
wxIcon(const char bits[], int width, int height);
|
||||||
|
|
||||||
// from XPM data
|
// from XPM data
|
||||||
wxIcon(const char **data) { CreateIconFromXpm(data); }
|
wxIcon(const char* const* data) { CreateIconFromXpm(data); }
|
||||||
|
#ifdef wxNEEDS_CHARPP
|
||||||
wxIcon(char **data) { CreateIconFromXpm((const char **)data); }
|
wxIcon(char **data) { CreateIconFromXpm(wx_const_cast(const char* const*, data)); }
|
||||||
|
#endif
|
||||||
// from resource/file
|
// from resource/file
|
||||||
wxIcon(const wxString& name,
|
wxIcon(const wxString& name,
|
||||||
long type = wxBITMAP_TYPE_ICO_RESOURCE,
|
long type = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||||
@@ -85,7 +85,7 @@ protected:
|
|||||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
||||||
|
|
||||||
// create from XPM data
|
// create from XPM data
|
||||||
void CreateIconFromXpm(const char **data);
|
void CreateIconFromXpm(const char* const* data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||||
|
@@ -44,8 +44,10 @@ public:
|
|||||||
,int nWidth
|
,int nWidth
|
||||||
,int nHeight
|
,int nHeight
|
||||||
);
|
);
|
||||||
inline wxIcon(const char** ppData) { CreateIconFromXpm(ppData); }
|
wxIcon(const char* const* ppData) { CreateIconFromXpm(ppData); }
|
||||||
inline wxIcon(char** ppData) { CreateIconFromXpm((const char**)ppData); }
|
#ifdef wxNEEDS_CHARPP
|
||||||
|
wxIcon(char** ppData) { CreateIconFromXpm(wx_const_cast(const char* const*, ppData)); }
|
||||||
|
#endif
|
||||||
wxIcon( const wxString& rName
|
wxIcon( const wxString& rName
|
||||||
,long lFlags = wxBITMAP_TYPE_ICO_RESOURCE
|
,long lFlags = wxBITMAP_TYPE_ICO_RESOURCE
|
||||||
,int nDesiredWidth = -1
|
,int nDesiredWidth = -1
|
||||||
@@ -77,7 +79,7 @@ protected:
|
|||||||
{
|
{
|
||||||
return new wxIconRefData;
|
return new wxIconRefData;
|
||||||
}
|
}
|
||||||
void CreateIconFromXpm(const char **ppData);
|
void CreateIconFromXpm(const char* const* ppData);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_bIsXpm;
|
bool m_bIsXpm;
|
||||||
|
@@ -110,7 +110,7 @@ wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const
|
|||||||
return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data));
|
return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIcon::CreateFromXpm(const char **xpm)
|
bool wxIcon::CreateFromXpm(const char* const* xpm)
|
||||||
{
|
{
|
||||||
wxBitmap bitmap(xpm);
|
wxBitmap bitmap(xpm);
|
||||||
CopyFromBitmap(bitmap);
|
CopyFromBitmap(bitmap);
|
||||||
|
@@ -24,15 +24,17 @@
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
|
IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
|
||||||
|
|
||||||
wxIcon::wxIcon( const char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
|
wxIcon::wxIcon(const char* const* bits) :
|
||||||
wxBitmap( bits )
|
wxBitmap( bits )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
|
#ifdef wxNEEDS_CHARPP
|
||||||
|
wxIcon::wxIcon(char **bits) :
|
||||||
wxBitmap( bits )
|
wxBitmap( bits )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
wxIcon::wxIcon() : wxBitmap()
|
wxIcon::wxIcon() : wxBitmap()
|
||||||
{
|
{
|
||||||
|
@@ -276,16 +276,11 @@ wxCursor::wxCursor( const wxImage &image )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCursor::wxCursor(const char **bits)
|
wxCursor::wxCursor(const char* const* bits)
|
||||||
{
|
{
|
||||||
(void) CreateFromXpm(bits);
|
(void) CreateFromXpm(bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCursor::wxCursor(char **bits)
|
|
||||||
{
|
|
||||||
(void) CreateFromXpm((const char **)bits);
|
|
||||||
}
|
|
||||||
|
|
||||||
wxGDIRefData *wxCursor::CreateGDIRefData() const
|
wxGDIRefData *wxCursor::CreateGDIRefData() const
|
||||||
{
|
{
|
||||||
return new wxCursorRefData;
|
return new wxCursorRefData;
|
||||||
@@ -296,7 +291,7 @@ wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
|
|||||||
return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data));
|
return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCursor::CreateFromXpm(const char **bits)
|
bool wxCursor::CreateFromXpm(const char* const* bits)
|
||||||
{
|
{
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
wxCHECK_MSG( bits != NULL, false, wxT("invalid cursor data") );
|
wxCHECK_MSG( bits != NULL, false, wxT("invalid cursor data") );
|
||||||
|
@@ -90,13 +90,7 @@ wxIcon::wxIcon( const char bits[], int width, int height )
|
|||||||
CopyFromBitmap( bmp ) ;
|
CopyFromBitmap( bmp ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxIcon::wxIcon( const char **bits )
|
wxIcon::wxIcon(const char* const* bits)
|
||||||
{
|
|
||||||
wxBitmap bmp( bits ) ;
|
|
||||||
CopyFromBitmap( bmp ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxIcon::wxIcon( char **bits )
|
|
||||||
{
|
{
|
||||||
wxBitmap bmp( bits ) ;
|
wxBitmap bmp( bits ) ;
|
||||||
CopyFromBitmap( bmp ) ;
|
CopyFromBitmap( bmp ) ;
|
||||||
|
@@ -30,13 +30,15 @@ wxIcon::wxIcon(const char bits[], int width, int height)
|
|||||||
(void) Create((void*) bits, wxBITMAP_TYPE_XBM_DATA, width, height, 1);
|
(void) Create((void*) bits, wxBITMAP_TYPE_XBM_DATA, width, height, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef wxNEEDS_CHARPP
|
||||||
// Create from XPM data
|
// Create from XPM data
|
||||||
wxIcon::wxIcon(char **data)
|
wxIcon::wxIcon(char **data)
|
||||||
{
|
{
|
||||||
(void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
|
(void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
wxIcon::wxIcon(const char **data)
|
wxIcon::wxIcon(const char* const* data)
|
||||||
{
|
{
|
||||||
(void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
|
(void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
@@ -128,7 +128,7 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
|
|||||||
#endif // __WXMICROWIN__
|
#endif // __WXMICROWIN__
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxIcon::CreateIconFromXpm(const char **data)
|
void wxIcon::CreateIconFromXpm(const char* const* data)
|
||||||
{
|
{
|
||||||
wxBitmap bmp(data);
|
wxBitmap bmp(data);
|
||||||
CopyFromBitmap(bmp);
|
CopyFromBitmap(bmp);
|
||||||
|
@@ -85,9 +85,7 @@ wxIcon::~wxIcon()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxIcon::CreateIconFromXpm(
|
void wxIcon::CreateIconFromXpm(const char* const* ppData)
|
||||||
const char** ppData
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxBitmap vBmp(ppData);
|
wxBitmap vBmp(ppData);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user