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/src/fwl/src/core/fwl_formimp.h" | 7 #include "xfa/src/fwl/core/fwl_formimp.h" |
8 | 8 |
9 #include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" | 9 #include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" |
10 #include "xfa/include/fwl/core/fwl_app.h" | 10 #include "xfa/include/fwl/core/fwl_app.h" |
11 #include "xfa/include/fwl/core/fwl_content.h" | 11 #include "xfa/include/fwl/core/fwl_content.h" |
12 #include "xfa/include/fwl/core/fwl_theme.h" | 12 #include "xfa/include/fwl/core/fwl_theme.h" |
13 #include "xfa/src/fdp/include/fde_tto.h" | 13 #include "xfa/src/fdp/include/fde_tto.h" |
14 #include "xfa/src/fwl/src/basewidget/fwl_formproxyimp.h" | 14 #include "xfa/src/fwl/basewidget/fwl_formproxyimp.h" |
15 #include "xfa/src/fwl/src/core/fwl_appimp.h" | 15 #include "xfa/src/fwl/core/fwl_appimp.h" |
16 #include "xfa/src/fwl/src/core/fwl_noteimp.h" | 16 #include "xfa/src/fwl/core/fwl_noteimp.h" |
17 #include "xfa/src/fwl/src/core/fwl_panelimp.h" | 17 #include "xfa/src/fwl/core/fwl_panelimp.h" |
18 #include "xfa/src/fwl/src/core/fwl_targetimp.h" | 18 #include "xfa/src/fwl/core/fwl_targetimp.h" |
19 #include "xfa/src/fwl/src/core/fwl_threadimp.h" | 19 #include "xfa/src/fwl/core/fwl_threadimp.h" |
20 #include "xfa/src/fwl/src/core/fwl_widgetimp.h" | 20 #include "xfa/src/fwl/core/fwl_widgetimp.h" |
21 #include "xfa/src/fwl/src/core/fwl_widgetmgrimp.h" | 21 #include "xfa/src/fwl/core/fwl_widgetmgrimp.h" |
22 | 22 |
23 #define FWL_SYSBTNSIZE 21 | 23 #define FWL_SYSBTNSIZE 21 |
24 #define FWL_SYSBTNMARGIN 5 | 24 #define FWL_SYSBTNMARGIN 5 |
25 #define FWL_SYSBTNSPAN 2 | 25 #define FWL_SYSBTNSPAN 2 |
26 #define FWL_CornerEnlarge 10 | 26 #define FWL_CornerEnlarge 10 |
27 | 27 |
28 // static | 28 // static |
29 IFWL_Form* IFWL_Form::CreateFormProxy(CFWL_WidgetImpProperties& properties, | 29 IFWL_Form* IFWL_Form::CreateFormProxy(CFWL_WidgetImpProperties& properties, |
30 CFX_WideString* classname, | 30 CFX_WideString* classname, |
31 IFWL_Widget* pOuter) { | 31 IFWL_Widget* pOuter) { |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 640 } |
641 void CFWL_FormImp::SetWorkAreaRect() { | 641 void CFWL_FormImp::SetWorkAreaRect() { |
642 m_rtRestore = m_pProperties->m_rtWidget; | 642 m_rtRestore = m_pProperties->m_rtWidget; |
643 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); | 643 CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
644 if (!pWidgetMgr) | 644 if (!pWidgetMgr) |
645 return; | 645 return; |
646 m_bSetMaximize = TRUE; | 646 m_bSetMaximize = TRUE; |
647 pWidgetMgr->SetMaximize_Native(m_pInterface); | 647 pWidgetMgr->SetMaximize_Native(m_pInterface); |
648 Repaint(&m_rtRelative); | 648 Repaint(&m_rtRelative); |
649 } | 649 } |
650 void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) { | 650 void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) {} |
651 } | |
652 void CFWL_FormImp::Layout() { | 651 void CFWL_FormImp::Layout() { |
653 GetRelativeRect(m_rtRelative); | 652 GetRelativeRect(m_rtRelative); |
654 #ifndef FWL_UseMacSystemBorder | 653 #ifndef FWL_UseMacSystemBorder |
655 ReSetSysBtn(); | 654 ReSetSysBtn(); |
656 #endif | 655 #endif |
657 if (m_pContent) { | 656 if (m_pContent) { |
658 CFX_RectF rtClient; | 657 CFX_RectF rtClient; |
659 GetClientRect(rtClient); | 658 GetClientRect(rtClient); |
660 m_pContent->SetWidgetRect(rtClient); | 659 m_pContent->SetWidgetRect(rtClient); |
661 m_pContent->Update(); | 660 m_pContent->Update(); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 if (fTemp < fLimitMin && fHeight > fLimitMin) { | 863 if (fTemp < fLimitMin && fHeight > fLimitMin) { |
865 fTop += bTop ? (fHeight - fLimitMin) : 0; | 864 fTop += bTop ? (fHeight - fLimitMin) : 0; |
866 fHeight = fLimitMin; | 865 fHeight = fLimitMin; |
867 } else if (fTemp > fLimitMax && fHeight < fLimitMax) { | 866 } else if (fTemp > fLimitMax && fHeight < fLimitMax) { |
868 fTop -= bTop ? (fLimitMax - fHeight) : 0; | 867 fTop -= bTop ? (fLimitMax - fHeight) : 0; |
869 fHeight = fLimitMax; | 868 fHeight = fLimitMax; |
870 } | 869 } |
871 } | 870 } |
872 } | 871 } |
873 CFWL_FormImpDelegate::CFWL_FormImpDelegate(CFWL_FormImp* pOwner) | 872 CFWL_FormImpDelegate::CFWL_FormImpDelegate(CFWL_FormImp* pOwner) |
874 : m_pOwner(pOwner) { | 873 : m_pOwner(pOwner) {} |
875 } | |
876 int32_t CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 874 int32_t CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
877 #ifdef FWL_UseMacSystemBorder | 875 #ifdef FWL_UseMacSystemBorder |
878 if (!pMessage) | 876 if (!pMessage) |
879 return 0; | 877 return 0; |
880 FX_DWORD dwMsgCode = pMessage->GetClassID(); | 878 FX_DWORD dwMsgCode = pMessage->GetClassID(); |
881 switch (dwMsgCode) { | 879 switch (dwMsgCode) { |
882 case FWL_MSGHASH_Activate: { | 880 case FWL_MSGHASH_Activate: { |
883 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated; | 881 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated; |
884 m_pOwner->Repaint(&m_pOwner->m_rtRelative); | 882 m_pOwner->Repaint(&m_pOwner->m_rtRelative); |
885 break; | 883 break; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 eClose.m_pSrcTarget = m_pOwner->m_pInterface; | 1166 eClose.m_pSrcTarget = m_pOwner->m_pInterface; |
1169 m_pOwner->DispatchEvent(&eClose); | 1167 m_pOwner->DispatchEvent(&eClose); |
1170 } | 1168 } |
1171 FWL_ERR FWL_Accelerator_SetForm(IFWL_Form* pFrom, | 1169 FWL_ERR FWL_Accelerator_SetForm(IFWL_Form* pFrom, |
1172 CFX_MapAccelerators* pMapAccel) { | 1170 CFX_MapAccelerators* pMapAccel) { |
1173 CFWL_FormImp* pImp = static_cast<CFWL_FormImp*>(pFrom->GetImpl()); | 1171 CFWL_FormImp* pImp = static_cast<CFWL_FormImp*>(pFrom->GetImpl()); |
1174 if (!pImp) | 1172 if (!pImp) |
1175 return FWL_ERR_Indefinite; | 1173 return FWL_ERR_Indefinite; |
1176 return FWL_ERR_Succeeded; | 1174 return FWL_ERR_Succeeded; |
1177 } | 1175 } |
OLD | NEW |