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 "../../include/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
8 #include "../../include/javascript/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
10 #include "../../include/javascript/JS_Object.h" | 10 #include "../../include/javascript/JS_Object.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 m_crGreen = CPWL_Color(COLORTYPE_RGB, 0, 1, 0); | 58 m_crGreen = CPWL_Color(COLORTYPE_RGB, 0, 1, 0); |
59 m_crBlue = CPWL_Color(COLORTYPE_RGB, 0, 0, 1); | 59 m_crBlue = CPWL_Color(COLORTYPE_RGB, 0, 0, 1); |
60 m_crCyan = CPWL_Color(COLORTYPE_CMYK, 1, 0, 0, 0); | 60 m_crCyan = CPWL_Color(COLORTYPE_CMYK, 1, 0, 0, 0); |
61 m_crMagenta = CPWL_Color(COLORTYPE_CMYK, 0, 1, 0, 0); | 61 m_crMagenta = CPWL_Color(COLORTYPE_CMYK, 0, 1, 0, 0); |
62 m_crYellow = CPWL_Color(COLORTYPE_CMYK, 0, 0, 1, 0); | 62 m_crYellow = CPWL_Color(COLORTYPE_CMYK, 0, 0, 1, 0); |
63 m_crDKGray = CPWL_Color(COLORTYPE_GRAY, 0.25); | 63 m_crDKGray = CPWL_Color(COLORTYPE_GRAY, 0.25); |
64 m_crGray = CPWL_Color(COLORTYPE_GRAY, 0.5); | 64 m_crGray = CPWL_Color(COLORTYPE_GRAY, 0.5); |
65 m_crLTGray = CPWL_Color(COLORTYPE_GRAY, 0.75); | 65 m_crLTGray = CPWL_Color(COLORTYPE_GRAY, 0.75); |
66 } | 66 } |
67 | 67 |
68 color::~color(void) {} | 68 color::~color() { |
| 69 } |
69 | 70 |
70 void color::ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array) { | 71 void color::ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array) { |
71 switch (color.nColorType) { | 72 switch (color.nColorType) { |
72 case COLORTYPE_TRANSPARENT: | 73 case COLORTYPE_TRANSPARENT: |
73 array.SetElement(0, CJS_Value(array.GetIsolate(), "T")); | 74 array.SetElement(0, CJS_Value(array.GetIsolate(), "T")); |
74 break; | 75 break; |
75 case COLORTYPE_GRAY: | 76 case COLORTYPE_GRAY: |
76 array.SetElement(0, CJS_Value(array.GetIsolate(), "G")); | 77 array.SetElement(0, CJS_Value(array.GetIsolate(), "G")); |
77 array.SetElement(1, CJS_Value(array.GetIsolate(), color.fColor1)); | 78 array.SetElement(1, CJS_Value(array.GetIsolate(), color.fColor1)); |
78 break; | 79 break; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 CPWL_Color color2; | 226 CPWL_Color color2; |
226 | 227 |
227 ConvertArrayToPWLColor(array1, color1); | 228 ConvertArrayToPWLColor(array1, color1); |
228 ConvertArrayToPWLColor(array2, color2); | 229 ConvertArrayToPWLColor(array2, color2); |
229 | 230 |
230 color1.ConvertColorType(color2.nColorType); | 231 color1.ConvertColorType(color2.nColorType); |
231 | 232 |
232 vRet = color1 == color2; | 233 vRet = color1 == color2; |
233 return TRUE; | 234 return TRUE; |
234 } | 235 } |
OLD | NEW |