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 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2011 ZXing authors | 8 * Copyright 2011 ZXing authors |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/fxge/cfx_gemodule.h" | 29 #include "core/fxge/cfx_gemodule.h" |
30 #include "core/fxge/cfx_graphstatedata.h" | 30 #include "core/fxge/cfx_graphstatedata.h" |
31 #include "core/fxge/cfx_pathdata.h" | 31 #include "core/fxge/cfx_pathdata.h" |
32 #include "core/fxge/cfx_renderdevice.h" | 32 #include "core/fxge/cfx_renderdevice.h" |
33 #include "core/fxge/cfx_unicodeencodingex.h" | 33 #include "core/fxge/cfx_unicodeencodingex.h" |
34 #include "xfa/fxbarcode/BC_Writer.h" | 34 #include "xfa/fxbarcode/BC_Writer.h" |
35 #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" | 35 #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" |
36 | 36 |
37 CBC_OneDimWriter::CBC_OneDimWriter() { | 37 CBC_OneDimWriter::CBC_OneDimWriter() { |
38 m_locTextLoc = BC_TEXT_LOC_BELOWEMBED; | 38 m_locTextLoc = BC_TEXT_LOC_BELOWEMBED; |
39 m_bPrintChecksum = TRUE; | 39 m_bPrintChecksum = true; |
40 m_iDataLenth = 0; | 40 m_iDataLenth = 0; |
41 m_bCalcChecksum = FALSE; | 41 m_bCalcChecksum = false; |
42 m_pFont = nullptr; | 42 m_pFont = nullptr; |
43 m_fFontSize = 10; | 43 m_fFontSize = 10; |
44 m_iFontStyle = 0; | 44 m_iFontStyle = 0; |
45 m_fontColor = 0xff000000; | 45 m_fontColor = 0xff000000; |
46 m_iContentLen = 0; | 46 m_iContentLen = 0; |
47 m_bLeftPadding = FALSE; | 47 m_bLeftPadding = false; |
48 m_bRightPadding = FALSE; | 48 m_bRightPadding = false; |
49 } | 49 } |
50 | 50 |
51 CBC_OneDimWriter::~CBC_OneDimWriter() {} | 51 CBC_OneDimWriter::~CBC_OneDimWriter() {} |
52 | 52 |
53 void CBC_OneDimWriter::SetPrintChecksum(FX_BOOL checksum) { | 53 void CBC_OneDimWriter::SetPrintChecksum(bool checksum) { |
54 m_bPrintChecksum = checksum; | 54 m_bPrintChecksum = checksum; |
55 } | 55 } |
56 | 56 |
57 void CBC_OneDimWriter::SetDataLength(int32_t length) { | 57 void CBC_OneDimWriter::SetDataLength(int32_t length) { |
58 m_iDataLenth = length; | 58 m_iDataLenth = length; |
59 } | 59 } |
60 | 60 |
61 void CBC_OneDimWriter::SetCalcChecksum(FX_BOOL state) { | 61 void CBC_OneDimWriter::SetCalcChecksum(bool state) { |
62 m_bCalcChecksum = state; | 62 m_bCalcChecksum = state; |
63 } | 63 } |
64 | 64 |
65 FX_BOOL CBC_OneDimWriter::SetFont(CFX_Font* cFont) { | 65 bool CBC_OneDimWriter::SetFont(CFX_Font* cFont) { |
66 if (!cFont) | 66 if (!cFont) |
67 return FALSE; | 67 return false; |
68 | 68 |
69 m_pFont = cFont; | 69 m_pFont = cFont; |
70 return TRUE; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 void CBC_OneDimWriter::SetFontSize(FX_FLOAT size) { | 73 void CBC_OneDimWriter::SetFontSize(FX_FLOAT size) { |
74 m_fFontSize = size; | 74 m_fFontSize = size; |
75 } | 75 } |
76 | 76 |
77 void CBC_OneDimWriter::SetFontStyle(int32_t style) { | 77 void CBC_OneDimWriter::SetFontStyle(int32_t style) { |
78 m_iFontStyle = style; | 78 m_iFontStyle = style; |
79 } | 79 } |
80 | 80 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 380 } |
381 if (m_locTextLoc != BC_TEXT_LOC_NONE && i < contents.GetLength()) { | 381 if (m_locTextLoc != BC_TEXT_LOC_NONE && i < contents.GetLength()) { |
382 ShowChars(contents, nullptr, device, matrix, m_barWidth, m_multiple, e); | 382 ShowChars(contents, nullptr, device, matrix, m_barWidth, m_multiple, e); |
383 BC_EXCEPTION_CHECK_ReturnVoid(e); | 383 BC_EXCEPTION_CHECK_ReturnVoid(e); |
384 } | 384 } |
385 } | 385 } |
386 | 386 |
387 void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents, | 387 void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents, |
388 uint8_t* code, | 388 uint8_t* code, |
389 int32_t codeLength, | 389 int32_t codeLength, |
390 FX_BOOL isDevice, | 390 bool isDevice, |
391 int32_t& e) { | 391 int32_t& e) { |
392 if (codeLength < 1) { | 392 if (codeLength < 1) { |
393 BC_EXCEPTION_CHECK_ReturnVoid(e); | 393 BC_EXCEPTION_CHECK_ReturnVoid(e); |
394 } | 394 } |
395 if (m_ModuleHeight < 20.0) { | 395 if (m_ModuleHeight < 20.0) { |
396 m_ModuleHeight = 20; | 396 m_ModuleHeight = 20; |
397 } | 397 } |
398 int32_t codeOldLength = codeLength; | 398 int32_t codeOldLength = codeLength; |
399 int32_t leftPadding = 0; | 399 int32_t leftPadding = 0; |
400 int32_t rightPadding = 0; | 400 int32_t rightPadding = 0; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 m_output->SetRegion(outputX, 0, outputWidth - outputX, outputHeight, e); | 453 m_output->SetRegion(outputX, 0, outputWidth - outputX, outputHeight, e); |
454 break; | 454 break; |
455 } | 455 } |
456 m_output->SetRegion(outputX, 0, m_multiple, outputHeight, e); | 456 m_output->SetRegion(outputX, 0, m_multiple, outputHeight, e); |
457 BC_EXCEPTION_CHECK_ReturnVoid(e); | 457 BC_EXCEPTION_CHECK_ReturnVoid(e); |
458 } | 458 } |
459 outputX += m_multiple; | 459 outputX += m_multiple; |
460 } | 460 } |
461 } | 461 } |
462 | 462 |
463 FX_BOOL CBC_OneDimWriter::CheckContentValidity( | 463 bool CBC_OneDimWriter::CheckContentValidity(const CFX_WideStringC& contents) { |
464 const CFX_WideStringC& contents) { | 464 return true; |
465 return TRUE; | |
466 } | 465 } |
467 | 466 |
468 CFX_WideString CBC_OneDimWriter::FilterContents( | 467 CFX_WideString CBC_OneDimWriter::FilterContents( |
469 const CFX_WideStringC& contents) { | 468 const CFX_WideStringC& contents) { |
470 return CFX_WideString(); | 469 return CFX_WideString(); |
471 } | 470 } |
472 | 471 |
473 CFX_WideString CBC_OneDimWriter::RenderTextContents( | 472 CFX_WideString CBC_OneDimWriter::RenderTextContents( |
474 const CFX_WideStringC& contents) { | 473 const CFX_WideStringC& contents) { |
475 return CFX_WideString(); | 474 return CFX_WideString(); |
476 } | 475 } |
OLD | NEW |