| 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/basewidget/fwl_editimp.h" | 7 #include "xfa/fwl/basewidget/fwl_editimp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "third_party/base/stl_util.h" | 13 #include "third_party/base/stl_util.h" |
| 14 #include "xfa/fde/cfde_txtedtengine.h" | 14 #include "xfa/fde/cfde_txtedtengine.h" |
| 15 #include "xfa/fde/fde_gedevice.h" | 15 #include "xfa/fde/fde_gedevice.h" |
| 16 #include "xfa/fde/fde_render.h" | 16 #include "xfa/fde/fde_render.h" |
| 17 #include "xfa/fde/ifde_txtedtpage.h" | 17 #include "xfa/fde/ifde_txtedtpage.h" |
| 18 #include "xfa/fgas/font/fgas_gefont.h" |
| 18 #include "xfa/fwl/basewidget/fwl_caretimp.h" | 19 #include "xfa/fwl/basewidget/fwl_caretimp.h" |
| 19 #include "xfa/fwl/basewidget/fwl_comboboximp.h" | 20 #include "xfa/fwl/basewidget/fwl_comboboximp.h" |
| 20 #include "xfa/fwl/basewidget/fwl_scrollbarimp.h" | 21 #include "xfa/fwl/basewidget/fwl_scrollbarimp.h" |
| 21 #include "xfa/fwl/basewidget/ifwl_caret.h" | 22 #include "xfa/fwl/basewidget/ifwl_caret.h" |
| 22 #include "xfa/fwl/basewidget/ifwl_datetimepicker.h" | 23 #include "xfa/fwl/basewidget/ifwl_datetimepicker.h" |
| 23 #include "xfa/fwl/core/cfwl_message.h" | 24 #include "xfa/fwl/core/cfwl_message.h" |
| 24 #include "xfa/fwl/core/cfwl_themebackground.h" | 25 #include "xfa/fwl/core/cfwl_themebackground.h" |
| 25 #include "xfa/fwl/core/cfwl_themepart.h" | 26 #include "xfa/fwl/core/cfwl_themepart.h" |
| 26 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 27 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
| 27 #include "xfa/fwl/core/fwl_appimp.h" | 28 #include "xfa/fwl/core/fwl_appimp.h" |
| (...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 uint32_t* pFontColor = | 1188 uint32_t* pFontColor = |
| 1188 static_cast<uint32_t*>(GetThemeCapacity(CFWL_WidgetCapacity::TextColor)); | 1189 static_cast<uint32_t*>(GetThemeCapacity(CFWL_WidgetCapacity::TextColor)); |
| 1189 if (!pFontColor) | 1190 if (!pFontColor) |
| 1190 return; | 1191 return; |
| 1191 params.dwFontColor = *pFontColor; | 1192 params.dwFontColor = *pFontColor; |
| 1192 FX_FLOAT* pLineHeight = | 1193 FX_FLOAT* pLineHeight = |
| 1193 static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::LineHeight)); | 1194 static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::LineHeight)); |
| 1194 if (!pLineHeight) | 1195 if (!pLineHeight) |
| 1195 return; | 1196 return; |
| 1196 params.fLineSpace = *pLineHeight; | 1197 params.fLineSpace = *pLineHeight; |
| 1197 IFX_Font* pFont = | 1198 CFX_GEFont* pFont = |
| 1198 static_cast<IFX_Font*>(GetThemeCapacity(CFWL_WidgetCapacity::Font)); | 1199 static_cast<CFX_GEFont*>(GetThemeCapacity(CFWL_WidgetCapacity::Font)); |
| 1199 if (!pFont) | 1200 if (!pFont) |
| 1200 return; | 1201 return; |
| 1201 params.pFont = pFont; | 1202 params.pFont = pFont; |
| 1202 params.fFontSize = m_fFontSize; | 1203 params.fFontSize = m_fFontSize; |
| 1203 params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace); | 1204 params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace); |
| 1204 if (params.nLineCount <= 0) { | 1205 if (params.nLineCount <= 0) { |
| 1205 params.nLineCount = 1; | 1206 params.nLineCount = 1; |
| 1206 } | 1207 } |
| 1207 params.fTabWidth = params.fFontSize * 1; | 1208 params.fTabWidth = params.fFontSize * 1; |
| 1208 params.bTabEquidistant = TRUE; | 1209 params.bTabEquidistant = TRUE; |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2186 } | 2187 } |
| 2187 CFX_RectF rect; | 2188 CFX_RectF rect; |
| 2188 m_pOwner->GetWidgetRect(rect); | 2189 m_pOwner->GetWidgetRect(rect); |
| 2189 CFX_RectF rtInvalidate; | 2190 CFX_RectF rtInvalidate; |
| 2190 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 2191 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
| 2191 m_pOwner->Repaint(&rtInvalidate); | 2192 m_pOwner->Repaint(&rtInvalidate); |
| 2192 } | 2193 } |
| 2193 return TRUE; | 2194 return TRUE; |
| 2194 } | 2195 } |
| 2195 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} | 2196 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} |
| OLD | NEW |