OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fwl/core/fwl_widgetimp.h" | 7 #include "xfa/fwl/core/fwl_widgetimp.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 void CFWL_WidgetImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { | 303 void CFWL_WidgetImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
304 bSet ? (m_pProperties->m_dwStates |= dwStates) | 304 bSet ? (m_pProperties->m_dwStates |= dwStates) |
305 : (m_pProperties->m_dwStates &= ~dwStates); | 305 : (m_pProperties->m_dwStates &= ~dwStates); |
306 if (!(dwStates & FWL_WGTSTATE_Invisible) || !bSet) | 306 if (!(dwStates & FWL_WGTSTATE_Invisible) || !bSet) |
307 return; | 307 return; |
308 | 308 |
309 CFWL_NoteDriver* noteDriver = | 309 CFWL_NoteDriver* noteDriver = |
310 static_cast<CFWL_NoteDriver*>(GetOwnerApp()->GetNoteDriver()); | 310 static_cast<CFWL_NoteDriver*>(GetOwnerApp()->GetNoteDriver()); |
311 IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); | 311 IFWL_WidgetMgr* widgetMgr = IFWL_WidgetMgr::GetInstance(); |
312 noteDriver->NotifyTargetHide(m_pInterface); | 312 noteDriver->NotifyTargetHide(m_pInterface); |
313 IFWL_Widget* child = | 313 IFWL_Widget* child = |
314 widgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_FirstChild); | 314 widgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_FirstChild); |
315 while (child) { | 315 while (child) { |
316 noteDriver->NotifyTargetHide(child); | 316 noteDriver->NotifyTargetHide(child); |
317 NotifyHideChildWidget(widgetMgr, child, noteDriver); | 317 NotifyHideChildWidget(widgetMgr, child, noteDriver); |
318 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); | 318 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); |
319 } | 319 } |
320 return; | 320 return; |
321 } | 321 } |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, | 510 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, |
511 IFWL_Widget* pOuter) | 511 IFWL_Widget* pOuter) |
512 : m_pProperties(new CFWL_WidgetImpProperties), | 512 : m_pProperties(new CFWL_WidgetImpProperties), |
513 m_pPrivateData(NULL), | 513 m_pPrivateData(NULL), |
514 m_pDelegate(NULL), | 514 m_pDelegate(NULL), |
515 m_pCurDelegate(NULL), | 515 m_pCurDelegate(NULL), |
516 m_pOuter(pOuter), | 516 m_pOuter(pOuter), |
517 m_pInterface(NULL), | 517 m_pInterface(NULL), |
518 m_iLock(0) { | 518 m_iLock(0) { |
519 *m_pProperties = properties; | 519 *m_pProperties = properties; |
520 m_pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); | 520 m_pWidgetMgr = static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance()); |
521 ASSERT(m_pWidgetMgr != NULL); | 521 ASSERT(m_pWidgetMgr != NULL); |
522 } | 522 } |
523 CFWL_WidgetImp::~CFWL_WidgetImp() { | 523 CFWL_WidgetImp::~CFWL_WidgetImp() { |
524 if (m_pPrivateData) { | 524 if (m_pPrivateData) { |
525 delete m_pPrivateData; | 525 delete m_pPrivateData; |
526 m_pPrivateData = NULL; | 526 m_pPrivateData = NULL; |
527 } | 527 } |
528 if (m_pProperties) { | 528 if (m_pProperties) { |
529 delete m_pProperties; | 529 delete m_pProperties; |
530 m_pProperties = NULL; | 530 m_pProperties = NULL; |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); | 922 static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); |
923 if (!pDriver) | 923 if (!pDriver) |
924 return; | 924 return; |
925 | 925 |
926 pDriver->NotifyTargetDestroy(m_pInterface); | 926 pDriver->NotifyTargetDestroy(m_pInterface); |
927 } | 927 } |
928 CFX_SizeF CFWL_WidgetImp::GetOffsetFromParent(IFWL_Widget* pParent) { | 928 CFX_SizeF CFWL_WidgetImp::GetOffsetFromParent(IFWL_Widget* pParent) { |
929 if (pParent == GetInterface()) | 929 if (pParent == GetInterface()) |
930 return CFX_SizeF(); | 930 return CFX_SizeF(); |
931 | 931 |
932 IFWL_WidgetMgr* pWidgetMgr = FWL_GetWidgetMgr(); | 932 IFWL_WidgetMgr* pWidgetMgr = IFWL_WidgetMgr::GetInstance(); |
933 if (!pWidgetMgr) | 933 if (!pWidgetMgr) |
934 return CFX_SizeF(); | 934 return CFX_SizeF(); |
935 | 935 |
936 CFX_SizeF szRet(m_pProperties->m_rtWidget.left, | 936 CFX_SizeF szRet(m_pProperties->m_rtWidget.left, |
937 m_pProperties->m_rtWidget.top); | 937 m_pProperties->m_rtWidget.top); |
938 | 938 |
939 IFWL_Widget* pDstWidget = GetParent(); | 939 IFWL_Widget* pDstWidget = GetParent(); |
940 while (pDstWidget && pDstWidget != pParent) { | 940 while (pDstWidget && pDstWidget != pParent) { |
941 CFX_RectF rtDst; | 941 CFX_RectF rtDst; |
942 pDstWidget->GetWidgetRect(rtDst); | 942 pDstWidget->GetWidgetRect(rtDst); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 } | 1026 } |
1027 } | 1027 } |
1028 | 1028 |
1029 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} | 1029 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} |
1030 | 1030 |
1031 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 1031 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
1032 const CFX_Matrix* pMatrix) { | 1032 const CFX_Matrix* pMatrix) { |
1033 CFWL_EvtDraw evt; | 1033 CFWL_EvtDraw evt; |
1034 evt.m_pGraphics = pGraphics; | 1034 evt.m_pGraphics = pGraphics; |
1035 } | 1035 } |
OLD | NEW |