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

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: 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
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 598 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 =
620 static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
620 if (!pWidgetMgr) 621 if (!pWidgetMgr)
621 return; 622 return;
622 m_bSetMaximize = TRUE; 623 m_bSetMaximize = TRUE;
623 Repaint(&m_rtRelative); 624 Repaint(&m_rtRelative);
624 } 625 }
625 void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) {} 626 void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) {}
626 void CFWL_FormImp::Layout() { 627 void CFWL_FormImp::Layout() {
627 GetRelativeRect(m_rtRelative); 628 GetRelativeRect(m_rtRelative);
628 #ifndef FWL_UseMacSystemBorder 629 #ifndef FWL_UseMacSystemBorder
629 ReSetSysBtn(); 630 ReSetSysBtn();
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::SmallIcon)); 759 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::SmallIcon));
759 m_fBigIconSz = 760 m_fBigIconSz =
760 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::BigIcon)); 761 *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::BigIcon));
761 } 762 }
762 FX_BOOL CFWL_FormImp::HasIcon() { 763 FX_BOOL CFWL_FormImp::HasIcon() {
763 IFWL_FormDP* pData = 764 IFWL_FormDP* pData =
764 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); 765 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
765 return !!pData->GetIcon(m_pInterface, FALSE); 766 return !!pData->GetIcon(m_pInterface, FALSE);
766 } 767 }
767 void CFWL_FormImp::UpdateIcon() { 768 void CFWL_FormImp::UpdateIcon() {
768 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 769 CFWL_WidgetMgr* pWidgetMgr =
770 static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
769 if (!pWidgetMgr) 771 if (!pWidgetMgr)
770 return; 772 return;
771 IFWL_FormDP* pData = 773 IFWL_FormDP* pData =
772 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); 774 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
773 CFX_DIBitmap* pBigIcon = pData->GetIcon(m_pInterface, TRUE); 775 CFX_DIBitmap* pBigIcon = pData->GetIcon(m_pInterface, TRUE);
774 CFX_DIBitmap* pSmallIcon = pData->GetIcon(m_pInterface, FALSE); 776 CFX_DIBitmap* pSmallIcon = pData->GetIcon(m_pInterface, FALSE);
775 if (pBigIcon) 777 if (pBigIcon)
776 m_pBigIcon = pBigIcon; 778 m_pBigIcon = pBigIcon;
777 if (pSmallIcon) 779 if (pSmallIcon)
778 m_pSmallIcon = pSmallIcon; 780 m_pSmallIcon = pSmallIcon;
779 } 781 }
780 void CFWL_FormImp::UpdateCaption() { 782 void CFWL_FormImp::UpdateCaption() {
781 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 783 CFWL_WidgetMgr* pWidgetMgr =
784 static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
782 if (!pWidgetMgr) 785 if (!pWidgetMgr)
783 return; 786 return;
784 IFWL_FormDP* pData = 787 IFWL_FormDP* pData =
785 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); 788 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
786 if (!pData) 789 if (!pData)
787 return; 790 return;
788 CFX_WideString text; 791 CFX_WideString text;
789 pData->GetCaption(m_pInterface, text); 792 pData->GetCaption(m_pInterface, text);
790 } 793 }
791 void CFWL_FormImp::DoWidthLimit(FX_FLOAT& fLeft, 794 void CFWL_FormImp::DoWidthLimit(FX_FLOAT& fLeft,
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 OnLButtonDblClk(pMsg); 932 OnLButtonDblClk(pMsg);
930 break; 933 break;
931 } 934 }
932 default: 935 default:
933 break; 936 break;
934 } 937 }
935 break; 938 break;
936 } 939 }
937 case CFWL_MessageType::Size: { 940 case CFWL_MessageType::Size: {
938 CFWL_WidgetMgr* pWidgetMgr = 941 CFWL_WidgetMgr* pWidgetMgr =
939 static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 942 static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
940 if (!pWidgetMgr) 943 if (!pWidgetMgr)
941 return; 944 return;
942 945
943 pWidgetMgr->AddRedrawCounts(m_pOwner->m_pInterface); 946 pWidgetMgr->AddRedrawCounts(m_pOwner->m_pInterface);
944 if (!m_pOwner->m_bSetMaximize) 947 if (!m_pOwner->m_bSetMaximize)
945 break; 948 break;
946 949
947 m_pOwner->m_bSetMaximize = FALSE; 950 m_pOwner->m_bSetMaximize = FALSE;
948 CFWL_MsgSize* pMsg = static_cast<CFWL_MsgSize*>(pMessage); 951 CFWL_MsgSize* pMsg = static_cast<CFWL_MsgSize*>(pMessage);
949 m_pOwner->m_pProperties->m_rtWidget.left = 0; 952 m_pOwner->m_pProperties->m_rtWidget.left = 0;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 } 1125 }
1123 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) { 1126 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) {
1124 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx; 1127 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx;
1125 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy; 1128 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy;
1126 } 1129 }
1127 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) { 1130 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) {
1128 CFWL_EvtClose eClose; 1131 CFWL_EvtClose eClose;
1129 eClose.m_pSrcTarget = m_pOwner->m_pInterface; 1132 eClose.m_pSrcTarget = m_pOwner->m_pInterface;
1130 m_pOwner->DispatchEvent(&eClose); 1133 m_pOwner->DispatchEvent(&eClose);
1131 } 1134 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698