Use better names for the Impl accessor methods
This commit is contained in:
@@ -161,11 +161,11 @@ protected: // internal utilities
|
|||||||
|
|
||||||
// Helpers to safely access methods in the wxAnimationGenericImpl that are
|
// Helpers to safely access methods in the wxAnimationGenericImpl that are
|
||||||
// specific to the generic implementation
|
// specific to the generic implementation
|
||||||
wxPoint animation_GetFramePosition(unsigned int frame) const;
|
wxPoint AnimationImplGetFramePosition(unsigned int frame) const;
|
||||||
wxSize animation_GetFrameSize(unsigned int frame) const;
|
wxSize AnimationImplGetFrameSize(unsigned int frame) const;
|
||||||
wxAnimationDisposal animation_GetDisposalMethod(unsigned int frame) const;
|
wxAnimationDisposal AnimationImplGetDisposalMethod(unsigned int frame) const;
|
||||||
wxColour animation_GetTransparentColour(unsigned int frame) const;
|
wxColour AnimationImplGetTransparentColour(unsigned int frame) const;
|
||||||
wxColour animation_GetBackgroundColour() const;
|
wxColour AnimationImplGetBackgroundColour() const;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -136,8 +136,8 @@ protected:
|
|||||||
|
|
||||||
// Helpers to safely access methods in the wxAnimationGTKImpl that are
|
// Helpers to safely access methods in the wxAnimationGTKImpl that are
|
||||||
// specific to the gtk implementation
|
// specific to the gtk implementation
|
||||||
GdkPixbufAnimation *animation_GetPixbuf() const;
|
GdkPixbufAnimation *AnimationImplGetPixbuf() const;
|
||||||
void animation_SetPixbuf(GdkPixbufAnimation* p);
|
void AnimationImplSetPixbuf(GdkPixbufAnimation* p);
|
||||||
|
|
||||||
protected: // internal vars
|
protected: // internal vars
|
||||||
|
|
||||||
|
@@ -347,7 +347,7 @@ void wxGenericAnimationCtrl::SetAnimation(const wxAnimation& animation)
|
|||||||
wxCHECK_RET(animation.GetImpl()->GetImplType() == wxANIMATION_IMPL_TYPE_GENERIC,
|
wxCHECK_RET(animation.GetImpl()->GetImplType() == wxANIMATION_IMPL_TYPE_GENERIC,
|
||||||
wxT("incorrect animation implementation type provided") );
|
wxT("incorrect animation implementation type provided") );
|
||||||
|
|
||||||
if (animation_GetBackgroundColour() == wxNullColour)
|
if (AnimationImplGetBackgroundColour() == wxNullColour)
|
||||||
SetUseWindowBackgroundColour();
|
SetUseWindowBackgroundColour();
|
||||||
if (!this->HasFlag(wxAC_NO_AUTORESIZE))
|
if (!this->HasFlag(wxAC_NO_AUTORESIZE))
|
||||||
FitToAnimation();
|
FitToAnimation();
|
||||||
@@ -463,14 +463,14 @@ bool wxGenericAnimationCtrl::RebuildBackingStoreUpToFrame(unsigned int frame)
|
|||||||
// Draw all intermediate frames that haven't been removed from the animation
|
// Draw all intermediate frames that haven't been removed from the animation
|
||||||
for (unsigned int i = 0; i < frame; i++)
|
for (unsigned int i = 0; i < frame; i++)
|
||||||
{
|
{
|
||||||
if (animation_GetDisposalMethod(i) == wxANIM_DONOTREMOVE ||
|
if (AnimationImplGetDisposalMethod(i) == wxANIM_DONOTREMOVE ||
|
||||||
animation_GetDisposalMethod(i) == wxANIM_UNSPECIFIED)
|
AnimationImplGetDisposalMethod(i) == wxANIM_UNSPECIFIED)
|
||||||
{
|
{
|
||||||
DrawFrame(dc, i);
|
DrawFrame(dc, i);
|
||||||
}
|
}
|
||||||
else if (animation_GetDisposalMethod(i) == wxANIM_TOBACKGROUND)
|
else if (AnimationImplGetDisposalMethod(i) == wxANIM_TOBACKGROUND)
|
||||||
DisposeToBackground(dc, animation_GetFramePosition(i),
|
DisposeToBackground(dc, AnimationImplGetFramePosition(i),
|
||||||
animation_GetFrameSize(i));
|
AnimationImplGetFrameSize(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally draw this frame
|
// finally draw this frame
|
||||||
@@ -498,11 +498,11 @@ void wxGenericAnimationCtrl::IncrementalUpdateBackingStore()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (animation_GetDisposalMethod(m_currentFrame-1))
|
switch (AnimationImplGetDisposalMethod(m_currentFrame-1))
|
||||||
{
|
{
|
||||||
case wxANIM_TOBACKGROUND:
|
case wxANIM_TOBACKGROUND:
|
||||||
DisposeToBackground(dc, animation_GetFramePosition(m_currentFrame-1),
|
DisposeToBackground(dc, AnimationImplGetFramePosition(m_currentFrame-1),
|
||||||
animation_GetFrameSize(m_currentFrame-1));
|
AnimationImplGetFrameSize(m_currentFrame-1));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxANIM_TOPREVIOUS:
|
case wxANIM_TOPREVIOUS:
|
||||||
@@ -576,7 +576,7 @@ void wxGenericAnimationCtrl::DrawFrame(wxDC &dc, unsigned int frame)
|
|||||||
// If wxAnimationDecoder had a function to convert directly from its
|
// If wxAnimationDecoder had a function to convert directly from its
|
||||||
// internal format to a port-specific wxBitmap, it would be somewhat faster.
|
// internal format to a port-specific wxBitmap, it would be somewhat faster.
|
||||||
wxBitmap bmp(m_animation.GetFrame(frame));
|
wxBitmap bmp(m_animation.GetFrame(frame));
|
||||||
dc.DrawBitmap(bmp, animation_GetFramePosition(frame),
|
dc.DrawBitmap(bmp, AnimationImplGetFramePosition(frame),
|
||||||
true /* use mask */);
|
true /* use mask */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,7 +601,7 @@ void wxGenericAnimationCtrl::DisposeToBackground(wxDC& dc)
|
|||||||
{
|
{
|
||||||
wxColour col = IsUsingWindowBackgroundColour()
|
wxColour col = IsUsingWindowBackgroundColour()
|
||||||
? GetBackgroundColour()
|
? GetBackgroundColour()
|
||||||
: animation_GetBackgroundColour();
|
: AnimationImplGetBackgroundColour();
|
||||||
|
|
||||||
wxBrush brush(col);
|
wxBrush brush(col);
|
||||||
dc.SetBackground(brush);
|
dc.SetBackground(brush);
|
||||||
@@ -612,7 +612,7 @@ void wxGenericAnimationCtrl::DisposeToBackground(wxDC& dc, const wxPoint &pos, c
|
|||||||
{
|
{
|
||||||
wxColour col = IsUsingWindowBackgroundColour()
|
wxColour col = IsUsingWindowBackgroundColour()
|
||||||
? GetBackgroundColour()
|
? GetBackgroundColour()
|
||||||
: animation_GetBackgroundColour();
|
: AnimationImplGetBackgroundColour();
|
||||||
wxBrush brush(col);
|
wxBrush brush(col);
|
||||||
dc.SetBrush(brush); // SetBrush and not SetBackground !!
|
dc.SetBrush(brush); // SetBrush and not SetBackground !!
|
||||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
@@ -699,31 +699,31 @@ void wxGenericAnimationCtrl::OnSize(wxSizeEvent &WXUNUSED(event))
|
|||||||
// helpers to safely access wxAnimationGenericImpl methods
|
// helpers to safely access wxAnimationGenericImpl methods
|
||||||
#define ANIMATION (static_cast<wxAnimationGenericImpl*>(m_animation.GetImpl()))
|
#define ANIMATION (static_cast<wxAnimationGenericImpl*>(m_animation.GetImpl()))
|
||||||
|
|
||||||
wxPoint wxGenericAnimationCtrl::animation_GetFramePosition(unsigned int frame) const
|
wxPoint wxGenericAnimationCtrl::AnimationImplGetFramePosition(unsigned int frame) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_animation.IsOk(), wxDefaultPosition, wxT("invalid animation") );
|
wxCHECK_MSG( m_animation.IsOk(), wxDefaultPosition, wxT("invalid animation") );
|
||||||
return ANIMATION->GetFramePosition(frame);
|
return ANIMATION->GetFramePosition(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxGenericAnimationCtrl::animation_GetFrameSize(unsigned int frame) const
|
wxSize wxGenericAnimationCtrl::AnimationImplGetFrameSize(unsigned int frame) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_animation.IsOk(), wxDefaultSize, wxT("invalid animation") );
|
wxCHECK_MSG( m_animation.IsOk(), wxDefaultSize, wxT("invalid animation") );
|
||||||
return ANIMATION->GetFrameSize(frame);
|
return ANIMATION->GetFrameSize(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxAnimationDisposal wxGenericAnimationCtrl::animation_GetDisposalMethod(unsigned int frame) const
|
wxAnimationDisposal wxGenericAnimationCtrl::AnimationImplGetDisposalMethod(unsigned int frame) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_animation.IsOk(), wxANIM_UNSPECIFIED, wxT("invalid animation") );
|
wxCHECK_MSG( m_animation.IsOk(), wxANIM_UNSPECIFIED, wxT("invalid animation") );
|
||||||
return ANIMATION->GetDisposalMethod(frame);
|
return ANIMATION->GetDisposalMethod(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour wxGenericAnimationCtrl::animation_GetTransparentColour(unsigned int frame) const
|
wxColour wxGenericAnimationCtrl::AnimationImplGetTransparentColour(unsigned int frame) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_animation.IsOk(), wxNullColour, wxT("invalid animation") );
|
wxCHECK_MSG( m_animation.IsOk(), wxNullColour, wxT("invalid animation") );
|
||||||
return ANIMATION->GetTransparentColour(frame);
|
return ANIMATION->GetTransparentColour(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour wxGenericAnimationCtrl::animation_GetBackgroundColour() const
|
wxColour wxGenericAnimationCtrl::AnimationImplGetBackgroundColour() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_animation.IsOk(), wxNullColour, wxT("invalid animation") );
|
wxCHECK_MSG( m_animation.IsOk(), wxNullColour, wxT("invalid animation") );
|
||||||
return ANIMATION->GetBackgroundColour();
|
return ANIMATION->GetBackgroundColour();
|
||||||
|
@@ -265,7 +265,7 @@ void wxAnimationCtrl::SetAnimation(const wxAnimation &anim)
|
|||||||
wxT("incorrect animation implementation type provided") );
|
wxT("incorrect animation implementation type provided") );
|
||||||
|
|
||||||
// copy underlying GdkPixbuf object
|
// copy underlying GdkPixbuf object
|
||||||
m_anim = animation_GetPixbuf();
|
m_anim = AnimationImplGetPixbuf();
|
||||||
|
|
||||||
// m_anim may be null in case wxNullAnimation has been passed
|
// m_anim may be null in case wxNullAnimation has been passed
|
||||||
if (m_anim)
|
if (m_anim)
|
||||||
@@ -467,13 +467,13 @@ wxAnimationImpl* wxAnimationCtrl::CreateAnimationImpl(wxAnimationImplType implTy
|
|||||||
// helpers to safely access wxAnimationGTKImpl methods
|
// helpers to safely access wxAnimationGTKImpl methods
|
||||||
#define ANIMATION (static_cast<wxAnimationGTKImpl*>(m_animation.GetImpl()))
|
#define ANIMATION (static_cast<wxAnimationGTKImpl*>(m_animation.GetImpl()))
|
||||||
|
|
||||||
GdkPixbufAnimation* wxAnimationCtrl::animation_GetPixbuf() const
|
GdkPixbufAnimation* wxAnimationCtrl::AnimationImplGetPixbuf() const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_animation.IsOk(), NULL, wxT("invalid animation") );
|
wxCHECK_MSG( m_animation.IsOk(), NULL, wxT("invalid animation") );
|
||||||
return ANIMATION->GetPixbuf();
|
return ANIMATION->GetPixbuf();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxAnimationCtrl::animation_SetPixbuf(GdkPixbufAnimation* p)
|
void wxAnimationCtrl::AnimationImplSetPixbuf(GdkPixbufAnimation* p)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_animation.IsOk(), wxT("invalid animation") );
|
wxCHECK_RET( m_animation.IsOk(), wxT("invalid animation") );
|
||||||
ANIMATION->SetPixbuf(p);
|
ANIMATION->SetPixbuf(p);
|
||||||
|
Reference in New Issue
Block a user