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

Side by Side Diff: xfa/fwl/lightwidget/cfwl_widget.cpp

Issue 2010923002: Add opaque "layout item" to widgets for caller's use. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Cast to FFWidget. 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/lightwidget/cfwl_widget.h ('k') | xfa/fxfa/app/xfa_ffbarcode.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/lightwidget/cfwl_widget.h" 7 #include "xfa/fwl/lightwidget/cfwl_widget.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/core/cfwl_themetext.h" 10 #include "xfa/fwl/core/cfwl_themetext.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return 0; 117 return 0;
118 return m_pIface->GetStylesEx(); 118 return m_pIface->GetStylesEx();
119 } 119 }
120 120
121 FWL_Error CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, 121 FWL_Error CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded,
122 uint32_t dwStylesExRemoved) { 122 uint32_t dwStylesExRemoved) {
123 return m_pIface->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); 123 return m_pIface->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
124 } 124 }
125 125
126 uint32_t CFWL_Widget::GetStates() { 126 uint32_t CFWL_Widget::GetStates() {
127 if (!m_pIface) 127 return m_pIface ? m_pIface->GetStates() : 0;
128 return 0;
129 return m_pIface->GetStates();
130 } 128 }
131 129
132 void CFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) { 130 void CFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) {
133 if (m_pIface) 131 if (m_pIface)
134 m_pIface->SetStates(dwStates, bSet); 132 m_pIface->SetStates(dwStates, bSet);
135 } 133 }
136 134
135 void* CFWL_Widget::GetLayoutItem() const {
136 return m_pIface ? m_pIface->GetLayoutItem() : nullptr;
137 }
138
139 void CFWL_Widget::SetLayoutItem(void* pItem) {
140 if (m_pIface)
141 m_pIface->SetLayoutItem(pItem);
142 }
143
137 FWL_Error CFWL_Widget::SetPrivateData(void* module_id, 144 FWL_Error CFWL_Widget::SetPrivateData(void* module_id,
138 void* pData, 145 void* pData,
139 PD_CALLBACK_FREEDATA callback) { 146 PD_CALLBACK_FREEDATA callback) {
140 if (!m_pIface) 147 if (!m_pIface)
141 return FWL_Error::Indefinite; 148 return FWL_Error::Indefinite;
142 return m_pIface->SetPrivateData(module_id, pData, callback); 149 return m_pIface->SetPrivateData(module_id, pData, callback);
143 } 150 }
144 151
145 void* CFWL_Widget::GetPrivateData(void* module_id) { 152 void* CFWL_Widget::GetPrivateData(void* module_id) {
146 if (!m_pIface) 153 if (!m_pIface)
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; 341 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft;
335 CFX_RectF rect; 342 CFX_RectF rect;
336 FX_FLOAT fWidth = bMultiLine 343 FX_FLOAT fWidth = bMultiLine
337 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth 344 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth
338 : FWL_WGT_CalcMultiLineDefWidth) 345 : FWL_WGT_CalcMultiLineDefWidth)
339 : FWL_WGT_CalcWidth; 346 : FWL_WGT_CalcWidth;
340 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight); 347 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight);
341 pTheme->CalcTextRect(&calPart, rect); 348 pTheme->CalcTextRect(&calPart, rect);
342 return CFX_SizeF(rect.width, rect.height); 349 return CFX_SizeF(rect.width, rect.height);
343 } 350 }
OLDNEW
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_widget.h ('k') | xfa/fxfa/app/xfa_ffbarcode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698