| 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 public: |
| 15 public: | 15 color(CJS_Object* pJSObject); |
| 16 » color(CJS_Object* pJSObject); | 16 virtual ~color(void); |
| 17 » virtual ~color(void); | |
| 18 | 17 |
| 19 » FX_BOOL black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
or); | 18 FX_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); | 19 FX_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); | 20 FX_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); | 21 FX_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); | 22 FX_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); | 23 FX_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); | 24 FX_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); | 25 FX_BOOL magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 27 » FX_BOOL red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
); | 26 FX_BOOL red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 28 » FX_BOOL transparent(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
& sError); | 27 FX_BOOL transparent(IFXJS_Context* cc, |
| 29 » FX_BOOL white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
or); | 28 CJS_PropValue& vp, |
| 30 » FX_BOOL yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ror); | 29 CFX_WideString& sError); |
| 30 FX_BOOL white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 31 FX_BOOL yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 31 | 32 |
| 32 » FX_BOOL convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, CFX_WideString& sError); | 33 FX_BOOL convert(IFXJS_Context* cc, |
| 33 » FX_BOOL equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
& vRet, CFX_WideString& sError); | 34 const CJS_Parameters& params, |
| 35 CJS_Value& vRet, |
| 36 CFX_WideString& sError); |
| 37 FX_BOOL equal(IFXJS_Context* cc, |
| 38 const CJS_Parameters& params, |
| 39 CJS_Value& vRet, |
| 40 CFX_WideString& sError); |
| 34 | 41 |
| 35 public: | 42 public: |
| 36 » static void» » ConvertPWLColorToArray(const CPWL_Color& color,
CJS_Array& array); | 43 static void ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array); |
| 37 » static void» » ConvertArrayToPWLColor(CJS_Array& array, CPWL_Co
lor& color); | 44 static void ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color); |
| 38 | 45 |
| 39 private: | 46 private: |
| 40 » CPWL_Color» » m_crTransparent; | 47 CPWL_Color m_crTransparent; |
| 41 » CPWL_Color» » m_crBlack; | 48 CPWL_Color m_crBlack; |
| 42 » CPWL_Color» » m_crWhite; | 49 CPWL_Color m_crWhite; |
| 43 » CPWL_Color» » m_crRed; | 50 CPWL_Color m_crRed; |
| 44 » CPWL_Color» » m_crGreen; | 51 CPWL_Color m_crGreen; |
| 45 » CPWL_Color» » m_crBlue; | 52 CPWL_Color m_crBlue; |
| 46 » CPWL_Color» » m_crCyan; | 53 CPWL_Color m_crCyan; |
| 47 » CPWL_Color» » m_crMagenta; | 54 CPWL_Color m_crMagenta; |
| 48 » CPWL_Color» » m_crYellow; | 55 CPWL_Color m_crYellow; |
| 49 » CPWL_Color» » m_crDKGray; | 56 CPWL_Color m_crDKGray; |
| 50 » CPWL_Color» » m_crGray; | 57 CPWL_Color m_crGray; |
| 51 » CPWL_Color» » m_crLTGray; | 58 CPWL_Color m_crLTGray; |
| 52 }; | 59 }; |
| 53 | 60 |
| 54 class CJS_Color : public CJS_Object | 61 class CJS_Color : public CJS_Object { |
| 55 { | 62 public: |
| 56 public: | 63 CJS_Color(JSFXObject pObject) : CJS_Object(pObject){}; |
| 57 » CJS_Color(JSFXObject pObject) : CJS_Object(pObject) {}; | 64 virtual ~CJS_Color(void){}; |
| 58 » virtual ~CJS_Color(void){}; | |
| 59 | 65 |
| 60 » DECLARE_JS_CLASS(CJS_Color); | 66 DECLARE_JS_CLASS(CJS_Color); |
| 61 | 67 |
| 62 » JS_STATIC_PROP(black, color); | 68 JS_STATIC_PROP(black, color); |
| 63 » JS_STATIC_PROP(blue, color); | 69 JS_STATIC_PROP(blue, color); |
| 64 » JS_STATIC_PROP(cyan, color); | 70 JS_STATIC_PROP(cyan, color); |
| 65 » JS_STATIC_PROP(dkGray, color); | 71 JS_STATIC_PROP(dkGray, color); |
| 66 » JS_STATIC_PROP(gray, color); | 72 JS_STATIC_PROP(gray, color); |
| 67 » JS_STATIC_PROP(green, color); | 73 JS_STATIC_PROP(green, color); |
| 68 » JS_STATIC_PROP(ltGray, color); | 74 JS_STATIC_PROP(ltGray, color); |
| 69 » JS_STATIC_PROP(magenta, color); | 75 JS_STATIC_PROP(magenta, color); |
| 70 » JS_STATIC_PROP(red, color); | 76 JS_STATIC_PROP(red, color); |
| 71 » JS_STATIC_PROP(transparent, color); | 77 JS_STATIC_PROP(transparent, color); |
| 72 » JS_STATIC_PROP(white, color); | 78 JS_STATIC_PROP(white, color); |
| 73 » JS_STATIC_PROP(yellow, color); | 79 JS_STATIC_PROP(yellow, color); |
| 74 | 80 |
| 75 » JS_STATIC_METHOD(convert,color); | 81 JS_STATIC_METHOD(convert, color); |
| 76 » JS_STATIC_METHOD(equal,color); | 82 JS_STATIC_METHOD(equal, color); |
| 77 | |
| 78 }; | 83 }; |
| 79 | 84 |
| 80 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ | 85 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ |
| OLD | NEW |