From 6f79567f3b3161a1e291c667a1b34a09a8b993b0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 2 Apr 2020 13:21:49 -0700 Subject: [PATCH] Use better names for the Impl accessor methods --- include/wx/generic/animate.h | 10 +++++----- include/wx/gtk/animate.h | 4 ++-- src/generic/animateg.cpp | 34 +++++++++++++++++----------------- src/gtk/animate.cpp | 6 +++--- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/wx/generic/animate.h b/include/wx/generic/animate.h index b4580b8295..4135c87b8f 100644 --- a/include/wx/generic/animate.h +++ b/include/wx/generic/animate.h @@ -161,11 +161,11 @@ protected: // internal utilities // Helpers to safely access methods in the wxAnimationGenericImpl that are // specific to the generic implementation - wxPoint animation_GetFramePosition(unsigned int frame) const; - wxSize animation_GetFrameSize(unsigned int frame) const; - wxAnimationDisposal animation_GetDisposalMethod(unsigned int frame) const; - wxColour animation_GetTransparentColour(unsigned int frame) const; - wxColour animation_GetBackgroundColour() const; + wxPoint AnimationImplGetFramePosition(unsigned int frame) const; + wxSize AnimationImplGetFrameSize(unsigned int frame) const; + wxAnimationDisposal AnimationImplGetDisposalMethod(unsigned int frame) const; + wxColour AnimationImplGetTransparentColour(unsigned int frame) const; + wxColour AnimationImplGetBackgroundColour() const; protected: diff --git a/include/wx/gtk/animate.h b/include/wx/gtk/animate.h index 79ae0e53cc..16d5064fad 100644 --- a/include/wx/gtk/animate.h +++ b/include/wx/gtk/animate.h @@ -136,8 +136,8 @@ protected: // Helpers to safely access methods in the wxAnimationGTKImpl that are // specific to the gtk implementation - GdkPixbufAnimation *animation_GetPixbuf() const; - void animation_SetPixbuf(GdkPixbufAnimation* p); + GdkPixbufAnimation *AnimationImplGetPixbuf() const; + void AnimationImplSetPixbuf(GdkPixbufAnimation* p); protected: // internal vars diff --git a/src/generic/animateg.cpp b/src/generic/animateg.cpp index c5caf3074c..be28abdc65 100644 --- a/src/generic/animateg.cpp +++ b/src/generic/animateg.cpp @@ -347,7 +347,7 @@ void wxGenericAnimationCtrl::SetAnimation(const wxAnimation& animation) wxCHECK_RET(animation.GetImpl()->GetImplType() == wxANIMATION_IMPL_TYPE_GENERIC, wxT("incorrect animation implementation type provided") ); - if (animation_GetBackgroundColour() == wxNullColour) + if (AnimationImplGetBackgroundColour() == wxNullColour) SetUseWindowBackgroundColour(); if (!this->HasFlag(wxAC_NO_AUTORESIZE)) FitToAnimation(); @@ -463,14 +463,14 @@ bool wxGenericAnimationCtrl::RebuildBackingStoreUpToFrame(unsigned int frame) // Draw all intermediate frames that haven't been removed from the animation for (unsigned int i = 0; i < frame; i++) { - if (animation_GetDisposalMethod(i) == wxANIM_DONOTREMOVE || - animation_GetDisposalMethod(i) == wxANIM_UNSPECIFIED) + if (AnimationImplGetDisposalMethod(i) == wxANIM_DONOTREMOVE || + AnimationImplGetDisposalMethod(i) == wxANIM_UNSPECIFIED) { DrawFrame(dc, i); } - else if (animation_GetDisposalMethod(i) == wxANIM_TOBACKGROUND) - DisposeToBackground(dc, animation_GetFramePosition(i), - animation_GetFrameSize(i)); + else if (AnimationImplGetDisposalMethod(i) == wxANIM_TOBACKGROUND) + DisposeToBackground(dc, AnimationImplGetFramePosition(i), + AnimationImplGetFrameSize(i)); } // finally draw this frame @@ -498,11 +498,11 @@ void wxGenericAnimationCtrl::IncrementalUpdateBackingStore() } else { - switch (animation_GetDisposalMethod(m_currentFrame-1)) + switch (AnimationImplGetDisposalMethod(m_currentFrame-1)) { case wxANIM_TOBACKGROUND: - DisposeToBackground(dc, animation_GetFramePosition(m_currentFrame-1), - animation_GetFrameSize(m_currentFrame-1)); + DisposeToBackground(dc, AnimationImplGetFramePosition(m_currentFrame-1), + AnimationImplGetFrameSize(m_currentFrame-1)); break; 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 // internal format to a port-specific wxBitmap, it would be somewhat faster. wxBitmap bmp(m_animation.GetFrame(frame)); - dc.DrawBitmap(bmp, animation_GetFramePosition(frame), + dc.DrawBitmap(bmp, AnimationImplGetFramePosition(frame), true /* use mask */); } @@ -601,7 +601,7 @@ void wxGenericAnimationCtrl::DisposeToBackground(wxDC& dc) { wxColour col = IsUsingWindowBackgroundColour() ? GetBackgroundColour() - : animation_GetBackgroundColour(); + : AnimationImplGetBackgroundColour(); wxBrush brush(col); dc.SetBackground(brush); @@ -612,7 +612,7 @@ void wxGenericAnimationCtrl::DisposeToBackground(wxDC& dc, const wxPoint &pos, c { wxColour col = IsUsingWindowBackgroundColour() ? GetBackgroundColour() - : animation_GetBackgroundColour(); + : AnimationImplGetBackgroundColour(); wxBrush brush(col); dc.SetBrush(brush); // SetBrush and not SetBackground !! dc.SetPen(*wxTRANSPARENT_PEN); @@ -699,31 +699,31 @@ void wxGenericAnimationCtrl::OnSize(wxSizeEvent &WXUNUSED(event)) // helpers to safely access wxAnimationGenericImpl methods #define ANIMATION (static_cast(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") ); 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") ); 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") ); 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") ); return ANIMATION->GetTransparentColour(frame); } -wxColour wxGenericAnimationCtrl::animation_GetBackgroundColour() const +wxColour wxGenericAnimationCtrl::AnimationImplGetBackgroundColour() const { wxCHECK_MSG( m_animation.IsOk(), wxNullColour, wxT("invalid animation") ); return ANIMATION->GetBackgroundColour(); diff --git a/src/gtk/animate.cpp b/src/gtk/animate.cpp index 71d3911948..18ad1245ad 100644 --- a/src/gtk/animate.cpp +++ b/src/gtk/animate.cpp @@ -265,7 +265,7 @@ void wxAnimationCtrl::SetAnimation(const wxAnimation &anim) wxT("incorrect animation implementation type provided") ); // copy underlying GdkPixbuf object - m_anim = animation_GetPixbuf(); + m_anim = AnimationImplGetPixbuf(); // m_anim may be null in case wxNullAnimation has been passed if (m_anim) @@ -467,13 +467,13 @@ wxAnimationImpl* wxAnimationCtrl::CreateAnimationImpl(wxAnimationImplType implTy // helpers to safely access wxAnimationGTKImpl methods #define ANIMATION (static_cast(m_animation.GetImpl())) -GdkPixbufAnimation* wxAnimationCtrl::animation_GetPixbuf() const +GdkPixbufAnimation* wxAnimationCtrl::AnimationImplGetPixbuf() const { wxCHECK_MSG( m_animation.IsOk(), NULL, wxT("invalid animation") ); return ANIMATION->GetPixbuf(); } -void wxAnimationCtrl::animation_SetPixbuf(GdkPixbufAnimation* p) +void wxAnimationCtrl::AnimationImplSetPixbuf(GdkPixbufAnimation* p) { wxCHECK_RET( m_animation.IsOk(), wxT("invalid animation") ); ANIMATION->SetPixbuf(p);