Index: xfa/fwl/core/cfwl_widgetmgr.cpp |
diff --git a/xfa/fwl/core/cfwl_widgetmgr.cpp b/xfa/fwl/core/cfwl_widgetmgr.cpp |
index 90dcd6e12128cfc0a49c74897b2003887270b347..310577c1f5b99ff50708be9f2f1ae3348f625f1f 100644 |
--- a/xfa/fwl/core/cfwl_widgetmgr.cpp |
+++ b/xfa/fwl/core/cfwl_widgetmgr.cpp |
@@ -35,9 +35,7 @@ bool FWL_UseOffscreen(IFWL_Widget* pWidget) { |
} |
CFWL_WidgetMgr::CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative) |
- : m_dwCapability(0), |
- m_pDelegate(new CFWL_WidgetMgrDelegate(this)), |
- m_pAdapter(pAdapterNative->GetWidgetMgr(m_pDelegate.get())) { |
+ : m_dwCapability(0), m_pAdapter(pAdapterNative->GetWidgetMgr(this)) { |
ASSERT(m_pAdapter); |
m_mapWidgetItem[nullptr].reset(new CFWL_WidgetMgrItem); |
#if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
@@ -76,15 +74,6 @@ IFWL_Widget* CFWL_WidgetMgr::GetNextSiblingWidget(IFWL_Widget* pWidget) const { |
return pItem && pItem->pNext ? pItem->pNext->pWidget : nullptr; |
} |
-IFWL_Widget* CFWL_WidgetMgr::GetLastSiblingWidget(IFWL_Widget* pWidget) const { |
- CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
- pItem = pItem ? pItem->pNext : nullptr; // Not self. |
- while (pItem && pItem->pNext) |
- pItem = pItem->pNext; |
- |
- return pItem ? pItem->pWidget : nullptr; |
-} |
- |
IFWL_Widget* CFWL_WidgetMgr::GetFirstChildWidget(IFWL_Widget* pWidget) const { |
CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
return pItem && pItem->pChild ? pItem->pChild->pWidget : nullptr; |
@@ -109,19 +98,18 @@ IFWL_Widget* CFWL_WidgetMgr::GetSystemFormWidget(IFWL_Widget* pWidget) const { |
return nullptr; |
} |
-bool CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) { |
+void CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) { |
CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
if (!pItem) |
- return false; |
+ return; |
if (!pItem->pParent) |
- return false; |
+ return; |
CFWL_WidgetMgrItem* pChild = pItem->pParent->pChild; |
int32_t i = 0; |
while (pChild) { |
if (pChild == pItem) { |
- if (i == nIndex) { |
- return true; |
- } |
+ if (i == nIndex) |
+ return; |
if (pChild->pPrevious) { |
pChild->pPrevious->pNext = pChild->pNext; |
} |
@@ -150,7 +138,7 @@ bool CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) { |
pChild->pNext = pItem; |
pItem->pPrevious = pChild; |
pItem->pNext = nullptr; |
- return true; |
+ return; |
} |
i = 0; |
while (i < nIndex && pChild->pNext) { |
@@ -161,7 +149,7 @@ bool CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) { |
pChild->pNext = pItem; |
pItem->pPrevious = pChild; |
pItem->pNext = nullptr; |
- return true; |
+ return; |
} |
if (pChild->pPrevious) { |
pItem->pPrevious = pChild->pPrevious; |
@@ -177,12 +165,13 @@ bool CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) { |
pItem->pPrevious = nullptr; |
pItem->pNext = nullptr; |
} |
- return true; |
} |
-FWL_Error CFWL_WidgetMgr::RepaintWidget(IFWL_Widget* pWidget, |
- const CFX_RectF* pRect) { |
+ |
+void CFWL_WidgetMgr::RepaintWidget(IFWL_Widget* pWidget, |
+ const CFX_RectF* pRect) { |
if (!m_pAdapter) |
- return FWL_Error::Indefinite; |
+ return; |
+ |
IFWL_Widget* pNative = pWidget; |
CFX_RectF rect(*pRect); |
if (IsFormDisabled()) { |
@@ -198,33 +187,14 @@ FWL_Error CFWL_WidgetMgr::RepaintWidget(IFWL_Widget* pWidget, |
} else if (!IsAbleNative(pWidget)) { |
pNative = GetSystemFormWidget(pWidget); |
if (!pNative) |
- return FWL_Error::Indefinite; |
+ return; |
+ |
pWidget->TransformTo(pNative, rect.left, rect.top); |
} |
AddRedrawCounts(pNative); |
- return m_pAdapter->RepaintWidget(pNative, &rect); |
-} |
-void CFWL_WidgetMgr::AddWidget(IFWL_Widget* pWidget) { |
- CFWL_WidgetMgrItem* pParentItem = GetWidgetMgrItem(nullptr); |
- CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
- if (!pItem) { |
- pItem = new CFWL_WidgetMgrItem(pWidget); |
- m_mapWidgetItem[pWidget].reset(pItem); |
- } |
- if (pItem->pParent && pItem->pParent != pParentItem) { |
- if (pItem->pPrevious) { |
- pItem->pPrevious->pNext = pItem->pNext; |
- } |
- if (pItem->pNext) { |
- pItem->pNext->pPrevious = pItem->pPrevious; |
- } |
- if (pItem->pParent->pChild == pItem) { |
- pItem->pParent->pChild = pItem->pNext; |
- } |
- } |
- pItem->pParent = pParentItem; |
- SetWidgetIndex(pWidget, -1); |
+ m_pAdapter->RepaintWidget(pNative, &rect); |
} |
+ |
void CFWL_WidgetMgr::InsertWidget(IFWL_Widget* pParent, |
IFWL_Widget* pChild, |
int32_t nIndex) { |
@@ -313,18 +283,8 @@ void CFWL_WidgetMgr::SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild) { |
SetWidgetIndex(pChild, -1); |
} |
-bool CFWL_WidgetMgr::IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent) { |
- IFWL_Widget* pTemp = pChild; |
- do { |
- if (pTemp == pParent) |
- return true; |
- pTemp = GetParentWidget(pTemp); |
- } while (pTemp); |
- return false; |
-} |
- |
-FWL_Error CFWL_WidgetMgr::SetWidgetRect_Native(IFWL_Widget* pWidget, |
- const CFX_RectF& rect) { |
+void CFWL_WidgetMgr::SetWidgetRect_Native(IFWL_Widget* pWidget, |
+ const CFX_RectF& rect) { |
if (FWL_UseOffscreen(pWidget)) { |
CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
pItem->iRedrawCounter++; |
@@ -342,7 +302,6 @@ FWL_Error CFWL_WidgetMgr::SetWidgetRect_Native(IFWL_Widget* pWidget, |
pItem->bOutsideChanged = !m_rtScreen.Contains(rect); |
#endif |
} |
- return FWL_Error::Succeeded; |
} |
IFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(IFWL_Widget* parent, |
@@ -383,7 +342,7 @@ void CFWL_WidgetMgr::NotifySizeChanged(IFWL_Widget* pForm, |
GetWidgetMgrItem(pForm)->pOffscreen.reset(); |
} |
-IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent, |
+IFWL_Widget* CFWL_WidgetMgr::NextTab(IFWL_Widget* parent, |
IFWL_Widget* focus, |
bool& bFind) { |
CFWL_WidgetMgr* pMgr = parent->GetOwnerApp()->GetWidgetMgr(); |
@@ -396,7 +355,7 @@ IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent, |
(!focus || (focus != child && bFind))) { |
return child; |
} |
- IFWL_Widget* bRet = nextTab(child, focus, bFind); |
+ IFWL_Widget* bRet = NextTab(child, focus, bFind); |
if (bRet) |
return bRet; |
@@ -405,7 +364,7 @@ IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent, |
return nullptr; |
} |
-int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget* pFirst) { |
+int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget* pFirst) const { |
int32_t iRet = 0; |
IFWL_Widget* pChild = pFirst; |
while (pChild) { |
@@ -414,51 +373,29 @@ int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget* pFirst) { |
} |
return iRet; |
} |
-IFWL_Widget* CFWL_WidgetMgr::GetSiblingRadioButton(IFWL_Widget* pWidget, |
- bool bNext) { |
- return nullptr; |
-} |
+ |
IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader( |
- IFWL_Widget* pRadioButton) { |
+ IFWL_Widget* pRadioButton) const { |
IFWL_Widget* pNext = pRadioButton; |
- while (pNext) { |
- if (pNext->GetStyles() & FWL_WGTSTYLE_Group) |
- return pNext; |
- pNext = GetSiblingRadioButton(pNext, false); |
- } |
- pNext = GetLastSiblingWidget(pRadioButton); |
- while ((pNext = GetSiblingRadioButton(pNext, false)) != nullptr && |
- pNext != pRadioButton) { |
- if (pNext->GetStyles() & FWL_WGTSTYLE_Group) |
- return pNext; |
- } |
- pNext = GetFirstSiblingWidget(pRadioButton); |
- return GetSiblingRadioButton(pNext, true); |
+ if (pNext && (pNext->GetStyles() & FWL_WGTSTYLE_Group)) |
+ return pNext; |
+ return nullptr; |
} |
+ |
void CFWL_WidgetMgr::GetSameGroupRadioButton( |
IFWL_Widget* pRadioButton, |
- CFX_ArrayTemplate<IFWL_Widget*>& group) { |
+ CFX_ArrayTemplate<IFWL_Widget*>& group) const { |
IFWL_Widget* pFirst = GetFirstSiblingWidget(pRadioButton); |
if (!pFirst) { |
pFirst = pRadioButton; |
} |
int32_t iGroup = CountRadioButtonGroup(pFirst); |
- if (iGroup < 2) { |
- IFWL_Widget* pNext = pFirst; |
- while ((pNext = GetSiblingRadioButton(pNext, true)) != nullptr) { |
- group.Add(pNext); |
- } |
+ if (iGroup < 2) |
return; |
- } |
- IFWL_Widget* pNext = GetRadioButtonGroupHeader(pRadioButton); |
- do { |
- group.Add(pNext); |
- pNext = GetSiblingRadioButton(pNext, true); |
- if (!pNext) |
- pNext = GetSiblingRadioButton(pFirst, true); |
- } while (pNext && ((pNext->GetStyles() & FWL_WGTSTYLE_Group) == 0)); |
+ group.Add(GetRadioButtonGroupHeader(pRadioButton)); |
} |
-IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) { |
+ |
+IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) const { |
if ((pParent->GetClassID() == FWL_Type::PushButton) && |
(pParent->GetStates() & (1 << (FWL_WGTSTATE_MAX + 2)))) { |
return pParent; |
@@ -478,14 +415,15 @@ IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) { |
} |
return nullptr; |
} |
+ |
void CFWL_WidgetMgr::AddRedrawCounts(IFWL_Widget* pWidget) { |
- CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
- (pItem->iRedrawCounter)++; |
+ GetWidgetMgrItem(pWidget)->iRedrawCounter++; |
} |
+ |
void CFWL_WidgetMgr::ResetRedrawCounts(IFWL_Widget* pWidget) { |
- CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
- pItem->iRedrawCounter = 0; |
+ GetWidgetMgrItem(pWidget)->iRedrawCounter = 0; |
} |
+ |
CFWL_WidgetMgrItem* CFWL_WidgetMgr::GetWidgetMgrItem( |
IFWL_Widget* pWidget) const { |
auto it = m_mapWidgetItem.find(pWidget); |
@@ -493,36 +431,6 @@ CFWL_WidgetMgrItem* CFWL_WidgetMgr::GetWidgetMgrItem( |
? static_cast<CFWL_WidgetMgrItem*>(it->second.get()) |
: nullptr; |
} |
-int32_t CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, |
- int32_t* pIndex, |
- CFWL_WidgetMgrItem* pItem, |
- IFWL_Widget** pWidget) { |
- if (!pParent) { |
- return 0; |
- } |
- int32_t iCount = 0; |
- CFWL_WidgetMgrItem* pChild = pParent->pChild; |
- while (pChild) { |
- iCount++; |
- if (pIndex) { |
- if (*pIndex == 0) { |
- *pWidget = pChild->pWidget; |
- return iCount; |
- } |
- pIndex--; |
- } |
- if (pItem && pItem == pChild) { |
- return iCount - 1; |
- } |
- pChild = pChild->pNext; |
- } |
- if (pIndex) { |
- return 0; |
- } else if (pItem) { |
- return -1; |
- } |
- return iCount - 1; |
-} |
bool CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) const { |
if (!pWidget) |
@@ -536,31 +444,19 @@ bool CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) const { |
(dwStyles & FWL_WGTSTYLE_Popup); |
} |
-bool CFWL_WidgetMgr::IsThreadEnabled() { |
- return !(m_dwCapability & FWL_WGTMGR_DisableThread); |
-} |
- |
-bool CFWL_WidgetMgr::IsFormDisabled() { |
- return !!(m_dwCapability & FWL_WGTMGR_DisableForm); |
-} |
- |
-bool CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget, |
+void CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget, |
FX_FLOAT fMinHeight, |
FX_FLOAT fMaxHeight, |
const CFX_RectF& rtAnchor, |
- CFX_RectF& rtPopup) { |
- CXFA_FWLAdapterWidgetMgr* pSDApapter = GetAdapterWidgetMgr(); |
- return pSDApapter->GetPopupPos(pWidget, fMinHeight, fMaxHeight, rtAnchor, |
- rtPopup); |
+ CFX_RectF& rtPopup) const { |
+ m_pAdapter->GetPopupPos(pWidget, fMinHeight, fMaxHeight, rtAnchor, rtPopup); |
} |
-CFWL_WidgetMgrDelegate::CFWL_WidgetMgrDelegate(CFWL_WidgetMgr* pWidgetMgr) |
- : m_pWidgetMgr(pWidgetMgr) {} |
-FWL_Error CFWL_WidgetMgrDelegate::OnSetCapability(uint32_t dwCapability) { |
- m_pWidgetMgr->m_dwCapability = dwCapability; |
- return FWL_Error::Succeeded; |
+ |
+void CFWL_WidgetMgr::OnSetCapability(uint32_t dwCapability) { |
+ m_dwCapability = dwCapability; |
} |
-void CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) { |
+void CFWL_WidgetMgr::OnProcessMessageToForm(CFWL_Message* pMessage) { |
if (!pMessage) |
return; |
if (!pMessage->m_pDstTarget) |
@@ -576,9 +472,9 @@ void CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) { |
if (!pNoteDriver) |
return; |
- if (m_pWidgetMgr->IsThreadEnabled()) |
+ if (IsThreadEnabled()) |
pMessage = static_cast<CFWL_Message*>(pMessage->Clone()); |
- if (m_pWidgetMgr->IsFormDisabled()) |
+ if (IsFormDisabled()) |
pNoteDriver->ProcessMessage(pMessage); |
else |
pNoteDriver->QueueMessage(pMessage); |
@@ -589,15 +485,15 @@ void CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) { |
pNoteDriver->UnqueueMessage(pTopLoop); |
#endif |
- if (m_pWidgetMgr->IsThreadEnabled()) |
+ if (IsThreadEnabled()) |
pMessage->Release(); |
return; |
} |
-void CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget* pWidget, |
- CFX_Graphics* pGraphics, |
- const CFX_Matrix* pMatrix) { |
+void CFWL_WidgetMgr::OnDrawWidget(IFWL_Widget* pWidget, |
+ CFX_Graphics* pGraphics, |
+ const CFX_Matrix* pMatrix) { |
if (!pWidget || !pGraphics) |
return; |
@@ -605,7 +501,7 @@ void CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget* pWidget, |
CFX_RectF clipCopy; |
pWidget->GetWidgetRect(clipCopy); |
clipCopy.left = clipCopy.top = 0; |
- if (bUseOffscreenDirect(pWidget)) { |
+ if (UseOffscreenDirect(pWidget)) { |
DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix); |
return; |
} |
@@ -617,7 +513,7 @@ void CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget* pWidget, |
pGraphics->GetClipRect(clipBounds); |
clipCopy = clipBounds; |
#elif _FX_OS_ == _FX_MACOSX_ |
- if (m_pWidgetMgr->IsFormDisabled()) { |
+ if (IsFormDisabled()) { |
pWidget->GetDelegate()->OnDrawWidget(pTemp, pMatrix); |
pGraphics->GetClipRect(clipBounds); |
clipCopy = clipBounds; |
@@ -628,7 +524,7 @@ void CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget* pWidget, |
} |
#endif // _FX_OS_ == _FX_MACOSX_ |
- if (!m_pWidgetMgr->IsFormDisabled()) { |
+ if (!IsFormDisabled()) { |
CFX_RectF rtClient; |
pWidget->GetClientRect(rtClient); |
clipBounds.Intersect(rtClient); |
@@ -637,21 +533,21 @@ void CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget* pWidget, |
DrawChild(pWidget, clipBounds, pTemp, pMatrix); |
DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix); |
- m_pWidgetMgr->ResetRedrawCounts(pWidget); |
+ ResetRedrawCounts(pWidget); |
} |
-void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent, |
- const CFX_RectF& rtClip, |
- CFX_Graphics* pGraphics, |
- const CFX_Matrix* pMatrix) { |
+void CFWL_WidgetMgr::DrawChild(IFWL_Widget* parent, |
+ const CFX_RectF& rtClip, |
+ CFX_Graphics* pGraphics, |
+ const CFX_Matrix* pMatrix) { |
if (!parent) |
return; |
- bool bFormDisable = m_pWidgetMgr->IsFormDisabled(); |
- IFWL_Widget* pNextChild = m_pWidgetMgr->GetFirstChildWidget(parent); |
+ bool bFormDisable = IsFormDisabled(); |
+ IFWL_Widget* pNextChild = GetFirstChildWidget(parent); |
while (pNextChild) { |
IFWL_Widget* child = pNextChild; |
- pNextChild = m_pWidgetMgr->GetNextSiblingWidget(child); |
+ pNextChild = GetNextSiblingWidget(child); |
if (child->GetStates() & FWL_WGTSTATE_Invisible) |
continue; |
@@ -679,8 +575,7 @@ void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent, |
widgetMatrix.Translate(rtWidget.left, rtWidget.top, true); |
if (IFWL_WidgetDelegate* pDelegate = child->GetDelegate()) { |
- if (m_pWidgetMgr->IsFormDisabled() || |
- IsNeedRepaint(child, &widgetMatrix, rtClip)) { |
+ if (IsFormDisabled() || IsNeedRepaint(child, &widgetMatrix, rtClip)) { |
pDelegate->OnDrawWidget(pGraphics, &widgetMatrix); |
} |
} |
@@ -689,18 +584,17 @@ void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent, |
DrawChild(child, clipBounds, pGraphics, |
bFormDisable ? &widgetMatrix : pMatrix); |
- child = m_pWidgetMgr->GetNextSiblingWidget(child); |
+ child = GetNextSiblingWidget(child); |
} |
} |
-CFX_Graphics* CFWL_WidgetMgrDelegate::DrawWidgetBefore( |
- IFWL_Widget* pWidget, |
- CFX_Graphics* pGraphics, |
- const CFX_Matrix* pMatrix) { |
+CFX_Graphics* CFWL_WidgetMgr::DrawWidgetBefore(IFWL_Widget* pWidget, |
+ CFX_Graphics* pGraphics, |
+ const CFX_Matrix* pMatrix) { |
if (!FWL_UseOffscreen(pWidget)) |
return pGraphics; |
- CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
+ CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
if (!pItem->pOffscreen) { |
pItem->pOffscreen.reset(new CFX_Graphics); |
CFX_RectF rect; |
@@ -714,26 +608,26 @@ CFX_Graphics* CFWL_WidgetMgrDelegate::DrawWidgetBefore( |
return pItem->pOffscreen.get(); |
} |
-void CFWL_WidgetMgrDelegate::DrawWidgetAfter(IFWL_Widget* pWidget, |
- CFX_Graphics* pGraphics, |
- CFX_RectF& rtClip, |
- const CFX_Matrix* pMatrix) { |
+void CFWL_WidgetMgr::DrawWidgetAfter(IFWL_Widget* pWidget, |
+ CFX_Graphics* pGraphics, |
+ CFX_RectF& rtClip, |
+ const CFX_Matrix* pMatrix) { |
if (FWL_UseOffscreen(pWidget)) { |
- CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
+ CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
pGraphics->Transfer(pItem->pOffscreen.get(), rtClip.left, rtClip.top, |
rtClip, pMatrix); |
#ifdef _WIN32 |
pItem->pOffscreen->ClearClip(); |
#endif |
} |
- CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
+ CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
pItem->iRedrawCounter = 0; |
} |
-bool CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget, |
- CFX_Matrix* pMatrix, |
- const CFX_RectF& rtDirty) { |
- CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
+bool CFWL_WidgetMgr::IsNeedRepaint(IFWL_Widget* pWidget, |
+ CFX_Matrix* pMatrix, |
+ const CFX_RectF& rtDirty) { |
+ CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
if (pItem && pItem->iRedrawCounter > 0) { |
pItem->iRedrawCounter = 0; |
return true; |
@@ -829,8 +723,8 @@ bool CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget, |
return true; |
} |
-bool CFWL_WidgetMgrDelegate::bUseOffscreenDirect(IFWL_Widget* pWidget) { |
- CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
+bool CFWL_WidgetMgr::UseOffscreenDirect(IFWL_Widget* pWidget) const { |
+ CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget); |
if (!FWL_UseOffscreen(pWidget) || !(pItem->pOffscreen)) |
return false; |
@@ -838,7 +732,7 @@ bool CFWL_WidgetMgrDelegate::bUseOffscreenDirect(IFWL_Widget* pWidget) { |
if (pItem->bOutsideChanged) { |
CFX_RectF r; |
pWidget->GetWidgetRect(r); |
- CFX_RectF temp(m_pWidgetMgr->m_rtScreen); |
+ CFX_RectF temp(m_rtScreen); |
temp.Deflate(50, 50); |
if (!temp.Contains(r)) |
return false; |