| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "fpdfsdk/pdfwindow/PWL_ScrollBar.h" | 9 #include "fpdfsdk/pdfwindow/PWL_ScrollBar.h" |
| 10 #include "fpdfsdk/pdfwindow/PWL_Utils.h" | 10 #include "fpdfsdk/pdfwindow/PWL_Utils.h" |
| 11 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" | 11 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" |
| 12 | 12 |
| 13 static std::map<int32_t, CPWL_Timer*>& GetPWLTimeMap() { | 13 static std::map<int32_t, CPWL_Timer*>& GetPWLTimeMap() { |
| 14 // Leak the object at shutdown. | 14 // Leak the object at shutdown. |
| 15 static auto timeMap = new std::map<int32_t, CPWL_Timer*>; | 15 static auto timeMap = new std::map<int32_t, CPWL_Timer*>; |
| 16 return *timeMap; | 16 return *timeMap; |
| 17 } | 17 } |
| 18 | 18 |
| 19 PWL_CREATEPARAM::PWL_CREATEPARAM() |
| 20 : rcRectWnd(0, 0, 0, 0), |
| 21 pSystemHandler(nullptr), |
| 22 pFontMap(nullptr), |
| 23 pProvider(nullptr), |
| 24 pFocusHandler(nullptr), |
| 25 dwFlags(0), |
| 26 sBackgroundColor(), |
| 27 hAttachedWnd(nullptr), |
| 28 nBorderStyle(BorderStyle::SOLID), |
| 29 dwBorderWidth(1), |
| 30 sBorderColor(), |
| 31 sTextColor(), |
| 32 sTextStrokeColor(), |
| 33 nTransparency(255), |
| 34 fFontSize(PWL_DEFAULT_FONTSIZE), |
| 35 sDash(3, 0, 0), |
| 36 pAttachedData(nullptr), |
| 37 pParentWnd(nullptr), |
| 38 pMsgControl(nullptr), |
| 39 eCursorType(FXCT_ARROW), |
| 40 mtChild(1, 0, 0, 1, 0, 0) {} |
| 41 |
| 42 PWL_CREATEPARAM::PWL_CREATEPARAM(const PWL_CREATEPARAM& other) = default; |
| 43 |
| 19 CPWL_Timer::CPWL_Timer(CPWL_TimerHandler* pAttached, | 44 CPWL_Timer::CPWL_Timer(CPWL_TimerHandler* pAttached, |
| 20 CFX_SystemHandler* pSystemHandler) | 45 CFX_SystemHandler* pSystemHandler) |
| 21 : m_nTimerID(0), m_pAttached(pAttached), m_pSystemHandler(pSystemHandler) { | 46 : m_nTimerID(0), m_pAttached(pAttached), m_pSystemHandler(pSystemHandler) { |
| 22 ASSERT(m_pAttached); | 47 ASSERT(m_pAttached); |
| 23 ASSERT(m_pSystemHandler); | 48 ASSERT(m_pSystemHandler); |
| 24 } | 49 } |
| 25 | 50 |
| 26 CPWL_Timer::~CPWL_Timer() { | 51 CPWL_Timer::~CPWL_Timer() { |
| 27 KillPWLTimer(); | 52 KillPWLTimer(); |
| 28 } | 53 } |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 CFX_Matrix mt = GetChildMatrix(); | 948 CFX_Matrix mt = GetChildMatrix(); |
| 924 if (mt.IsIdentity()) | 949 if (mt.IsIdentity()) |
| 925 return rect; | 950 return rect; |
| 926 | 951 |
| 927 mt.SetReverse(mt); | 952 mt.SetReverse(mt); |
| 928 CFX_FloatRect rc = rect; | 953 CFX_FloatRect rc = rect; |
| 929 mt.TransformRect(rc); | 954 mt.TransformRect(rc); |
| 930 return rc; | 955 return rc; |
| 931 } | 956 } |
| 932 | 957 |
| 958 FX_FLOAT CPWL_Wnd::GetItemHeight(FX_FLOAT fLimitWidth) { |
| 959 return 0; |
| 960 } |
| 961 |
| 962 FX_FLOAT CPWL_Wnd::GetItemLeftMargin() { |
| 963 return 0; |
| 964 } |
| 965 |
| 966 FX_FLOAT CPWL_Wnd::GetItemRightMargin() { |
| 967 return 0; |
| 968 } |
| 969 |
| 933 CFX_Matrix CPWL_Wnd::GetChildToRoot() const { | 970 CFX_Matrix CPWL_Wnd::GetChildToRoot() const { |
| 934 CFX_Matrix mt(1, 0, 0, 1, 0, 0); | 971 CFX_Matrix mt(1, 0, 0, 1, 0, 0); |
| 935 if (HasFlag(PWS_CHILD)) { | 972 if (HasFlag(PWS_CHILD)) { |
| 936 const CPWL_Wnd* pParent = this; | 973 const CPWL_Wnd* pParent = this; |
| 937 while (pParent) { | 974 while (pParent) { |
| 938 mt.Concat(pParent->GetChildMatrix()); | 975 mt.Concat(pParent->GetChildMatrix()); |
| 939 pParent = pParent->GetParentWindow(); | 976 pParent = pParent->GetParentWindow(); |
| 940 } | 977 } |
| 941 } | 978 } |
| 942 return mt; | 979 return mt; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 return FALSE; | 1039 return FALSE; |
| 1003 } | 1040 } |
| 1004 | 1041 |
| 1005 FX_BOOL CPWL_Wnd::IsALTpressed(uint32_t nFlag) const { | 1042 FX_BOOL CPWL_Wnd::IsALTpressed(uint32_t nFlag) const { |
| 1006 if (CFX_SystemHandler* pSystemHandler = GetSystemHandler()) { | 1043 if (CFX_SystemHandler* pSystemHandler = GetSystemHandler()) { |
| 1007 return pSystemHandler->IsALTKeyDown(nFlag); | 1044 return pSystemHandler->IsALTKeyDown(nFlag); |
| 1008 } | 1045 } |
| 1009 | 1046 |
| 1010 return FALSE; | 1047 return FALSE; |
| 1011 } | 1048 } |
| OLD | NEW |