replaced Ok() with IsOk(), no real changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
deb325e3b2
commit
9d9e385850
@ -36,7 +36,7 @@ wxCURHandler wxANIDecoder::sm_handler;
|
|||||||
class wxANIFrameInfo
|
class wxANIFrameInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxANIFrameInfo(size_t delay = 0, int idx = -1)
|
wxANIFrameInfo(size_t delay = 0, int idx = -1)
|
||||||
{ m_delay=delay; m_imageIndex=idx; }
|
{ m_delay=delay; m_imageIndex=idx; }
|
||||||
|
|
||||||
size_t m_delay;
|
size_t m_delay;
|
||||||
@ -68,7 +68,7 @@ bool wxANIDecoder::ConvertToImage(size_t frame, wxImage *image) const
|
|||||||
{
|
{
|
||||||
size_t idx = m_info[frame].m_imageIndex;
|
size_t idx = m_info[frame].m_imageIndex;
|
||||||
*image = m_images[idx]; // copy
|
*image = m_images[idx]; // copy
|
||||||
return image->Ok();
|
return image->IsOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ bool wxANIDecoder::CanRead(wxInputStream& stream) const
|
|||||||
// we always have a data size:
|
// we always have a data size:
|
||||||
stream.Read(&datalen, 4);
|
stream.Read(&datalen, 4);
|
||||||
datalen = wxINT32_SWAP_ON_BE(datalen) ;
|
datalen = wxINT32_SWAP_ON_BE(datalen) ;
|
||||||
|
|
||||||
// data should be padded to make even number of bytes
|
// data should be padded to make even number of bytes
|
||||||
if (datalen % 2 == 1) datalen ++ ;
|
if (datalen % 2 == 1) datalen ++ ;
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ bool wxANIDecoder::CanRead(wxInputStream& stream) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the "anih" RIFF chunk
|
// the "anih" RIFF chunk
|
||||||
struct wxANIHeader
|
struct wxANIHeader
|
||||||
{
|
{
|
||||||
wxInt32 cbSizeOf; // Num bytes in AniHeader (36 bytes)
|
wxInt32 cbSizeOf; // Num bytes in AniHeader (36 bytes)
|
||||||
wxInt32 cFrames; // Number of unique Icons in this cursor
|
wxInt32 cFrames; // Number of unique Icons in this cursor
|
||||||
@ -234,7 +234,7 @@ bool wxANIDecoder::Load( wxInputStream& stream )
|
|||||||
|
|
||||||
// save interesting info from the header
|
// save interesting info from the header
|
||||||
m_nFrames = header.cSteps; // NB: not cFrames!!
|
m_nFrames = header.cSteps; // NB: not cFrames!!
|
||||||
if (m_nFrames==0)
|
if ( m_nFrames == 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
globaldelay = wxINT32_SWAP_ON_BE(header.JifRate) * 1000 / 60;
|
globaldelay = wxINT32_SWAP_ON_BE(header.JifRate) * 1000 / 60;
|
||||||
@ -247,7 +247,7 @@ bool wxANIDecoder::Load( wxInputStream& stream )
|
|||||||
// did we already process the anih32 chunk?
|
// did we already process the anih32 chunk?
|
||||||
if (m_nFrames == 0)
|
if (m_nFrames == 0)
|
||||||
return false; // rate chunks should always be placed after anih chunk
|
return false; // rate chunks should always be placed after anih chunk
|
||||||
|
|
||||||
wxASSERT(m_info.GetCount() == m_nFrames);
|
wxASSERT(m_info.GetCount() == m_nFrames);
|
||||||
for (size_t i=0; i<m_nFrames; i++)
|
for (size_t i=0; i<m_nFrames; i++)
|
||||||
{
|
{
|
||||||
|
@ -99,7 +99,7 @@ wxColour wxAnimation::GetBackgroundColour() const
|
|||||||
bool wxAnimation::LoadFile(const wxString& filename, wxAnimationType type)
|
bool wxAnimation::LoadFile(const wxString& filename, wxAnimationType type)
|
||||||
{
|
{
|
||||||
wxFileInputStream stream(filename);
|
wxFileInputStream stream(filename);
|
||||||
if (!stream.Ok())
|
if ( !stream.IsOk() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Load(stream, type);
|
return Load(stream, type);
|
||||||
@ -112,7 +112,7 @@ bool wxAnimation::Load(wxInputStream &stream, wxAnimationType type)
|
|||||||
const wxAnimationDecoder *handler;
|
const wxAnimationDecoder *handler;
|
||||||
if ( type == wxANIMATION_TYPE_ANY )
|
if ( type == wxANIMATION_TYPE_ANY )
|
||||||
{
|
{
|
||||||
for ( wxAnimationDecoderList::compatibility_iterator node = sm_handlers.GetFirst();
|
for ( wxAnimationDecoderList::compatibility_iterator node = sm_handlers.GetFirst();
|
||||||
node; node = node->GetNext() )
|
node; node = node->GetNext() )
|
||||||
{
|
{
|
||||||
handler=(const wxAnimationDecoder*)node->GetData();
|
handler=(const wxAnimationDecoder*)node->GetData();
|
||||||
@ -284,7 +284,7 @@ wxAnimationCtrl::~wxAnimationCtrl()
|
|||||||
bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type)
|
bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type)
|
||||||
{
|
{
|
||||||
wxAnimation anim;
|
wxAnimation anim;
|
||||||
if (!anim.LoadFile(filename, type) ||
|
if (!anim.LoadFile(filename, type) ||
|
||||||
!anim.IsOk())
|
!anim.IsOk())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ void wxAnimationCtrl::SetAnimation(const wxAnimation& animation)
|
|||||||
RebuildBackingStoreUpToFrame(0);
|
RebuildBackingStoreUpToFrame(0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// clear to
|
// clear to
|
||||||
wxMemoryDC dc;
|
wxMemoryDC dc;
|
||||||
dc.SelectObject(m_backingStore);
|
dc.SelectObject(m_backingStore);
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ void wxAnimationCtrl::RebuildBackingStoreUpToFrame(size_t frame)
|
|||||||
int w = wxMin(sz.GetWidth(), winsz.GetWidth());
|
int w = wxMin(sz.GetWidth(), winsz.GetWidth());
|
||||||
int h = wxMin(sz.GetHeight(), winsz.GetHeight());
|
int h = wxMin(sz.GetHeight(), winsz.GetHeight());
|
||||||
|
|
||||||
if ( !m_backingStore.Ok() ||
|
if ( !m_backingStore.IsOk() ||
|
||||||
m_backingStore.GetWidth() < w || m_backingStore.GetHeight() < h )
|
m_backingStore.GetWidth() < w || m_backingStore.GetHeight() < h )
|
||||||
{
|
{
|
||||||
m_backingStore.Create(w, h);
|
m_backingStore.Create(w, h);
|
||||||
@ -443,8 +443,8 @@ void wxAnimationCtrl::IncrementalUpdateBackingStore()
|
|||||||
case wxANIM_TOPREVIOUS:
|
case wxANIM_TOPREVIOUS:
|
||||||
// this disposal should never be used too often.
|
// this disposal should never be used too often.
|
||||||
// E.g. GIF specification explicitely say to keep the usage of this
|
// E.g. GIF specification explicitely say to keep the usage of this
|
||||||
// disposal limited to the minimum.
|
// disposal limited to the minimum.
|
||||||
// In fact it may require a lot of time to restore
|
// In fact it may require a lot of time to restore
|
||||||
if (m_currentFrame == 1)
|
if (m_currentFrame == 1)
|
||||||
{
|
{
|
||||||
// if 0-th frame disposal is to restore to previous frame,
|
// if 0-th frame disposal is to restore to previous frame,
|
||||||
@ -481,7 +481,7 @@ void wxAnimationCtrl::DrawFrame(wxDC &dc, size_t frame)
|
|||||||
|
|
||||||
void wxAnimationCtrl::DrawCurrentFrame(wxDC& dc)
|
void wxAnimationCtrl::DrawCurrentFrame(wxDC& dc)
|
||||||
{
|
{
|
||||||
wxASSERT(m_backingStore.Ok());
|
wxASSERT( m_backingStore.IsOk() );
|
||||||
|
|
||||||
// m_backingStore always contains the current frame
|
// m_backingStore always contains the current frame
|
||||||
dc.DrawBitmap(m_backingStore, 0, 0);
|
dc.DrawBitmap(m_backingStore, 0, 0);
|
||||||
@ -489,8 +489,9 @@ void wxAnimationCtrl::DrawCurrentFrame(wxDC& dc)
|
|||||||
|
|
||||||
void wxAnimationCtrl::DisposeToBackground(wxDC& dc)
|
void wxAnimationCtrl::DisposeToBackground(wxDC& dc)
|
||||||
{
|
{
|
||||||
wxBrush brush(IsUsingWindowBackgroundColour() ?
|
wxBrush brush(IsUsingWindowBackgroundColour()
|
||||||
this->GetBackgroundColour() : m_animation.GetBackgroundColour(), wxSOLID);
|
? GetBackgroundColour()
|
||||||
|
: m_animation.GetBackgroundColour());
|
||||||
dc.SetBackground(brush);
|
dc.SetBackground(brush);
|
||||||
dc.Clear();
|
dc.Clear();
|
||||||
}
|
}
|
||||||
@ -505,7 +506,7 @@ void wxAnimationCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
// both if we are playing or not, we need to refresh the current frame
|
// both if we are playing or not, we need to refresh the current frame
|
||||||
if (m_backingStore.Ok())
|
if ( m_backingStore.IsOk() )
|
||||||
DrawCurrentFrame(dc);
|
DrawCurrentFrame(dc);
|
||||||
//else: m_animation is not valid and thus we don't have a valid backing store...
|
//else: m_animation is not valid and thus we don't have a valid backing store...
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user