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

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

Issue 2070583003: Make code compile with clang_use_chrome_plugin (part VI) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: better macros Created 4 years, 6 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_formimp.h ('k') | xfa/fwl/core/fwl_noteimp.h » ('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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 IFWL_Widget* IFWL_Form::DoModal(uint32_t& dwCommandID) { 57 IFWL_Widget* IFWL_Form::DoModal(uint32_t& dwCommandID) {
58 return static_cast<CFWL_FormImp*>(GetImpl())->DoModal(dwCommandID); 58 return static_cast<CFWL_FormImp*>(GetImpl())->DoModal(dwCommandID);
59 } 59 }
60 FWL_Error IFWL_Form::EndDoModal() { 60 FWL_Error IFWL_Form::EndDoModal() {
61 return static_cast<CFWL_FormImp*>(GetImpl())->EndDoModal(); 61 return static_cast<CFWL_FormImp*>(GetImpl())->EndDoModal();
62 } 62 }
63 FWL_Error IFWL_Form::SetBorderRegion(CFX_Path* pPath) { 63 FWL_Error IFWL_Form::SetBorderRegion(CFX_Path* pPath) {
64 return static_cast<CFWL_FormImp*>(GetImpl())->SetBorderRegion(pPath); 64 return static_cast<CFWL_FormImp*>(GetImpl())->SetBorderRegion(pPath);
65 } 65 }
66 66
67 RestoreResizeInfo::RestoreResizeInfo() {}
68
69 RestoreResizeInfo::~RestoreResizeInfo() {}
70
67 CFWL_FormImp::CFWL_FormImp(const CFWL_WidgetImpProperties& properties, 71 CFWL_FormImp::CFWL_FormImp(const CFWL_WidgetImpProperties& properties,
68 IFWL_Widget* pOuter) 72 IFWL_Widget* pOuter)
69 : CFWL_WidgetImp(properties, pOuter), 73 : CFWL_WidgetImp(properties, pOuter),
70 m_pCloseBox(nullptr), 74 m_pCloseBox(nullptr),
71 m_pMinBox(nullptr), 75 m_pMinBox(nullptr),
72 m_pMaxBox(nullptr), 76 m_pMaxBox(nullptr),
73 m_pCaptionBox(nullptr), 77 m_pCaptionBox(nullptr),
74 m_pNoteLoop(nullptr), 78 m_pNoteLoop(nullptr),
75 m_pSubFocus(nullptr), 79 m_pSubFocus(nullptr),
76 m_fCXBorder(0), 80 m_fCXBorder(0),
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 } 1125 }
1122 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) { 1126 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) {
1123 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx; 1127 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx;
1124 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy; 1128 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy;
1125 } 1129 }
1126 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) { 1130 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) {
1127 CFWL_EvtClose eClose; 1131 CFWL_EvtClose eClose;
1128 eClose.m_pSrcTarget = m_pOwner->m_pInterface; 1132 eClose.m_pSrcTarget = m_pOwner->m_pInterface;
1129 m_pOwner->DispatchEvent(&eClose); 1133 m_pOwner->DispatchEvent(&eClose);
1130 } 1134 }
1135
1136 CFWL_SysBtn::CFWL_SysBtn() {
1137 m_rtBtn.Set(0, 0, 0, 0);
1138 m_dwState = 0;
1139 }
1140
1141 bool CFWL_SysBtn::IsDisabled() const {
1142 return !!(m_dwState & FWL_SYSBUTTONSTATE_Disabled);
1143 }
1144
1145 void CFWL_SysBtn::SetNormal() {
1146 m_dwState &= 0xFFF0;
1147 }
1148
1149 void CFWL_SysBtn::SetPressed() {
1150 SetNormal();
1151 m_dwState |= FWL_SYSBUTTONSTATE_Pressed;
1152 }
1153
1154 void CFWL_SysBtn::SetHover() {
1155 SetNormal();
1156 m_dwState |= FWL_SYSBUTTONSTATE_Hover;
1157 }
1158
1159 void CFWL_SysBtn::SetDisabled(FX_BOOL bDisabled) {
1160 bDisabled ? m_dwState |= FWL_SYSBUTTONSTATE_Disabled
1161 : m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled;
1162 }
1163
1164 uint32_t CFWL_SysBtn::GetPartState() const {
1165 if (IsDisabled())
1166 return CFWL_PartState_Disabled;
1167 if (m_dwState & FWL_SYSBUTTONSTATE_Pressed)
1168 return CFWL_PartState_Pressed;
1169 if (m_dwState & FWL_SYSBUTTONSTATE_Hover)
1170 return CFWL_PartState_Hovered;
1171 return CFWL_PartState_Normal;
1172 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/fwl_formimp.h ('k') | xfa/fwl/core/fwl_noteimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698