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 "fpdfsdk/formfiller/cffl_formfiller.h" | 7 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
10 #include "fpdfsdk/formfiller/cba_fontmap.h" | 10 #include "fpdfsdk/formfiller/cba_fontmap.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 cp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0); | 317 cp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0); |
318 | 318 |
319 if (m_pWidget->GetTextColor(color)) { | 319 if (m_pWidget->GetTextColor(color)) { |
320 cp.sTextColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color)); | 320 cp.sTextColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color)); |
321 } | 321 } |
322 | 322 |
323 cp.fFontSize = m_pWidget->GetFontSize(); | 323 cp.fFontSize = m_pWidget->GetFontSize(); |
324 cp.dwBorderWidth = m_pWidget->GetBorderWidth(); | 324 cp.dwBorderWidth = m_pWidget->GetBorderWidth(); |
325 | 325 |
326 int nBorderStyle = m_pWidget->GetBorderStyle(); | 326 cp.nBorderStyle = m_pWidget->GetBorderStyle(); |
327 | 327 switch (cp.nBorderStyle) { |
328 switch (nBorderStyle) { | 328 case BorderStyle::DASH: |
329 case BBS_SOLID: | |
330 cp.nBorderStyle = PBS_SOLID; | |
331 break; | |
332 case BBS_DASH: | |
333 cp.nBorderStyle = PBS_DASH; | |
334 cp.sDash = CPWL_Dash(3, 3, 0); | 329 cp.sDash = CPWL_Dash(3, 3, 0); |
335 break; | 330 break; |
336 case BBS_BEVELED: | 331 case BorderStyle::BEVELED: |
337 cp.nBorderStyle = PBS_BEVELED; | |
338 cp.dwBorderWidth *= 2; | 332 cp.dwBorderWidth *= 2; |
339 break; | 333 break; |
340 case BBS_INSET: | 334 case BorderStyle::INSET: |
341 cp.nBorderStyle = PBS_INSET; | |
342 cp.dwBorderWidth *= 2; | 335 cp.dwBorderWidth *= 2; |
343 break; | 336 break; |
344 case BBS_UNDERLINE: | 337 default: |
345 cp.nBorderStyle = PBS_UNDERLINED; | |
346 break; | 338 break; |
347 } | 339 } |
348 | 340 |
349 if (cp.fFontSize <= 0) { | 341 if (cp.fFontSize <= 0) |
350 dwCreateFlags |= PWS_AUTOFONTSIZE; | 342 dwCreateFlags |= PWS_AUTOFONTSIZE; |
351 } | |
352 | 343 |
353 cp.dwFlags = dwCreateFlags; | 344 cp.dwFlags = dwCreateFlags; |
354 cp.pSystemHandler = m_pApp->GetSysHandler(); | 345 cp.pSystemHandler = m_pApp->GetSysHandler(); |
355 return cp; | 346 return cp; |
356 } | 347 } |
357 | 348 |
358 CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, | 349 CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, |
359 FX_BOOL bNew) { | 350 FX_BOOL bNew) { |
360 ASSERT(pPageView); | 351 ASSERT(pPageView); |
361 | 352 |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 710 } |
720 } | 711 } |
721 | 712 |
722 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, | 713 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, |
723 CPDFSDK_Annot* pAnnot, | 714 CPDFSDK_Annot* pAnnot, |
724 CFX_RenderDevice* pDevice, | 715 CFX_RenderDevice* pDevice, |
725 CFX_Matrix* pUser2Device, | 716 CFX_Matrix* pUser2Device, |
726 uint32_t dwFlags) { | 717 uint32_t dwFlags) { |
727 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 718 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
728 } | 719 } |
OLD | NEW |