| 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/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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return; | 291 return; |
| 292 if (m_pIface->GetOuter()) { | 292 if (m_pIface->GetOuter()) { |
| 293 return; | 293 return; |
| 294 } | 294 } |
| 295 IFWL_Thread* pThread = m_pIface->GetOwnerThread(); | 295 IFWL_Thread* pThread = m_pIface->GetOwnerThread(); |
| 296 if (!pThread) | 296 if (!pThread) |
| 297 return; | 297 return; |
| 298 IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); | 298 IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); |
| 299 if (!pNoteDriver) | 299 if (!pNoteDriver) |
| 300 return; | 300 return; |
| 301 pNoteDriver->SendNote(pEvent); | 301 pNoteDriver->SendEvent(pEvent); |
| 302 } | 302 } |
| 303 | 303 |
| 304 #define FWL_WGT_CalcHeight 2048 | 304 #define FWL_WGT_CalcHeight 2048 |
| 305 #define FWL_WGT_CalcWidth 2048 | 305 #define FWL_WGT_CalcWidth 2048 |
| 306 #define FWL_WGT_CalcMultiLineDefWidth 120.0f | 306 #define FWL_WGT_CalcMultiLineDefWidth 120.0f |
| 307 | 307 |
| 308 CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText, | 308 CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText, |
| 309 FX_BOOL bMultiLine, | 309 FX_BOOL bMultiLine, |
| 310 int32_t iLineWidth) { | 310 int32_t iLineWidth) { |
| 311 if (!m_pIface) | 311 if (!m_pIface) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 322 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; | 322 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; |
| 323 CFX_RectF rect; | 323 CFX_RectF rect; |
| 324 FX_FLOAT fWidth = bMultiLine | 324 FX_FLOAT fWidth = bMultiLine |
| 325 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth | 325 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth |
| 326 : FWL_WGT_CalcMultiLineDefWidth) | 326 : FWL_WGT_CalcMultiLineDefWidth) |
| 327 : FWL_WGT_CalcWidth; | 327 : FWL_WGT_CalcWidth; |
| 328 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight); | 328 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight); |
| 329 pTheme->CalcTextRect(&calPart, rect); | 329 pTheme->CalcTextRect(&calPart, rect); |
| 330 return CFX_SizeF(rect.width, rect.height); | 330 return CFX_SizeF(rect.width, rect.height); |
| 331 } | 331 } |
| OLD | NEW |