| 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_INCLUDE_JAVASCRIPT_COLOR_H_ | 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ |
| 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ | 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ |
| 9 | 9 |
| 10 #include "JS_Define.h" | 10 #include "JS_Define.h" |
| 11 // TODO(tsepez): include CPWL_Color.h once its own IWYU is fixed. | 11 // TODO(tsepez): include CPWL_Color.h once its own IWYU is fixed. |
| 12 | 12 |
| 13 class color : public CJS_EmbedObj | 13 class color : public CJS_EmbedObj |
| 14 { | 14 { |
| 15 public: | 15 public: |
| 16 color(CJS_Object* pJSObject); | 16 color(CJS_Object* pJSObject); |
| 17 virtual ~color(void); | 17 virtual ~color(void); |
| 18 | 18 |
| 19 » FX_BOOL black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
or); | 19 » bool black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
; |
| 20 » FX_BOOL blue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
r); | 20 » bool blue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 21 » FX_BOOL cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
r); | 21 » bool cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 22 » FX_BOOL dkGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ror); | 22 » bool dkGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
); |
| 23 » FX_BOOL gray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
r); | 23 » bool gray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 24 » FX_BOOL green(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
or); | 24 » bool green(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
; |
| 25 » FX_BOOL ltGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ror); | 25 » bool ltGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
); |
| 26 » FX_BOOL magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
rror); | 26 » bool magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
r); |
| 27 » FX_BOOL red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
); | 27 » bool red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 28 » FX_BOOL transparent(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
& sError); | 28 » bool transparent(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
Error); |
| 29 » FX_BOOL white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
or); | 29 » bool white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
; |
| 30 » FX_BOOL yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ror); | 30 » bool yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
); |
| 31 | 31 |
| 32 » FX_BOOL convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, CFX_WideString& sError); | 32 » bool convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, CFX_WideString& sError); |
| 33 » FX_BOOL equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
& vRet, CFX_WideString& sError); | 33 » bool equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
Ret, CFX_WideString& sError); |
| 34 | 34 |
| 35 public: | 35 public: |
| 36 static void ConvertPWLColorToArray(const CPWL_Color& color,
CJS_Array& array); | 36 static void ConvertPWLColorToArray(const CPWL_Color& color,
CJS_Array& array); |
| 37 static void ConvertArrayToPWLColor(CJS_Array& array, CPWL_Co
lor& color); | 37 static void ConvertArrayToPWLColor(CJS_Array& array, CPWL_Co
lor& color); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 CPWL_Color m_crTransparent; | 40 CPWL_Color m_crTransparent; |
| 41 CPWL_Color m_crBlack; | 41 CPWL_Color m_crBlack; |
| 42 CPWL_Color m_crWhite; | 42 CPWL_Color m_crWhite; |
| 43 CPWL_Color m_crRed; | 43 CPWL_Color m_crRed; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 71 JS_STATIC_PROP(transparent, color); | 71 JS_STATIC_PROP(transparent, color); |
| 72 JS_STATIC_PROP(white, color); | 72 JS_STATIC_PROP(white, color); |
| 73 JS_STATIC_PROP(yellow, color); | 73 JS_STATIC_PROP(yellow, color); |
| 74 | 74 |
| 75 JS_STATIC_METHOD(convert,color); | 75 JS_STATIC_METHOD(convert,color); |
| 76 JS_STATIC_METHOD(equal,color); | 76 JS_STATIC_METHOD(equal,color); |
| 77 | 77 |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ | 80 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ |
| OLD | NEW |