| 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 #ifndef FPDFSDK_PDFWINDOW_PWL_UTILS_H_ | 7 #ifndef FPDFSDK_PDFWINDOW_PWL_UTILS_H_ |
| 8 #define FPDFSDK_PDFWINDOW_PWL_UTILS_H_ | 8 #define FPDFSDK_PDFWINDOW_PWL_UTILS_H_ |
| 9 | 9 |
| 10 #include "core/include/fpdfdoc/fpdf_vt.h" | 10 #include "core/fpdfdoc/include/cpvt_wordrange.h" |
| 11 #include "fpdfsdk/include/fxedit/fx_edit.h" | |
| 12 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" | 11 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" |
| 13 | 12 |
| 14 class CFX_PathData; | 13 class CFX_PathData; |
| 14 class IFX_Edit; |
| 15 |
| 15 struct CPWL_Color; | 16 struct CPWL_Color; |
| 16 | 17 |
| 17 template <class T> | 18 template <class T> |
| 18 T PWL_MIN(const T& i, const T& j) { | 19 T PWL_MIN(const T& i, const T& j) { |
| 19 return ((i < j) ? i : j); | 20 return ((i < j) ? i : j); |
| 20 } | 21 } |
| 21 template <class T> | 22 template <class T> |
| 22 T PWL_MAX(const T& i, const T& j) { | 23 T PWL_MAX(const T& i, const T& j) { |
| 23 return ((i > j) ? i : j); | 24 return ((i > j) ? i : j); |
| 24 } | 25 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 const CPWL_Color& crLeftTop, | 147 const CPWL_Color& crLeftTop, |
| 147 const CPWL_Color& crRightBottom, | 148 const CPWL_Color& crRightBottom, |
| 148 int32_t nStyle, | 149 int32_t nStyle, |
| 149 const CPWL_Dash& dash); | 150 const CPWL_Dash& dash); |
| 150 static CFX_ByteString GetRectFillAppStream(const CFX_FloatRect& rect, | 151 static CFX_ByteString GetRectFillAppStream(const CFX_FloatRect& rect, |
| 151 const CPWL_Color& color); | 152 const CPWL_Color& color); |
| 152 static CFX_ByteString GetCircleFillAppStream(const CFX_FloatRect& rect, | 153 static CFX_ByteString GetCircleFillAppStream(const CFX_FloatRect& rect, |
| 153 const CPWL_Color& color); | 154 const CPWL_Color& color); |
| 154 | 155 |
| 155 static CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox, | 156 static CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox, |
| 156 IFX_Edit_FontMap* pFontMap, | 157 IPVT_FontMap* pFontMap, |
| 157 CPDF_Stream* pIconStream, | 158 CPDF_Stream* pIconStream, |
| 158 CPDF_IconFit& IconFit, | 159 CPDF_IconFit& IconFit, |
| 159 const CFX_WideString& sLabel, | 160 const CFX_WideString& sLabel, |
| 160 const CPWL_Color& crText, | 161 const CPWL_Color& crText, |
| 161 FX_FLOAT fFontSize, | 162 FX_FLOAT fFontSize, |
| 162 int32_t nLayOut); | 163 int32_t nLayOut); |
| 163 static CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox, | 164 static CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox, |
| 164 int32_t nStyle, | 165 int32_t nStyle, |
| 165 const CPWL_Color& crText); | 166 const CPWL_Color& crText); |
| 166 static CFX_ByteString GetRadioButtonAppStream(const CFX_FloatRect& rcBBox, | 167 static CFX_ByteString GetRadioButtonAppStream(const CFX_FloatRect& rcBBox, |
| 167 int32_t nStyle, | 168 int32_t nStyle, |
| 168 const CPWL_Color& crText); | 169 const CPWL_Color& crText); |
| 169 | 170 |
| 170 static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, | 171 static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, |
| 171 const CFX_FloatPoint& ptOffset, | 172 const CFX_FloatPoint& ptOffset, |
| 172 const CPVT_WordRange* pRange = NULL, | 173 const CPVT_WordRange* pRange = NULL, |
| 173 FX_BOOL bContinuous = TRUE, | 174 FX_BOOL bContinuous = TRUE, |
| 174 uint16_t SubWord = 0); | 175 uint16_t SubWord = 0); |
| 175 static CFX_ByteString GetEditSelAppStream( | 176 static CFX_ByteString GetEditSelAppStream( |
| 176 IFX_Edit* pEdit, | 177 IFX_Edit* pEdit, |
| 177 const CFX_FloatPoint& ptOffset, | 178 const CFX_FloatPoint& ptOffset, |
| 178 const CPVT_WordRange* pRange = NULL); | 179 const CPVT_WordRange* pRange = NULL); |
| 179 static CFX_ByteString GetSpellCheckAppStream( | 180 static CFX_ByteString GetSpellCheckAppStream( |
| 180 IFX_Edit* pEdit, | 181 IFX_Edit* pEdit, |
| 181 IPWL_SpellCheck* pSpellCheck, | 182 IPWL_SpellCheck* pSpellCheck, |
| 182 const CFX_FloatPoint& ptOffset, | 183 const CFX_FloatPoint& ptOffset, |
| 183 const CPVT_WordRange* pRange = NULL); | 184 const CPVT_WordRange* pRange = NULL); |
| 184 static CFX_ByteString GetTextAppStream(const CFX_FloatRect& rcBBox, | 185 static CFX_ByteString GetTextAppStream(const CFX_FloatRect& rcBBox, |
| 185 IFX_Edit_FontMap* pFontMap, | 186 IPVT_FontMap* pFontMap, |
| 186 const CFX_WideString& sText, | 187 const CFX_WideString& sText, |
| 187 int32_t nAlignmentH, | 188 int32_t nAlignmentH, |
| 188 int32_t nAlignmentV, | 189 int32_t nAlignmentV, |
| 189 FX_FLOAT fFontSize, | 190 FX_FLOAT fFontSize, |
| 190 FX_BOOL bMultiLine, | 191 FX_BOOL bMultiLine, |
| 191 FX_BOOL bAutoReturn, | 192 FX_BOOL bAutoReturn, |
| 192 const CPWL_Color& crText); | 193 const CPWL_Color& crText); |
| 193 static CFX_ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox); | 194 static CFX_ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox); |
| 194 | 195 |
| 195 static void DrawFillRect(CFX_RenderDevice* pDevice, | 196 static void DrawFillRect(CFX_RenderDevice* pDevice, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 CFX_PathData& path, | 404 CFX_PathData& path, |
| 404 const CFX_FloatRect& crBBox, | 405 const CFX_FloatRect& crBBox, |
| 405 const PWL_PATH_TYPE type); | 406 const PWL_PATH_TYPE type); |
| 406 static void GetGraphics_Foxit(CFX_ByteString& sPathData, | 407 static void GetGraphics_Foxit(CFX_ByteString& sPathData, |
| 407 CFX_PathData& path, | 408 CFX_PathData& path, |
| 408 const CFX_FloatRect& crBBox, | 409 const CFX_FloatRect& crBBox, |
| 409 const PWL_PATH_TYPE type); | 410 const PWL_PATH_TYPE type); |
| 410 }; | 411 }; |
| 411 | 412 |
| 412 #endif // FPDFSDK_PDFWINDOW_PWL_UTILS_H_ | 413 #endif // FPDFSDK_PDFWINDOW_PWL_UTILS_H_ |
| OLD | NEW |