Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: xfa/fwl/core/fwl_formimp.cpp

Issue 2004213002: Remove IWFL_WidgetMgr in favor of CFWL_WidgetMgr (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Explicit ctor Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/fwl_appimp.cpp ('k') | xfa/fwl/core/fwl_noteimp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_formimp.h" 7 #include "xfa/fwl/core/fwl_formimp.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h" 10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return FWL_Error::Succeeded; 144 return FWL_Error::Succeeded;
145 } 145 }
146 FWL_Error CFWL_FormImp::GetClientRect(CFX_RectF& rect) { 146 FWL_Error CFWL_FormImp::GetClientRect(CFX_RectF& rect) {
147 if ((m_pProperties->m_dwStyles & FWL_WGTSTYLE_Caption) == 0) { 147 if ((m_pProperties->m_dwStyles & FWL_WGTSTYLE_Caption) == 0) {
148 rect = m_pProperties->m_rtWidget; 148 rect = m_pProperties->m_rtWidget;
149 rect.Offset(-rect.left, -rect.top); 149 rect.Offset(-rect.left, -rect.top);
150 return FWL_Error::Succeeded; 150 return FWL_Error::Succeeded;
151 } 151 }
152 #ifdef FWL_UseMacSystemBorder 152 #ifdef FWL_UseMacSystemBorder
153 rect = m_rtRelative; 153 rect = m_rtRelative;
154 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 154 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance();
155 if (!pWidgetMgr) 155 if (!pWidgetMgr)
156 return FWL_Error::Indefinite; 156 return FWL_Error::Indefinite;
157 157
158 rect.left = 0; 158 rect.left = 0;
159 rect.top = 0; 159 rect.top = 0;
160 return FWL_Error::Succeeded; 160 return FWL_Error::Succeeded;
161 #else 161 #else
162 FX_FLOAT x = 0; 162 FX_FLOAT x = 0;
163 FX_FLOAT y = 0; 163 FX_FLOAT y = 0;
164 FX_FLOAT t = 0; 164 FX_FLOAT t = 0;
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 return m_pSubFocus; 440 return m_pSubFocus;
441 } 441 }
442 void CFWL_FormImp::SetSubFocus(CFWL_WidgetImp* pWidget) { 442 void CFWL_FormImp::SetSubFocus(CFWL_WidgetImp* pWidget) {
443 m_pSubFocus = pWidget; 443 m_pSubFocus = pWidget;
444 } 444 }
445 445
446 void CFWL_FormImp::ShowChildWidget(IFWL_Widget* pParent) { 446 void CFWL_FormImp::ShowChildWidget(IFWL_Widget* pParent) {
447 IFWL_App* pApp = FWL_GetApp(); 447 IFWL_App* pApp = FWL_GetApp();
448 if (!pApp) 448 if (!pApp)
449 return; 449 return;
450 CFWL_WidgetMgr* pWidgetMgr = 450
451 static_cast<CFWL_WidgetMgr*>(pApp->GetWidgetMgr()); 451 CFWL_WidgetMgr* pWidgetMgr = pApp->GetWidgetMgr();
452 if (!pWidgetMgr) 452 if (!pWidgetMgr)
453 return; 453 return;
454 IFWL_Widget* pChild = 454
455 pWidgetMgr->GetWidget(pParent, FWL_WGTRELATION_FirstChild); 455 IFWL_Widget* pChild = pWidgetMgr->GetFirstChildWidget(pParent);
456 while (pChild) { 456 while (pChild) {
457 ShowChildWidget(pChild); 457 ShowChildWidget(pChild);
458 pChild = pWidgetMgr->GetWidget(pChild, FWL_WGTRELATION_NextSibling); 458 pChild = pWidgetMgr->GetNextSiblingWidget(pChild);
459 } 459 }
460 } 460 }
461 461
462 void CFWL_FormImp::RemoveSysButtons() { 462 void CFWL_FormImp::RemoveSysButtons() {
463 m_rtCaption.Reset(); 463 m_rtCaption.Reset();
464 delete m_pCloseBox; 464 delete m_pCloseBox;
465 m_pCloseBox = nullptr; 465 m_pCloseBox = nullptr;
466 delete m_pMinBox; 466 delete m_pMinBox;
467 m_pMinBox = nullptr; 467 m_pMinBox = nullptr;
468 delete m_pMaxBox; 468 delete m_pMaxBox;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 void CFWL_FormImp::GetEdgeRect(CFX_RectF& rtEdge) { 609 void CFWL_FormImp::GetEdgeRect(CFX_RectF& rtEdge) {
610 rtEdge = m_rtRelative; 610 rtEdge = m_rtRelative;
611 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) { 611 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) {
612 FX_FLOAT fCX = GetBorderSize(); 612 FX_FLOAT fCX = GetBorderSize();
613 FX_FLOAT fCY = GetBorderSize(FALSE); 613 FX_FLOAT fCY = GetBorderSize(FALSE);
614 rtEdge.Deflate(fCX, m_rtCaption.Height(), fCX, fCY); 614 rtEdge.Deflate(fCX, m_rtCaption.Height(), fCX, fCY);
615 } 615 }
616 } 616 }
617 void CFWL_FormImp::SetWorkAreaRect() { 617 void CFWL_FormImp::SetWorkAreaRect() {
618 m_rtRestore = m_pProperties->m_rtWidget; 618 m_rtRestore = m_pProperties->m_rtWidget;
619 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 619 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance();
620 if (!pWidgetMgr) 620 if (!pWidgetMgr)
621 return; 621 return;
622 m_bSetMaximize = TRUE; 622 m_bSetMaximize = TRUE;
623 Repaint(&m_rtRelative); 623 Repaint(&m_rtRelative);
624 } 624 }
625 void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) {} 625 void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) {}
626 void CFWL_FormImp::Layout() { 626 void CFWL_FormImp::Layout() {
627 GetRelativeRect(m_rtRelative); 627 GetRelativeRect(m_rtRelative);
628 #ifndef FWL_UseMacSystemBorder 628 #ifndef FWL_UseMacSystemBorder
629 ReSetSysBtn(); 629 ReSetSysBtn();
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::SmallIcon)); 758 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::SmallIcon));
759 m_fBigIconSz = 759 m_fBigIconSz =
760 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::BigIcon)); 760 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::BigIcon));
761 } 761 }
762 FX_BOOL CFWL_FormImp::HasIcon() { 762 FX_BOOL CFWL_FormImp::HasIcon() {
763 IFWL_FormDP* pData = 763 IFWL_FormDP* pData =
764 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); 764 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
765 return !!pData->GetIcon(m_pInterface, FALSE); 765 return !!pData->GetIcon(m_pInterface, FALSE);
766 } 766 }
767 void CFWL_FormImp::UpdateIcon() { 767 void CFWL_FormImp::UpdateIcon() {
768 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 768 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance();
769 if (!pWidgetMgr) 769 if (!pWidgetMgr)
770 return; 770 return;
771 IFWL_FormDP* pData = 771 IFWL_FormDP* pData =
772 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); 772 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
773 CFX_DIBitmap* pBigIcon = pData->GetIcon(m_pInterface, TRUE); 773 CFX_DIBitmap* pBigIcon = pData->GetIcon(m_pInterface, TRUE);
774 CFX_DIBitmap* pSmallIcon = pData->GetIcon(m_pInterface, FALSE); 774 CFX_DIBitmap* pSmallIcon = pData->GetIcon(m_pInterface, FALSE);
775 if (pBigIcon) 775 if (pBigIcon)
776 m_pBigIcon = pBigIcon; 776 m_pBigIcon = pBigIcon;
777 if (pSmallIcon) 777 if (pSmallIcon)
778 m_pSmallIcon = pSmallIcon; 778 m_pSmallIcon = pSmallIcon;
779 } 779 }
780 void CFWL_FormImp::UpdateCaption() { 780 void CFWL_FormImp::UpdateCaption() {
781 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 781 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance();
782 if (!pWidgetMgr) 782 if (!pWidgetMgr)
783 return; 783 return;
784 IFWL_FormDP* pData = 784 IFWL_FormDP* pData =
785 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); 785 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
786 if (!pData) 786 if (!pData)
787 return; 787 return;
788 CFX_WideString text; 788 CFX_WideString text;
789 pData->GetCaption(m_pInterface, text); 789 pData->GetCaption(m_pInterface, text);
790 } 790 }
791 void CFWL_FormImp::DoWidthLimit(FX_FLOAT& fLeft, 791 void CFWL_FormImp::DoWidthLimit(FX_FLOAT& fLeft,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 case FWL_MouseCommand::LeftButtonDblClk: { 928 case FWL_MouseCommand::LeftButtonDblClk: {
929 OnLButtonDblClk(pMsg); 929 OnLButtonDblClk(pMsg);
930 break; 930 break;
931 } 931 }
932 default: 932 default:
933 break; 933 break;
934 } 934 }
935 break; 935 break;
936 } 936 }
937 case CFWL_MessageType::Size: { 937 case CFWL_MessageType::Size: {
938 CFWL_WidgetMgr* pWidgetMgr = 938 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance();
939 static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
940 if (!pWidgetMgr) 939 if (!pWidgetMgr)
941 return; 940 return;
942 941
943 pWidgetMgr->AddRedrawCounts(m_pOwner->m_pInterface); 942 pWidgetMgr->AddRedrawCounts(m_pOwner->m_pInterface);
944 if (!m_pOwner->m_bSetMaximize) 943 if (!m_pOwner->m_bSetMaximize)
945 break; 944 break;
946 945
947 m_pOwner->m_bSetMaximize = FALSE; 946 m_pOwner->m_bSetMaximize = FALSE;
948 CFWL_MsgSize* pMsg = static_cast<CFWL_MsgSize*>(pMessage); 947 CFWL_MsgSize* pMsg = static_cast<CFWL_MsgSize*>(pMessage);
949 m_pOwner->m_pProperties->m_rtWidget.left = 0; 948 m_pOwner->m_pProperties->m_rtWidget.left = 0;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 } 1121 }
1123 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) { 1122 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) {
1124 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx; 1123 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx;
1125 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy; 1124 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy;
1126 } 1125 }
1127 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) { 1126 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) {
1128 CFWL_EvtClose eClose; 1127 CFWL_EvtClose eClose;
1129 eClose.m_pSrcTarget = m_pOwner->m_pInterface; 1128 eClose.m_pSrcTarget = m_pOwner->m_pInterface;
1130 m_pOwner->DispatchEvent(&eClose); 1129 m_pOwner->DispatchEvent(&eClose);
1131 } 1130 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/fwl_appimp.cpp ('k') | xfa/fwl/core/fwl_noteimp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698